Wednesday, October 14, 2009

Changing your linux hostname (RedHat)

Recently I tripped up when I got another linux box and move my old machine to a new hostname. This actually manifested itself as an error when I installed oracle and oracle could not find the localhost machine since the old machine name that was still configured. The oracle error was:
Enterprise Manager Config failed due to Invalid value null for parameter PORT
Yeah...not exactly a great error message, but when I ran emctl the error was clearer. The steps to making sure you change your host name are simply:
  1. edit /etc/sysconfig/network. Change the line HOSTNAME=[hostname of machine]
  2. edit /etc/hosts. On the loop back adapter add in your new hostname. If you use static IP add in the IP address mapping too. 
  3. run: service network restart, to restart the network with the new settings
Then just exit out of any terminal window that might have cached the network settings before executing your required task.

No comments: