Confirm Hosts阶段

/etc/hosts前两行必须是

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

----------------

ERROR 2018-03-08 15:02:25,223 NetUtil.py:88 - [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:579)
ERROR 2018-03-08 15:02:25,223 NetUtil.py:89 - SSLError: Failed to connect. Please check openssl library versions.

有可能是openssl版本不匹配,因环境问题无法升级openssl版本,所以可以进行如下修改:
因为python 2.7.5有的版本(或更高版本)增加了certificate verification,正是因为这个特性导致ambari-agent无法连接server。

解决方法:
修改/etc/python/cert-verification.cfg配置文件:

# vim /etc/python/cert-verification.cfg

[https]

verify=disable

修改为verify=disable,就可以正常注册。
---------------------------

还是失败的话

1、vim /etc/ambari-agent/conf/ambari-agent.ini

查看hostname是否改成本机的主机名;

输入hostname即可知道自己主机的hostname

2、中文和英文操作系统版本问题,中文操作系统出错,英文则成功;

centos6:

修改vim /etc/sysconfig/i18n

LANG="en_US.UTF-8"

SYSFONT="latarcyrheb-sun16"

centos7:

修改vim /etc/locale.conf

LANG="en_US.UTF-8"

LANGUAGE="en_US:en"
---------------------
datanode无法启动

手动启动

/usr/hdp/2.4.0.0-169/hadoop-hdfs/bin/hdfs --config /usr/hdp/current/hadoop-client/conf datanode

19/02/21 13:18:32 FATAL datanode.DataNode: Exception in secureMain
java.lang.ExceptionInInitializerError
        at javax.crypto.KeyGenerator.nextSpi(KeyGenerator.java:340)
        at javax.crypto.KeyGenerator.<init>(KeyGenerator.java:168)
        at javax.crypto.KeyGenerator.getInstance(KeyGenerator.java:223)
        at org.apache.hadoop.security.token.SecretManager.<init>(SecretManager.java:143)
        at org.apache.hadoop.hdfs.security.token.block.BlockPoolTokenSecretManager.<init>(BlockPoolTokenSecretManager.java:36)
        at org.apache.hadoop.hdfs.server.datanode.DataNode.startDataNode(DataNode.java:1148)
        at org.apache.hadoop.hdfs.server.datanode.DataNode.<init>(DataNode.java:429)
        at org.apache.hadoop.hdfs.server.datanode.DataNode.makeInstance(DataNode.java:2414)
        at org.apache.hadoop.hdfs.server.datanode.DataNode.instantiateDataNode(DataNode.java:2301)
        at org.apache.hadoop.hdfs.server.datanode.DataNode.createDataNode(DataNode.java:2348)
        at org.apache.hadoop.hdfs.server.datanode.DataNode.secureMain(DataNode.java:2530)
        at org.apache.hadoop.hdfs.server.datanode.DataNode.main(DataNode.java:2554)
Caused by: java.lang.SecurityException: Can not initialize cryptographic mechanism
        at javax.crypto.JceSecurity.<clinit>(JceSecurity.java:93)
        ... 12 more
Caused by: java.lang.SecurityException: Cannot locate policy or framework files!
        at javax.crypto.JceSecurity.setupJurisdictionPolicies(JceSecurity.java:316)
        at javax.crypto.JceSecurity.access$000(JceSecurity.java:50)
        at javax.crypto.JceSecurity$1.run(JceSecurity.java:85)
        at java.security.AccessController.doPrivileged(Native Method)
        at javax.crypto.JceSecurity.<clinit>(JceSecurity.java:82)
        ... 12 more
19/02/21 13:18:32 INFO util.ExitUtil: Exiting with status 1

jce 版本不对

https://blog.csdn.net/zero__007/article/details/80947247

java8的在http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html
解压后有三个文件:

README.txt                  
local_policy.jar             
US_export_policy.jar  

看README.txt就了解怎么用了,我是将<JAVA_HOME> /jre/lib/security/policy/unlimited里的两个文件替换 。