1. 程式人生 > >CDH分支節點無法被監聽,錯誤提示ValueError: too many values to unpack

CDH分支節點無法被監聽,錯誤提示ValueError: too many values to unpack

檢查系統是否安裝有兩個版本的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.originalfor 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.

我的問題就這麼解決了,可能出現的問題略有不同,僅供參考。