近期ambari有 一台客户端一直为lost状态,各服务无法操作,查看ambari-agent状态正常。
# service ambari-agent status
Found ambari-agent PID: 1313
ambari-agent running.
Agent PID at: /var/run/ambari-agent/ambari-agent.pid
Agent out at: /var/log/ambari-agent/ambari-agent.out
Agent log at: /var/log/ambari-agent/ambari-agent.log
查看日志
#vi /var/log/ambari-agent/ambari-agent.log
UnicodeDecodeError: 'utf8' codec can't decode byte 0xd2 in position 5: invalid continuation byte
ERROR 2015-12-09 09:53:47,902 Controller.py:186 - Error:'utf8' codec can't decode byte 0xd2 in position 5: invalid continuation byte
WARNING 2015-12-09 09:53:47,902 Controller.py:187 - Sleeping for 12 seconds and then trying again
ERROR 2015-12-09 09:53:59,969 Controller.py:185 - Unable to connect to:
Traceback (most recent call last):
File "/usr/lib/python2.6/site-packages/ambari_agent/Controller.py", line 130, in registerWithServer
data = json.dumps(self.register.build(self.version))
File "/usr/lib/python2.6/site-packages/ambari_simplejson/__init__.py", line 230, in dumps
return _default_encoder.encode(obj)
File "/usr/lib/python2.6/site-packages/ambari_simplejson/encoder.py", line 200, in encode
chunks = self.iterencode(o, _one_shot=True)
File "/usr/lib/python2.6/site-packages/ambari_simplejson/encoder.py", line 260, in iterencode
return _iterencode(o, 0)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xd2 in position 5: invalid continuation byte
有些关于编码的问题,是不是因为系统支持的语言或者编码问题,
使用locale查看目前的支持语言:
# locale
LANG=zh_CN.GB18030
LC_CTYPE="zh_CN.GB18030"
LC_NUMERIC="zh_CN.GB18030"
LC_TIME="zh_CN.GB18030"
LC_COLLATE="zh_CN.GB18030"
LC_MONETARY="zh_CN.GB18030"
LC_MESSAGES="zh_CN.GB18030"
LC_PAPER="zh_CN.GB18030"
LC_NAME="zh_CN.GB18030"
LC_ADDRESS="zh_CN.GB18030"
LC_TELEPHONE="zh_CN.GB18030"
LC_MEASUREMENT="zh_CN.GB18030"
LC_IDENTIFICATION="zh_CN.GB18030"
LC_ALL=
# vi /etc/sysconfig/i18n
LANG="zh_CN.GB1803dd0"
SUPPORTED="zh_CN.GB18030:zh_CN:zh:en_US.UTF-8:en_US:en"
SYSFONT="latarcyrheb-sun16"
中文编码
其他服务器的编码状态
# vi /etc/sysconfig/i18n
LANG="en_US.UTF-8"
SUPPORTED="zh_CN.GB18030:zh_CN:zh:en_US.UTF-8:en_US:en"
SYSFONT="latarcyrheb-sun16"
# locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=
将lost的这台服务器修改下编码为en_US.UTF-8
#LANG="en_US.UTF-8"
#vi /etc/sysconfig/i18n
LANG="en_US.UTF-8"
SUPPORTED="zh_CN.GB18030:zh_CN:zh:en_US.UTF-8:en_US:en"
SYSFONT="latarcyrheb-sun16"
终于恢复正常了。
阅读(3095) | 评论(0) | 转发(0) |