We propose a carrier synchronization scheme for continuous-variable measurement-device-independent quantum key distribution (CV-MDI-QKD) with a real local oscillator (LO). The middle node Charlie evaluates carrier frequency offsets and phase drift values based on the pilot signal sent by the legal parties Alice and Bob and a part of their public data. Alice and Bob then calibrate their modulation data according to the evaluation parameters to achieve carrier synchronization. We simulate the entire CV-MDI-QKD protocol and verify the feasibility of this scheme. The influences of pilot segment size and public data size on the excess noise are also analyzed. Besides, we experiment to measure the actual frequency offsets and phase drifts in the channel, which gives guidance on the actual implementation. This solution can ensure the implementation of CV-MDI-QKD with a real LO, paving the way for the practical application of this high-rate QKD protocol.