Hot water heater knocking
Six year old 50-gallon gas hot water heater. Heard a slight bang through the walls and thought it was something dropped upstairs. Then heard a steady knocking from the hot water heater. The water meter ticked in unisyn with the knocking. Knocking stops when water not being heated. Hot water immediately got rusty looking. Drained twice... still rusty looking. Cold runs clear. Do you know what it is and can it be fixed? Never flushed it before because I don't know about such things. Appreciate any help.