I'd like to point out that the song is probably inspired by Dante's Ulysses instead of the one we know thanks to Odyssey.
Ulysses appears in 26th canto of Inferno in the Divine Comedy, where is damned with Diomede for being a "fraudulent counselor" during his life (he convinced Achilles to participate in the Trojan War and he did something else - Trojan Horse, Palladium theft, etc) and he tells Dante how he died: after coming back to Penelope he left his homeland again to cross the Pillars of Hercules (the Strait of Gibraltar) and reach the unknown hemisphere of the world, which was supposed to be without lands and without inhabitants. When Ulysses saw the mountain of Purgatory from a distance God decided to put an end to his and his companions' lives, even if he isn't in Hell for this deed.
Dante could never read the whole Odyssey; he based this part of his work on different Roman sources (Ovid, Seneca, Cicero, Virgil, Horace) and medieval legends, so he just had available comments of some passages, (the proem and the episode of the sirens) some quotes about the character and a transcription in Latin of the proem. While Homer underlines various aspects of the "scelerum inventor" (inventor of misfortunes, as Virgil describes him in his Aeneid) related to the Greek culture, Dante focuses on his curiosity and his search for knowledge.
I have sailed to many lands,
now I make my final journey
On the bow I stand,
west is where I go
In his journey through the Mediterranean after the Trojan War Ulysses has actually "sailed to many lands", and in medieval legends he decides later to head west, towards the Pillars. (Ithaca is in Greece, Gibraltar in the Iberian Peninsula)
Through the night I plough, still my heart,
calculate and pray
As the compass swings,
my will is strong,
I will not be led astray
[...]
Nowhere left to run,
navigator’s son,
Chasing rainbows all my days
Where I go I do not know,
I only know the place I’ve been
During Middle Ages nobody really knew what was to the west of Europe and Africa, and the navigators knew that their beliefs were nothing but speculations, hence the uncertainty of Ulysses. He doesn't know where he's going, so "I only know the place I've been" (the part of world then known) acquires a very intriguing meaning when the last unknown path is undertaken, the only one left to be explored to the "son"s of the navigators of the past.
I see the ghosts of navigators
but they are lost
As they sail into the sunset
they’ll count the cost
As their skeletons accusing
emerge from the sea
The sirens of the rocks,
they beckon me
"The ghosts of navigators" may be the travel friends of Ulysses, who die in both these journeys in different ways and places, but probably they are just who followed him in the second one as "they sail into the sunset", meaning west. It is just as likely that Ulysses is persecuted by their memory even if he continues to pursue knowledge, metaphorically represented by the sirens: it was said that whoever listened to their song obtained an incommensurable wisdom if survived their meeting, as Ulysses does in a famous episode of the Odyssey commented by Cicero.
I steer between the crashing rocks,
the sirens call my name
Lash my hands onto the helm,
blood surging with the strain
I will not fail now as
sunrise comes the darkness left behind
For eternity I follow on there is no other way
Mysteries of time clouds that hide the sun
But I know, I know
His journey leads Ulysses to see the mountain of Purgatory from afar, from which Dante later succeeds in arriving in Heaven. Although in the Divine Comedy it's described as a "folle volo", (which literally means mad flight, but in Divine Comedy madness isn't losing your mind, but losing your faith) the path of Ulysses in the song is seen in a different way: it is a path of redemption, in which Ulysses uses all his strength to get as close as possible to God ("the sun" hidden by "clouds"). But the redemption, characteristic of Purgatory, is not granted to those who are condemned to Hell. And now he knows, he knows.