It sounds like multiple issues to me: The knees swelling could be a reaction to hiking if you don't normally do any sort of hiking or walking otherwise. I'm wondering what you do in the weeks and days leading up to these hiking situations.

As for the headache at 9000 elevation: That's quite likely AMS. Your symptoms make it seem that you are more susceptible than most people.

But I am really curious: You wrote:
> As an aside 4 years ago I developed headache that never went away that feels like altitude headache.
You developed a headache 4 years ago and it sounds like it never ended. Have you been living with it since then?