单机部署haddop测试,执行./start-dfs.sh
报错如下:
Starting namenodes on [localhost]
上一次登录:五 9月 17 21:51:12 CST 2021从 172.16.206.1pts/1 上
localhost: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).
Starting datanodes
上一次登录:五 9月 17 21:51:32 CST 2021pts/0 上
localhost: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).
Starting secondary namenodes [bigdata]
上一次登录:五 9月 17 21:51:32 CST 2021pts/0 上
bigdata: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).
经过排查发现是没有设置免密登录,解决方案如下:
ssh-keygen -t rsa
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
chmod 0600 ~/.ssh/authorized_keys
如果是集群模式,则需要设置集群节点之间的免密登录。