In order to avoid a fringe jump caused by high plasma density and pellet injection [Y. Zhou et al., Rev. Sci. Instrum. 87, 11E107 (2016)], a new CO2 dispersion interferometer is designed and commissioned on HL-2A for average line-density measurement and density feedback control. The second harmonic technology in this system eliminates the phase shift caused by mechanical vibration. Signals are processed by a digital phase comparator and can be monitored in real time. A series of experiments are conducted to study the characteristics of the system such as a second harmonic coefficient and long-term stability. The resolution of density measurement is less than 8 × 1017/m3, and the experiment result on HL-2A demonstrates the interferometer's capability to track plasma density evolution with rapid change. The system also shows good stability against mechanical vibrations.