hostname有两个地方要改,我通常就改了/etc/hosts.但是碰到了几次java.net.UnknownHostException出错,吸取教训,网上找找,发现两地方都得改。
file1:
修改/etc/sysconfig/network中的hostname
vi /etc/sysconfig/networkHOSTNAME=localhost.localdomain #修改localhost.localdomain为work.xx.ww
file2:
修改/etc/hosts文件
vi /etc/hosts127.0.0.1 localhost.localdomain #修改localhost.localdomain为work.xx.ww
shutdown -r now #最后,重启服务器即可。