What is the role of graphite rods in the electrometallurgy of aluminium?

Graphite rods act as anode during electrolytic reduction of alumina. At anode, O _{ 2 } gas is produced which react with the carbon of anode (rods) to produce CO _{ 2 } gas, so these graphite rods are consumed slowly and need to be replaced from time-to-time.