High-energy electron beam can be generated during the breakdown process in a gas diode at elevated pressures. The design of electrodes in the gas diode affects the parameters of these electron beams. In this paper, investigation on parameters of the runaway electron beam (REB) in air and nitrogen excited by nanosecond pulsed generators are presented. Experiments were carried out with gas diodes by using cathode and anode made of different materials, including stainless steel, aluminum, copper and titanium. Experimental results show that, in the case of nanosecond-pulse breakdown, the cathode material significantly affects the amplitude of the REB current pulse when either pressure or gap spacing are small. When the pressure is low, the REB current is highest for the stainless steel cathode due to its small electron work function. However, the REB current for the aluminum, copper and titanium cathodes is higher than that of stainless steel cathode at atmospheric pressure because of the Malter effect on their surfaces. The dependence of the amplitude of the REB current on the anode foils is investigated by using aluminum, titanium, copper and tantalum. The experimental results show that the atomic number of the metal, as well as mass mean free path of the electron in it contribute to the amplitude of the REB current pulse. Based on the REB currents of different anode foils, energy distribution of runaway electrons is estimated. Electron distribution with an average energy of ~55 keV is obtained when the amplitude of the applied voltage pulse across the discharge gap is 110 kV. The results may contribute to the design of the gas diode for the generation of high-energy electron beams in nanosecond-pulse breakdown.