就是一系列下定决心的努力
· 正 · 文 · 来 · 啦 ·
点击红色“Failed”,查看详细错误:
==========================
Creating target directory...
==========================
Command start time 2018-11-27 22:13:32
chmod: cannot access ‘/var/lib/ambari-agent/data’: No such file or directory
Connection to master.hadoop closed.
SSH command execution finished
host=master.hadoop, exitcode=0
Command end time 2018-11-27 22:13:32
==========================
Copying ambari sudo script...
==========================
Command start time 2018-11-27 22:13:32
scp /var/lib/ambari-server/ambari-sudo.sh
host=master.hadoop, exitcode=0
Command end time 2018-11-27 22:13:32
==========================
Copying common functions script...
==========================
Command start time 2018-11-27 22:13:32
scp /usr/lib/python2.6/site-packages/ambari_commons
host=master.hadoop, exitcode=0
Command end time 2018-11-27 22:13:32
==========================
Copying create-python-wrap script...
==========================
Command start time 2018-11-27 22:13:32
scp /var/lib/ambari-server/create-python-wrap.sh
host=master.hadoop, exitcode=0
Command end time 2018-11-27 22:13:32
==========================
Copying OS type check script...
==========================
Command start time 2018-11-27 22:13:32
scp /usr/lib/python2.6/site-packages/ambari_server/os_check_type.py
host=master.hadoop, exitcode=0
Command end time 2018-11-27 22:13:32
==========================
Running create-python-wrap script...
==========================
Command start time 2018-11-27 22:13:32
Connection to master.hadoop closed.
SSH command execution finished
host=master.hadoop, exitcode=0
Command end time 2018-11-27 22:13:32
==========================
Running OS type check...
==========================
Command start time 2018-11-27 22:13:32
Cluster primary/cluster OS family is redhat7 and local/current OS family is redhat7
Connection to master.hadoop closed.
SSH command execution finished
host=master.hadoop, exitcode=0
Command end time 2018-11-27 22:13:33
==========================
Checking 'sudo' package on remote host...
==========================
Command start time 2018-11-27 22:13:33
Connection to master.hadoop closed.
SSH command execution finished
host=master.hadoop, exitcode=0
Command end time 2018-11-27 22:13:33
==========================
Copying required files...
Ambari repo file not found: /etc/yum.repos.d/ambari.repo
==========================
Copying setup script file...
==========================
Command start time 2018-11-27 22:13:33
scp /usr/lib/python2.6/site-packages/ambari_server/setupAgent.py
host=master.hadoop, exitcode=0
Command end time 2018-11-27 22:13:33
==========================
Running setup agent script...
==========================
Command start time 2018-11-27 22:13:33
Ambari repo file not found: /etc/yum.repos.d/ambari.repo
Connection to master.hadoop closed.
SSH command execution finished
host=master.hadoop, exitcode=2
Command end time 2018-11-27 22:13:34
ERROR: Bootstrap of host master.hadoop fails because previous action finished with non-zero exit code (2)
ERROR MESSAGE: Connection to master.hadoop closed.
STDOUT: Ambari repo file not found: /etc/yum.repos.d/ambari.repo
Connection to master.hadoop closed.
方案如下
主要问题出现在最后两行。
上网查找原因,,可能的原因有:
1,地址:http://stackoverflow.com/questions/27531215/ambari-1-7-0-cannot-register-datanodes-in-centos-cluster
说明:查看/etc/ambari-agent/conf/ambari-agent.ini文件,看hostname是否改成本机的主机名;
即,改成对应的master,slave1,slave2;
2,地址:http://superuser.com/questions/825443/registration-with-the-server-failed-while-configuring-amabri-on-centos-7
说明:CentOS版本问题,使用CentOS7的话会失败,使用CentOS6,5成功;
3,地址:http://stackoverflow.com/questions/38423925/ambari-confirm-hosts-step-fails-registration-with-the-server-failed
说明:中文和英文操作系统版本问题,中文操作系统出错,英文则成功;
Hey,thank both of you.i got it.The character in China is UTF8,and Ambari is ascii.And Python 2.6 for UTF8 has a bug.
和
I think this is because I set a non-English language (i.e,. Trad. Chinese) as a default language when I installed CentOs 7. It would encounter a charset problem (UTF-8<->ascii) when confirming hosts. After changing the default language to English, This problem has been solved.
解决方法是将系统的默认语言改成英语。
---------------------
‘ 所谓成功 ’
坚持把简单的事情做好就是不简单,
坚持把平凡的事情做好就是不平凡。
每个人都有潜在的能量,只是很容易--
被习惯所掩盖,
被时间所迷离,
被惰性所消磨。
那么,成功呢?就是在平凡中做出不平凡的坚持。