[{"createTime":1735734952000,"id":1,"img":"hwy_ms_500_252.jpeg","link":"https://activity.huaweicloud.com/cps.html?fromacct=261f35b6-af54-4511-a2ca-910fa15905d1&utm_source=V1g3MDY4NTY=&utm_medium=cps&utm_campaign=201905","name":"华为云秒杀","status":9,"txt":"华为云38元秒杀","type":1,"updateTime":1735747411000,"userId":3},{"createTime":1736173885000,"id":2,"img":"txy_480_300.png","link":"https://cloud.tencent.com/act/cps/redirect?redirect=1077&cps_key=edb15096bfff75effaaa8c8bb66138bd&from=console","name":"腾讯云秒杀","status":9,"txt":"腾讯云限量秒杀","type":1,"updateTime":1736173885000,"userId":3},{"createTime":1736177492000,"id":3,"img":"aly_251_140.png","link":"https://www.aliyun.com/minisite/goods?userCode=pwp8kmv3","memo":"","name":"阿里云","status":9,"txt":"阿里云2折起","type":1,"updateTime":1736177492000,"userId":3},{"createTime":1735660800000,"id":4,"img":"vultr_560_300.png","link":"https://www.vultr.com/?ref=9603742-8H","name":"Vultr","status":9,"txt":"Vultr送$100","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":5,"img":"jdy_663_320.jpg","link":"https://3.cn/2ay1-e5t","name":"京东云","status":9,"txt":"京东云特惠专区","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":6,"img":"new_ads.png","link":"https://www.iodraw.com/ads","name":"发布广告","status":9,"txt":"发布广告","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":7,"img":"yun_910_50.png","link":"https://activity.huaweicloud.com/discount_area_v5/index.html?fromacct=261f35b6-af54-4511-a2ca-910fa15905d1&utm_source=aXhpYW95YW5nOA===&utm_medium=cps&utm_campaign=201905","name":"底部","status":9,"txt":"高性能云服务器2折起","type":2,"updateTime":1735660800000,"userId":3}]
在主节点上执行start-dfs.sh命令启动hdfs,无法启动datanode:
1)看一下slaves文件有没有配置正确
2)检查从namenode节点到datanode节点的免密登录是否配置正确;
3)测试一下从namenode上能否ping通datanode,datanode节点的防火墙有没有关(或者如果你的本意就是不关闭防火墙,而是只给hadoop开启特定的端口的话,那就使用telnet命令检查一下从namenode节点到datanode节点的特定端口能不能连接上)
4)还有一种比较特殊的情况,就是你的namenode和datanode节点上,用于安装hadoop环境的用户不一样,比如在namenode节点上用u1用户安装hadoop环境,而在datanode节点上则是用u2用户安装的hadoop环境。这种时候就会有问题,因为当你在namenode上启动hdfs时,肯定是用u1用户执行的命令(因为你是用u1用户安装的hadoop嘛,环境变量是配在这个用户下的),那么当namenode节点要远程登录到datanode节点上去启动datanode时,namenode默认是会使用当前用户也就是u1用户去登录datanode节点的,这个时候就会出错,因为datanode节点上没有u1用户,根本无法登录上datanode,更别说去启动datanode了。对于这个问题,我在网上偶然看到有人的解决方法是在配置masters和slaves时,不单单是写IP(比如192.168.137.22),而是要写上用户名,比如“[email protected]”。正如我所说的,这是个比较特殊的问题,最好还是将hadoop集群的所有节点的安装用户保持一致。另外我感觉如果集群中的不同节点是用不同用户来安装hadoop环境的话,根本无法安装成功,虽然我在网上看到有朋友说他这么安装也成功了……我觉得无法安装成功是因为,这么来安装hadoop集群环境的话,首先namenode节点到datanode节点的免密登录就没法配置,因为在namenode节点上是以u1用户生成的公钥,因此在namenode节点上无法以u2用户的身份免密登录datanode节点——额…至少以我目前了解的ssh免密登录设置的知识来说是不行的…………