Newbie unable to install ranger-agent on ranger-server

(note: I had to change “http” to “httQ” due to forum restrictions posting url’s)

For evaluation purposes I’ve successfully installed Ranger server, but I’m unable to start and run the Ranger agent on the same machine (127.0.0.1). Despite of tearing my hair out I think it maybe has something to do with certificates. Does someone has the wisdom to point me to the right direction?

I’m using Ubuntu 14.04 LTS (Desktop) with the latest versions of Docker and Ranger.

sudo docker run -e CATTLE_AGENT_IP=“127.0.0.1” --privileged -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/rancher:/var/lib/rancher rancher/agent:v1.0.1 httQ://127.0.0.1:8080/v1/scripts/14DD48731A19AB0FCB98:1462888800000:X72ilCNbPdBxcxnHCYNZYz57M

INFO: Running Agent Registration Process, CATTLE_URL=httQ://192.168.2.22:8080/v1
INFO: Checking for Docker version >= 1.6.0
INFO: Found Server version: 1.11.1
INFO: docker version: Client version: 1.6.0
INFO: docker version: Client API version: 1.18
INFO: docker version: Go version (client): go1.4.2
INFO: docker version: Git commit (client): 4749651
INFO: docker version: OS/Arch (client): linux/amd64
INFO: docker version: Server version: 1.11.1
INFO: docker version: Server API version: 1.23
INFO: docker version: Go version (server): go1.5.4
INFO: docker version: Git commit (server): 5604cbe
INFO: docker version: OS/Arch (server): linux/amd64
INFO: docker info: Containers: 23
INFO: docker info: Images: 11
INFO: docker info: Storage Driver: aufs
INFO: docker info: Root Dir: /var/lib/docker/aufs
WARNING: No swap limit support
INFO: docker info: Backing Filesystem: extfs
INFO: docker info: Dirs: 131
INFO: docker info: Dirperm1 Supported: true
INFO: docker info: Execution Driver:
INFO: docker info: Kernel Version: 3.19.0-58-generic
INFO: docker info: Operating System: Ubuntu 14.04.4 LTS
INFO: docker info: CPUs: 4
INFO: docker info: Total Memory: 7.705 GiB
INFO: docker info: Name: laptop-werk
INFO: docker info: ID: FIBI:6XKT:LRO2:GA3R:EKLF:NHU2:4NC6:5XBF:TBXK:CWMI:2WK7:RFCS
INFO: docker info: Http Proxy:
INFO: docker info: Https Proxy:
INFO: docker info: No Proxy:
INFO: Attempting to connect to: httQ://192.168.2.22:8080/v1
INFO: httQ://192.168.2.22:8080/v1 is accessible
INFO: Inspecting host capabilities
INFO: System: false
INFO: Host writable: true
INFO: Token: xxxxxxxx
INFO: Running registration
Traceback (most recent call last):
File “./register.py”, line 11, in
secret_key=os.environ[‘CATTLE_REGISTRATION_SECRET_KEY’])
File “/usr/local/lib/python2.7/site-packages/cattle.py”, line 45, in from_env
return gdapi.from_env(prefix=prefix, factory=Client, **kw)
File “/usr/local/lib/python2.7/site-packages/gdapi.py”, line 608, in from_env
return _from_env(prefix=prefix, factory=factory, **args)
File “/usr/local/lib/python2.7/site-packages/gdapi.py”, line 627, in _from_env
return factory(**result)
File “/usr/local/lib/python2.7/site-packages/cattle.py”, line 12, in init
super(Client, self).init(*args, **kw)
File “/usr/local/lib/python2.7/site-packages/gdapi.py”, line 195, in init
self._load_schemas()
File “/usr/local/lib/python2.7/site-packages/gdapi.py”, line 313, in _load_schemas
response = self._get_response(self._url)
File “/usr/local/lib/python2.7/site-packages/gdapi.py”, line 262, in _get_response
headers=self._headers)
File “/usr/local/lib/python2.7/site-packages/requests/sessions.py”, line 480, in get
return self.request(‘GET’, url, **kwargs)
File “/usr/local/lib/python2.7/site-packages/requests/sessions.py”, line 468, in request
resp = self.send(prep, **send_kwargs)
File “/usr/local/lib/python2.7/site-packages/requests/sessions.py”, line 576, in send
r = adapter.send(request, **kwargs)
File “/usr/local/lib/python2.7/site-packages/requests/adapters.py”, line 437, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host=‘127.0.0.1’, port=8080): Max retries exceeded with url: /v1 (Caused by NewConnectionError(’<requests.packages.urllib3.connection.HTTPConnection object at 0x7f3f549df550>: Failed to establish a new connection: [Errno 111] Connection refused’,))

There is a known issue with Ubuntu Desktop and adding hosts.

https://github.com/rancher/rancher/issues/4175

After just trying out ip addresses I discovered that I can reach the host with CATTLE_AGENT_IP=172.17.0.1 which is my ip address of docker0. Maybe this is helpful to someone. I do have problems restarting and connecting containers though…

i did an inspect on my rancher-server container and used the ip on that contaner as cattle_agent_ip and instead of 127… in this part of the onliner httQ://127.0.0.1:8080/v1/scripts

I was using docker for mac BETA and it worked wonders.