ambari配置注意事項
阿新 • • 發佈:2020-12-21
host檔案及主機名配置
1、host檔案配置
如果有三臺伺服器
192.168.0.51 (master)
192.168.0.52 (slave1)
192.168.0.101 (slave2)
[root@ecs-c562-0001 ~]# cat /etc/hosts 192.168.0.51 ecs-c562-0001 ecs-c562-0001.localdomain 192.168.0.52 ecs-c562-0002 ecs-c562-0002.localdomain 192.168.0.101 ecs-c562-0003 ecs-c562-0003.localdomain ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 127.0.0.1 ecs-c562-0001 ecs-c562-0001
2、hostname主機名配置
修改各主分機的主機名,以master為例:
[root@ecs-c562-0001 ~]# cat /etc/hostname
ecs-c562-0001.localdomain
[root@ecs-c562-0001 ~]# hostname
ecs-c562-0001.localdomain
[root@ecs-c562-0001 ~]# hostname -f
ecs-c562-0001
ambari配置“Confirm Hosts”出現錯誤解決
1、Failed to connect to https://xxxx:8440/ca due to [Errno 111] Connection 類似錯誤解決
一般來說 xxxx可能是localhost,完整錯誤有可能是這樣的:
Failed to connect to https://localhost:8440/ca due to [Errno 111] Connection refused
解決辦法:
例:如果是ecs-c562-0002.localdomain出錯,則在當前分機上修改ambari-agent.ini檔案的hostname為master的主機名ecs-c562-0001.localdomain(對應的哪個節點報錯對應改哪一個節點)
vim /etc/ambari-agent/conf/ambari-agent.ini
[server] hostname=ecs-c562-0001.localdomain #把這個hostname修改為master的主機名 url_port=8440 secured_url_port=8441 connect_retry_delay=10 max_reconnect_retry_delay=30
修改完成後 ambari-agent restart
重啟試試,應該可以。
2、Ambari Agent host cannot reach Ambari Server 'localhost:8080'.
從ambari-server傳送到客戶端的setupAgent.py指令碼的main函式中的引數設定不對,直接在master節點上修改setupAgent.py檔案的:
vim /usr/lib/ambari-server/lib/ambari_server/setupAgent.py
找到
expected_hostname = args[0]
passPhrase = args[1]
#hostname = args[2]
hostname = '192.168.0.51' #我這裡直接是改成主機的IP了,也可以改成master的主機名試試
user_run_as = args[3]
projectVersion = ""
server_port = 8080
然後重新執行一遍Confirm Hosts
試試。