An Ising model for the stress relaxation of solids