环境说明:
新搭建的RancherOS,地址:172.16.96.65:8080,需要添加一台agent主机。
远程Linux主机:redhat7.2系统,执行下面的命令后报错。
sudo docker run --rm --privileged -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/rancher:/var/lib/rancher rancher/agent:v1.2.2 http://172.16.96.65:8080/v1/scripts/B27B54914927B6973C11:1483142400000:wmSjBrl3ZNRMoNvXlMIA0HNhx4
INFO: Running Agent Registration Process, CATTLE_URL=http://172.16.96.65:8080/v1
INFO: Attempting to connect to: http://172.16.96.65:8080/v1
INFO: http://172.16.96.65:8080/v1 is accessible
INFO: Inspecting host capabilities
INFO: Boot2Docker: false
INFO: Host writable: true
INFO: Token: xxxxxxxx
INFO: Running registration
Traceback (most recent call last):
File "./register.py", line 11, in <module>
secret_key=os.environ['CATTLE_REGISTRATION_SECRET_KEY'])
File "/usr/local/lib/python2.7/dist-packages/cattle.py", line 45, in from_env
return gdapi.from_env(prefix=prefix, factory=Client, **kw)
File "/usr/local/lib/python2.7/dist-packages/gdapi.py", line 613, in from_env
return _from_env(prefix=prefix, factory=factory, **args)
File "/usr/local/lib/python2.7/dist-packages/gdapi.py", line 632, in _from_env
return factory(**result)
File "/usr/local/lib/python2.7/dist-packages/cattle.py", line 12, in __init__
super(Client, self).__init__(*args, **kw)
File "/usr/local/lib/python2.7/dist-packages/gdapi.py", line 197, in __init__
self._load_schemas()
File "/usr/local/lib/python2.7/dist-packages/gdapi.py", line 315, in _load_schemas
response = self._get_response(self._url)
File "/usr/local/lib/python2.7/dist-packages/gdapi.py", line 266, in _get_response
self._error(r.text)
File "/usr/local/lib/python2.7/dist-packages/gdapi.py", line 255, in _error
raise ApiError(self._unmarshall(text))
File "/usr/local/lib/python2.7/dist-packages/gdapi.py", line 300, in _unmarshall
object_pairs_hook=self.object_pairs_hook)
File "/usr/lib/python2.7/json/__init__.py", line 352, in loads
return cls(encoding=encoding, **kw).decode(s)
File "/usr/lib/python2.7/json/decoder.py", line 364, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python2.7/json/decoder.py", line 382, in raw_decode
raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
请问有经验的高手,这种错误是哪里的问题?
自己解决了,居然是RancherOS默认提供的注册脚本参数有问题。
我这个RancherOS是官网提供下载的最新版本v1.0.1
解决办法:sudodockerrun-d--privileged-v/var/run/docker.sock:/var/run/docker.sock-v/var/lib/rancher:/var/lib/rancherrancher/agent:v1.2.2http://172.16.96.65:8080/v1/scripts/B27B54914927B6973C11:1483142400000:wmSjBrl3ZNRMoNvXlMIA0HNhx4
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。