CentOS7安装CDH5.11.0遇到的too many values to unpack问题解决

1. 报错内容

[29/Jul/2019 15:14:20 +0000] 11107 MainThread agent        INFO     Using parcels directory from server provided value: /opt/cloudera/parcels
[29/Jul/2019 15:14:20 +0000] 11107 MainThread parcel       INFO     Agent does create users/groups and apply file permissions
[29/Jul/2019 15:14:20 +0000] 11107 MainThread parcel_cache INFO     Using /opt/cloudera/parcel-cache for parcel cache
[29/Jul/2019 15:14:20 +0000] 11107 MainThread agent        ERROR    Caught unexpected exception in main loop.
Traceback (most recent call last):
  File "/usr/lib64/cmf/agent/build/env/lib/python2.7/site-packages/cmf-5.11.0-py2.7.egg/cmf/agent.py", line 710, in __issue_heartbeat
    self._init_after_first_heartbeat_response(resp_data)
  File "/usr/lib64/cmf/agent/build/env/lib/python2.7/site-packages/cmf-5.11.0-py2.7.egg/cmf/agent.py", line 948, in _init_after_first_heartbeat_response
    self.client_configs.load()
  File "/usr/lib64/cmf/agent/build/env/lib/python2.7/site-packages/cmf-5.11.0-py2.7.egg/cmf/client_configs.py", line 713, in load
    new_deployed.update(self._lookup_alternatives(fname))
  File "/usr/lib64/cmf/agent/build/env/lib/python2.7/site-packages/cmf-5.11.0-py2.7.egg/cmf/client_configs.py", line 434, in _lookup_alternatives
    return self._parse_alternatives(alt_name, out)
  File "/usr/lib64/cmf/agent/build/env/lib/python2.7/site-packages/cmf-5.11.0-py2.7.egg/cmf/client_configs.py", line 446, in _parse_alternatives
    path, _, _, priority_str = line.rstrip().split(" ")
ValueError: too many values to unpack
[29/Jul/2019 15:14:25 +0000] 11107 MainThread agent        INFO     CM server guid: 2ffb8518-eb39-4108-b668-b33586af781a

以上为报错内容,截图如下:

在这里插入图片描述

2. 解决办法

2.1 备份文件

  • 若不备份,修改失败后就会发现服务启动不了了!注意集群中所有服务器均要备份与修改
# 备份报错中的client_configs.py文件
cp /usr/lib64/cmf/agent/build/env/lib/python2.7/site-packages/cmf-5.11.0-py2.7.egg/cmf/client_configs.py ~/soft/client_configs.py 

2.2 修改文件

  • 一定要注意Python的缩进,一旦缩进不正确文件无法生效,服务无法启动,问题不能得到解决。
# 修改前
     ret = {}
     for line in output.splitlines():
       if line.startswith("/"):
         path, _, _, priority_str = line.rstrip().split(" ")
 
         # Ignore the alternative if it's not managed by CM.
         if CM_MAGIC_PREFIX not in os.path.basename(path):
           continue
 
         try:
           priority = int(priority_str)
         except ValueError:
           THROTTLED_LOG.info("Failed to parse %s: %s", name, line)
 
         key = ClientConfigKey(name, path)
         value = ClientConfigValue(priority, self._read_generation(path))
         ret[key] = value
 
     return ret

# 修改后
    ret = {}
    for line in output.splitlines():
        if line.startswith("/"):
            if len(line.rstrip().split(" "))<=4:
                path, _, _, priority_str = line.rstrip().split(" ")

                # Ignore the alternative if it's not managed by CM.
                if CM_MAGIC_PREFIX not in os.path.basename(path):
                    continue

                try:
                    priority = int(priority_str)
                except ValueError:
                    THROTTLED_LOG.info("Failed to parse %s: %s", name, line)

                key = ClientConfigKey(name, path)
                value = ClientConfigValue(priority, self._read_generation(path))
                ret[key] = value

            else:
                pass
        return ret
  • 修改前

在这里插入图片描述

  • 修改后

在这里插入图片描述

3. 重启agent服务

重启所有节点的agent服务

systemctl restart cloudera-scm-agent
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值