This question already has an answer here:
Trying to remember title (and even most content!) of following story:
Something along the lines of a gigantic abandoned spaceship drifting through the galaxy for over a galactic turn, humans had colonised it and run it, and trade passage on the spaceship with other races in return for technology/goods. Think the main plot was over an attempted take over of the ship by another race.
Apologies for vagueness.