The existence of fast radio bursts (FRBs), a new type of extragalatic transients, has been established recently and quite a few models have been proposed. In this work we discuss the possible connection between the FRB sources and ultra-high energy ($>10^{18}$ eV) cosmic rays. We show that in the blitzar model and the model of merging binary neutron stars, the huge energy release of each FRB central engine together with the rather high rate of FRBs, the accelerated EeV cosmic rays may contribute significantly to the observed ones. In other FRB models including for example the merger of double white dwarfs and the energetic magnetar radio flares, no significant EeV cosmic ray is expected. We also suggest that the mergers of double neutron stars, even if they are irrelevant to FRBs, may play a non-ignorable role in producing EeV cosmic ray protons if supramassive neutron stars were formed in a good fraction of mergers and the merger rate is $gtrsim 10^{3}~{rm yr^{-1}~ Gpc^{-3}}$. Such a possibility will be unambiguously tested in the era of gravitational wave astronomy.