Cloudera CDH3安装失败,如何绕过这个?

时间:2012-07-09 20:18:27

标签: hadoop sysadmin cloudera

我正在尝试将CHD3安装到3节点群集上。我通过Cloudera Manager启动安装。这三个安装都失败了。

在/var/log/cloudera-scm-agent/cloudera-scm-agent.out中Cloudera安装失败后,我看到了这个错误:

  File "/usr/lib64/cmf/agent/src/cmf/agent.py", line 19, in <module>
    import psutil
  File "/usr/lib64/cmf/agent/build/env/lib/python2.6/site-packages/psutil-0.3.0-py2.6-linux-x86_64.egg/psutil/__init__.py", line 84, in <module>
    TOTAL_PHYMEM = _psplatform.phymem_usage()[0]
  File "/usr/lib64/cmf/agent/build/env/lib/python2.6/site-packages/psutil-0.3.0-py2.6-linux-x86_64.egg/psutil/_pslinux.py", line 122, in phymem_usage
    percent = usage_percent(total - (free + buffers + cached), total,
TypeError: unsupported operand type(s) for +: 'int' and 'NoneType'

显然,在启动时运行的Python解释器将“free”,“buffers”或“cached”视为具有NoneType,并且此错误会导致整个安装回滚。

有人可以告知为什么会出现这种情况和/或解决问题吗?

提前致谢。

1 个答案:

答案 0 :(得分:1)

问题在于_pslinux.py中的phymem_usage():

def phymem_usage():
    # total, used and free values are matched against free cmdline utility
    # the percentage matches top/htop and gnome-system-monitor
    f = open('/proc/meminfo', 'r')
    try:
        total = free = buffers = cached = None
        for line in f:
            if line.startswith('MemTotal:'):
                total = int(line.split()[1]) * 1024
            elif line.startswith('MemFree:'):
                free = int(line.split()[1]) * 1024
            elif line.startswith('Buffers:'):
                buffers = int(line.split()[1]) * 1024
            elif line.startswith('Cached:'):
                cached = int(line.split()[1]) * 1024
                break
        used = total - free
        percent = usage_percent(total - (free + buffers + cached), total,
                                _round=1)
        return ntuple_sysmeminfo(total, used, free, percent)
    finally:
        f.close()

请注意,它正在检查/ proc / meminfo并将字段转换为整数,而不检查这些字段是否存在。在某些系统(包括某些虚拟化技术)上,可能会丢失缓冲区或缓存。 (LSB规范声明大多数这些字段都是可选的。)

快速解决方法是将/ proc / meminfo更改为/ tmp / meminfo,“cat / proc / meminfo&gt; / tmp / meminfo”,并添加如下行:

缓冲区:0 kB