An all fiber Q-switched Ytterbium-Doped Fiber （YDF） laser in Master Oscillator Power-Amplifier (MOPA) configuration is proposed theoretically and demonstrated experimentally, and the principle analysis and experimental verification are presented in details. Firstly, the system configuration is designed. The system is composed of the seed and the amplifier stage. Two 915nm LDs are used for pumping light, and the light is coupled into the gain medium of the seed and the amplifier stage by two combiners, respectively. Two Fiber Bragg Gratings (FBGs) are used as ends of the cavity of the seed. One Q-switch is used to modulate output laser of the seed, and the amplifier stage is adopted to amplify the light behind the seed. Then, 10m YDF with single mode is selected for the gain medium of the seed, and 8m YDF with multimode is used as the gain medium of the amplifier stage. The output laser of the seed with a 1.02W average power is realized when the seed pump power is 5.74W, the repetition rate is 20KHz and the action time of the Q-switch is 3.5μs. Meanwhile, a 7.58W pump power of the amplifier stage is used to amplify the seed laser. Finally, output laser with the pulse width of 90ns and the average output power of 4.93W are achieved.