RancherOS添加主机时不成功

自行车丢了 发布于 2017/05/26 19:28
阅读 851
收藏 1

环境说明:

新搭建的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

请问有经验的高手,这种错误是哪里的问题?

加载中
0
自行车丢了
自行车丢了

自己解决了,居然是RancherOS默认提供的注册脚本参数有问题。

我这个RancherOS是官网提供下载的最新版本v1.0.1

解决办法: sudo docker run -d --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

返回顶部
顶部