© 2015, Science Press. All right reserved. Microbial electrolysis cells (MECs) has been recently developed as a new technology for hydrogen production. The organics are degraded by exoelectrogens in anode biofilm and transport electrons directly to anode, while hydrogen is produced by combining electrons and protons on the surface of Pt-catalyzing cathode under a small external voltage between anode and cathode. Municipal waste water was used as the same inoculum to enrich functional communities in 15 single chamber MEC reactors. Various gas production (hydrogen and methane) was maintained over 1 month using glucose as the sole carbon source in phosphate buffer solution (50 mmol·L-1, pH=7.0). The highest hydrogen production rate was up to (3.9±0.6) mol H2/mol glucose with conversion rate of 32.2% for high-H2generation MECs. The highest methane conversion rate was 48.4% in low-H2generation MECs. A 48 h low pH shock was put into anode biofilm and MEC performances were recovered to their functions in 10~15 d. The microbial diversities increased and gas production rates were changed after low pH shock. Hydrogen yield was reduced by 1.8 mol H2/mol glucose in high-H2generation MECs, while the methane yield increased by 0.4 mol CH4/mol glucose. Based on Geochip analysis, cytochrome C genes were mostly enriched in high-H2yield MECs. Thus functional genes were still recovered dominantly after low pH shock and it supported the recovery of electron transport. The carbon degradation genes were substantially changed among anodic communities in most MECs. The functional genes of labile carbon degradation and methane production were significantly changed after microbial community recovery. The carbon degradation gene structure was more significantly changed in high-H2yield MECs than high-methane yield MECs. The methane increase and hydrogen decrease matched well with their stoichiometric relationship.