Synchronization is of great scientific interest due to the abundant applications in a wide range of systems. We propose an all-optical scheme to achieve the controllable long-distance synchronization of two dissimilar optomechanical systems, which are unidirectionally coupled through a fiber with light. Synchronization, unsynchronization, and the dependence of the synchronization on driving laser strength and intrinsic frequency mismatch are studied based on the numerical simulation. Taking the fiber attenuation into account, we show that two optomechanical resonators can be unidirectionally synchronized over a distance of tens of kilometers. We also analyze the unidirectional synchronization of three optomechanical systems, demonstrating the scalability of our scheme.