TOKYO - Former New York Yankees pitcher Masahiro Tanaka has agreed to a two-year contract with the Rakuten Eagles, his first pro team, the Pacific League club said Thursday.