进入CM报错
进入对应主机查看cloudera-scm-agent状态,发现服务状态不对
service cloudera-scm-agent status
在解决故障的过程中,查看/var/log/cloudera-scm-agent中的log未发现问题,检查了该节点的防火墙、SELinux、磁盘空间大小,防火墙和SELinux处于关闭状态,磁盘空间充足。
通过journalctl -xe #显示最新的系统日志信息, 并尝试解释错误信息
journalctl -xe
在系统日志中发现报错/usr/bin/python2: No such file or directory,
在/usr/bin;/sbin;/bin;/usr/sbin等目录下未找到python命令导致
查看/usr/bin目录下python,发现没有python
ll /usr/bin/python*
查看Python版本,发现Python被升级到了3.7
python --version
删除现有Python
rpm -qa|grep python|xargs rpm -ev --allmatches --nodeps ##强制删除已安装程序及其关联
删除所有残余文件
whereis python |xargs rm -frv ##删除所有残余文件
##xargs,允许你对输出执行其他某些命令
验证删除
whereis python ##验证删除,返回无结果
创建目录python用以存放rpm包
mkdir /opt/python
切换到python目录
cd /opt/python
查看centos版本
cat /etc/redhat-release
使用wget分别下载python的rpm包(注意:一定要和系统的版本号对应)
wget http://mirrors.163.com/centos/7.9.2009/os/x86_64/Packages/libxml2-python-2.9.1-6.el7.5.x86_64.rpm
wget http://mirrors.163.com/centos/7.9.2009/os/x86_64/Packages//python-libs-2.7.5-89.el7.x86_64.rpm
wget http://mirrors.163.com/centos/7.9.2009/os/x86_64/Packages/python-ipaddress-1.0.16-2.el7.noarch.rpm
wget http://mirrors.163.com/centos/7.9.2009/os/x86_64/Packages/python-backports-1.0-8.el7.x86_64.rpm
wget http://mirrors.163.com/centos/7.9.2009/os/x86_64/Packages/python-backports-ssl_match_hostname-3.5.0.1-1.el7.noarch.rpm
wget http://mirrors.163.com/centos/7.9.2009/os/x86_64/Packages/python-2.7.5-89.el7.x86_64.rpm
wget http://mirrors.163.com/centos/7.9.2009/os/x86_64/Packages/python-iniparse-0.4-9.el7.noarch.rpm
wget http://mirrors.163.com/centos/7.9.2009/os/x86_64/Packages/python-pycurl-7.19.0-19.el7.x86_64.rpm
wget http://mirrors.163.com/centos/7.9.2009/os/x86_64/Packages/python-urlgrabber-3.10-10.el7.noarch.rpm
wget http://mirrors.163.com/centos/7.9.2009/os/x86_64/Packages/python-setuptools-0.9.8-7.el7.noarch.rpm
wget http://mirrors.163.com/centos/7.9.2009/os/x86_64/Packages/python-kitchen-1.1.1-5.el7.noarch.rpm
wget http://mirrors.163.com/centos/7.9.2009/os/x86_64/Packages/python-chardet-2.2.1-3.el7.noarch.rpm
wget http://mirrors.163.com/centos/7.9.2009/os/x86_64/Packages/rpm-python-4.11.3-45.el7.x86_64.rpm
安装python
## 出现安装包的依赖问题,在后面加上参数如下解决即可:
## --nodeps --force 为不考虑依赖包,强制安装。
rpm -Uvh --replacepkgs lvm2-python-libs*.rpm --nodeps --force
rpm -Uvh --replacepkgs libxml2-python*.rpm --nodeps --force
rpm -Uvh --replacepkgs python*.rpm --nodeps --force
rpm -Uvh --replacepkgs rpm-python*.rpm --nodeps --force
查看Python版本,Python降回2.7.5
python --version
再次查看/usr/bin目录下python,发现有python2了
ll /usr/bin/python*
再次启动cloudera-scm-agent状态正常了
service cloudera-scm-agent start
再次进入CM中,主机上线