问题1、ERROR Failed to connect to previous supervisor
问题背景:
CDH有一台服务器重启,然后重启agent的服务的时候总是重启后自动挂掉,该节点的所有大数据的组件都不能开启。
查看log目录下的agent启动日志发现报如下错误:
ERROR Failed to connect to previous supervisor
后来查询有解释说,是因为服务器重启后,再启动agent会报这个错误,除非删掉主机重新配置集群supervisor重启有残留配置在,需要清空对应的文件,再重启才有效
1、找到supervisor
ps aux|grep super
2、杀掉进程supervisord
kill -9 supervisor进程号
3、重启cloudera-scm-agent
service cloudera-scm-agent start
问题2、cloudera-scm-agent 已死,但 pid 文件存在
问题背景:
重启cloudera-scm-agent服务时候报如下错误:
cloudera-scm-agent 已死,但 pid 文件存在
这种报错需要删除旧的,进入 /var/run/ 里面找到 cloudera-scm-agent里面删除这个pid
[root@hadoop22 ~]# /opt/cm-5.7.2/etc/init.d/cloudera-scm-agent status
cloudera-scm-agent 已死,但 pid 文件存在
[root@hadoop22 ~]# ll /opt/cm-5.7.2/run/cloudera-scm-agent/
总用量 4
drwxr-x--x 2 root root 10 12月 3 2019 cgroups
-rw-r--r-- 1 root root 6 7月 10 23:26 cloudera-scm-agent.pid
prw------- 1 root root 0 7月 10 23:27 events
drwxr-xr-x 2 root root 73 12月 3 2019 flood
drwxr-x--x 2 root root 40 7月 10 22:48 process
drwxr-x--x 3 root root 142 7月 10 23:27 supervisor
[root@hadoop22 ~]# rm /opt/cm-5.7.2/run/cloudera-scm-agent/cloudera-scm-agent.pid
rm:是否删除普通文件 "/opt/cm-5.7.2/run/cloudera-scm-agent/cloudera-scm-agent.pid"?y
[root@hadoop22 ~]# /opt/cm-5.7.2/etc/init.d/cloudera-scm-agent start
Starting cloudera-scm-agent: [ 确定 ]
问题3、执行cloudera-scm-agent 命令时报 XXX:未找到命令
集群之前运转都很正常,由于某些原因需要重启集群服务。CDH集群的一台在重启的时候,执行 cloudera-scm-agent start时突然报错:
./ cloudera-scm-agent : 行125 :checkpid:未找到命令
执行cloudera-scm-agent status的时候同样报错:
./ cloudera-scm-agent : 行252 :status:未找到命令
看到错误郁闷了好久,之前都运行正常怎么现在启动命令就报错呢?最后偶然间发现服务器的service命令不能使用了,前人流的坑呀后人埋。重新安装service服务,再次执行 cloudera-scm-agent start就好了。
总结:
一般这种命令不存在的错误是由于依赖的软件缺失导致,重新看看依赖的服务是否正常使用。