ambari-server更改主机名后无法启动

1.安装ambari-server并启动运行一段时间后,把集群所有主机名都修改了(并在mysql中赋权),此时hadoop服务正常,但是在添加hive时报错链接不上ambari-server,于是想要重启ambari-server,发现无法启动,报错日志:

01 Sep 2020 10:09:50,425 ERROR [main] DBAccessorImpl:117 - Error while creating database accessor
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
        at sun.reflect.GeneratedConstructorAccessor37.newInstance(Unknown Source)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    ..........................

        at com.google.inject.Guice.createInjector(Guice.java:62)
        at org.apache.ambari.server.controller.AmbariServer.main(AmbariServer.java:984)
Caused by: java.net.UnknownHostException: wkz-244
        at java.net.InetAddress.getAllByName0(InetAddress.java:1280)
        at java.net.InetAddress.getAllByName(InetAddress.java:1192)
        at java.net.InetAddress.getAllByName(InetAddress.java:1126)
        at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:188)
        at com.mysql.jdbc.MysqlIO.(MysqlIO.java:300)

2.中间过程略

3.解决办法:修改/etc/ambari-server/conf/ambari.properties,把里面的wkz-244改成新的hostname(如下),再次启动成功。


server.jdbc.rca.url=jdbc:mysql://wkz-244:3306/ambari
server.jdbc.url=jdbc:mysql://wkz-244:3306/ambari

 

你可能感兴趣的:(大数据运维之ambari日常)