After Joshua led Israel into Canaan, the tabernacle was set up at Shiloh. Shiloh was in the middle of the Promised Land, a location that was generally accessible to most of the tribes. This is why Elkanah goes to worship at Shiloh. The fact that he goes on a yearly basis could be a reference to an annual family occasion or one of the three annual pilgrimage festivals (possibly the Feast of Tabernacles).
3 Now this man used to go up year by year from his city to worship and to sacrifice to the LORD of hosts at Shiloh, where the two sons of Eli, Hophni and Phinehas, were priests of the LORD.