ambari配置注意事項


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試試。

3、does not match expected ambari server hostname 錯誤提示解決

vm-100-5-centos主機名示例:
當報

INFO 2020-12-26 13:04:21,057 main.py:481 - Connecting to Ambari server at https://vm-100-2-centos:8440 (192.168.100.2)
INFO 2020-12-26 13:04:21,057 NetUtil.py:61 - Connecting to https://vm-100-2-centos:8440/ca
ERROR 2020-12-26 12:43:48,835 main.py:269 - Ambari agent machine hostname (vm-100-5-centos) does not match expected ambari server hostname (vm-100-5-centos.localdomain). Aborting registration. Please check hostname, hostname -f and /etc/hosts file to confirm your hostname is setup correctly

錯誤,在確保/etc/hostshostname沒有問題的前提下,telnet vm-100-2-centos 8440,發現不通。
因為機器用的是騰訊雲,除了本地機器防火牆關外,還要在騰訊雲控制台上設置安全組,開放需要的端口。這樣一般就可以得到解決。

3、hive報錯The MySQL JDBC driver has not been set ……ambari-server setup --jdbc-db=mysql --jdbc-driver=/path/to/jdbc_driver

報錯如下:

2020-12-28 20:17:49,162 - Check db_connection_check was unsuccessful. Exit code: 1. Message: The MySQL JDBC driver has not been set. Please ensure that you have executed 'ambari-server setup --jdbc-db=mysql --jdbc-driver=/path/to/jdbc_driver'.

Traceback (most recent call last):
  File "/var/lib/ambari-agent/cache/custom_actions/scripts/check_host.py", line 546, in <module>
    CheckHost().execute()
  File "/usr/lib/ambari-agent/lib/resource_management/libraries/script/script.py", line 352, in execute
    method(env)
  File "/var/lib/ambari-agent/cache/custom_actions/scripts/check_host.py", line 207, in actionexecute
    raise Fail(error_message)
resource_management.core.exceptions.Fail: Check db_connection_check was unsuccessful. Exit code: 1. Message: The MySQL JDBC driver has not been set. Please ensure that you have executed 'ambari-server setup --jdbc-db=mysql --jdbc-driver=/path/to/jdbc_driver'.


2020-12-28 20:27:00,725 - Check db_connection_check was unsuccessful. Exit code: 1. Message: The MySQL JDBC driver has not been set. Please ensure that you have executed 'ambari-server setup --jdbc-db=mysql --jdbc-driver=/path/to/jdbc_driver'.

Traceback (most recent call last):
  File "/var/lib/ambari-agent/cache/custom_actions/scripts/check_host.py", line 546, in <module>
    CheckHost().execute()
  File "/usr/lib/ambari-agent/lib/resource_management/libraries/script/script.py", line 352, in execute
    method(env)
  File "/var/lib/ambari-agent/cache/custom_actions/scripts/check_host.py", line 207, in actionexecute
    raise Fail(error_message)
resource_management.core.exceptions.Fail: Check db_connection_check was unsuccessful. Exit code: 1. Message: The MySQL JDBC driver has not been set. Please ensure that you have executed 'ambari-server setup --jdbc-db=mysql --jdbc-driver=/path/to/jdbc_driver'.

解決方法:

ambari-server setup --jdbc-db=mysql --jdbc-driver=/usr/share/java/mysql-connector-java.jar

4、nameNode啟動時報錯:/usr/hdp/current/hadoop-hdfs-namenode/bin/hdfs dfsadmin -fs hdfs:……-safemode get | grep 'Safe mode is OFF'' returned 1.

報錯大體內容如下:

2020-12-29 09:47:51,546 - Execute['/usr/hdp/current/hadoop-hdfs-namenode/bin/hdfs dfsadmin -fs hdfs://vm-16-2-centos.localdomain:8020 -safemode get | grep 'Safe mode is OFF''] {'logoutput': True, 'tries': 115, 'user': 'hdfs', 'try_sleep': 10}
2020-12-29 09:47:53,497 - Retrying after 10 seconds. Reason: Execution of '/usr/hdp/current/hadoop-hdfs-namenode/bin/hdfs dfsadmin -fs hdfs://vm-16-2-centos.localdomain:8020 -safemode get | grep 'Safe mode is OFF'' returned 1. 
2020-12-29 09:48:05,262 - Retrying after 10 seconds. Reason: Execution of '/usr/hdp/current/hadoop-hdfs-namenode/bin/hdfs dfsadmin -fs hdfs://vm-16-2-centos.localdomain:8020 -safemode get | grep 'Safe mode is OFF'' returned 1. 

解決方法:

# su hdfs   //切換到hdfs用戶,若關閉了hdfs的權限則可略過這一步
# hadoop dfsadmin -safemode leave   //讓namenode離開安全模式

Timeline Service V2.0 Reader 無法啟動

報錯如下:

resource_management.core.exceptions.ExecuteTimeoutException: Execution of 'ambari-sudo.sh su yarn-ats -l -s /bin/bash -c 'export  PATH='"'"'/usr/sbin:/sbin:/usr/lib/ambari-server/*:/usr/sbin:/sbin:/usr/lib/ambari-server/*:/usr/lib64/qt-3.3/bin:/usr/java/jdk1.8.0_241/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin:/var/lib/ambari-agent:/var/lib/ambari-agent'"'"' ; sleep 10;export HBASE_CLASSPATH_PREFIX=/usr/hdp/3.1.0.0-78/hadoop-yarn/timelineservice/*; /usr/hdp/3.1.0.0-78/hbase/bin/hbase --config /usr/hdp/3.1.0.0-78/hadoop/conf/embedded-yarn-ats-hbase org.apache.hadoop.yarn.server.timelineservice.storage.TimelineSchemaCreator -Dhbase.client.retries.number=35 -create -s'' was killed due timeout after 300 seconds
  • 解決方法:
將yarn配置文件中的is_hbase_system_service_launch和use_external_hbase勾選


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM