CDH分支节点无法被监听,错误提示ValueError: too many values to unpack

来源:互联网 发布:26周胎儿四维彩超数据 编辑:程序博客网 时间:2024/06/06 04:49

检查系统是否安装有两个版本的JDK,配置文件是不是指向了oracleJDK,我的情况是指向了openJDK,就先按照我的另一个博客(http://blog.csdn.net/data8866/article/details/60869118),修改了系统的环境变量,使之指向oracleJDK。

一般情况下卸载了openJDK之后应该问题已经解决,入围解决可查看一下链接:https://community.cloudera.com/t5/Cloudera-Manager-Installation/Mismatched-CDH-versions-host-has-NONE-but-role-expect-5/td-p/48780

里边有CM专业人士的回答:

I just tested a proposed fix that I think is pretty safe if you need to get by this problem in the agent without uninstalling OpenJDK.

DISCLAIMER:

 

This code change worked properly in my personal testbed and I think it is sound, but Cloudera engineering will need to confirm or provide an altenate fix.  Use at your own risk.

 

Possible code fix for the agent issue.  You can perform these steps on the agent host where the problem occurs:


(1)

 

Find your "client_configs.py" file.  For 5.9.0 it will be:

 

/usr/lib64/cmf/agent/build/env/lib/python2.7/site-packages/cmf-5.9.0-py2.7.egg/cmf/client_configs.py

 

The version number after the "cmf-" in cmf-5.9.0-py2.7.egg will reflect your version number.  If you are on 5.8.3 it will look like this:

 

/usr/lib64/cmf/agent/build/env/lib/python2.7/site-packages/cmf-5.8.3-py2.7.egg/cmf/client_configs.py

 

(2)

 

Back up your "client_configs.py file (cp client_configs.py client_configs.py.original for example)

 

(3)

 

Edit client_configs.py with the following diff as your guide:

 

diff -u client_configs.py.original_cdh583 client_configs.py
--- client_configs.py.original_cdh583 2017-01-03 08:28:23.922822423 -0800
+++ client_configs.py 2017-01-03 08:26:56.073261511 -0800
@@ -441,7 +441,12 @@
ret = {}
for line in output.splitlines():
if line.startswith("/"):
- path, _, _, priority_str = line.rstrip().split(" ")
+ #path, _, _, priority_str = line.rstrip().split(" ")
+ #proposed fix for Cloudera Internal Jira OPSAPS-38086
+ thisLine = line.rstrip().split(" ")
+ path = thisLine[0]
+ priority_str = thisLine[-1]

 

Basically, all you are doing is commenting out

path, _, _, priority_str = line.rstrip().split(" ")
and then adding:

 

thisLine = line.rstrip().split(" ")
path = thisLine[0]
priority_str = thisLine[-1]

 

WARNING:  Make sure the indentiation is exact as python requires it.  The end result should look like this (chanages in red):

 

   for line in output.splitlines():
      if line.startswith("/"):
        #path, _, _, priority_str = line.rstrip().split(" ")
        #proposed fix for OPSAPS-38086
        thisLine = line.rstrip().split(" ")
        path = thisLine[0]
        priority_str = thisLine[-1]

 

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

(4)

 

Save and restart the agent on the host where you made the code change:

 

service cloudera-scm-agent restart

 

Note: The code change merely creates a list of the "split" elements rather than hard-coding the columns.  The code only needs the first and last columns, so if we take the first and last elements in the list, the code is happy.

 

This means the following "update-alternatives --display" output will no longer cause the exception in the agent:

 

/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.111-2.b15.el7_3.x86_64/jre - family java-1.8.0-openjdk.x86_64 priority 1800111

 

Please test if you have the skills to modify files and let me know your results.


我的问题就这么解决了,可能出现的问题略有不同,仅供参考。

0 0
原创粉丝点击