Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't set hostname to service name when using --x-networking #2327

Closed
vieux opened this issue Nov 5, 2015 · 5 comments
Closed

Don't set hostname to service name when using --x-networking #2327

vieux opened this issue Nov 5, 2015 · 5 comments
Assignees
Milestone

Comments

@vieux
Copy link

vieux commented Nov 5, 2015

Using the new networking features, when you start a container.
The name is correctly <folder>_<service>_1 but the hostname is <service>

It's impossible the scale the containers in some case because all the containers get the same hostname.

@vieux
Copy link
Author

vieux commented Nov 5, 2015

for example with:

$ cat docker-compose.yml
redis:
 container_name: redis
 image: redis
 command: redis-server

rqworker:
 image: vieux/rqworker
 command: -u redis://redis:6379/

rqdashboard:
 image: vieux/rq-dashboard
 command: -H redis
 ports:
  - 9181:9181

you cannot scale rqworker because the all end up with the hostname rqworker and it will fail.

@dnephin
Copy link

dnephin commented Nov 5, 2015

This is because of #2276. networking was supposed to use the hostname, but it didn't end up happening.

Can you tell me more about how it breaks? Isn't the hostname only internal to the container?

@vieux
Copy link
Author

vieux commented Nov 5, 2015

@dnephin it's an issue for me because rqworker advertises itself using it's hostname and rq refuses to have 2 workers with the same name.

Traceback (most recent call last):
  File "/usr/local/bin/rqworker", line 9, in <module>
    load_entry_point('rq==0.5.6', 'console_scripts', 'rqworker')()
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 700, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 680, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 873, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 508, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/rq/cli/cli.py", line 202, in worker
    w.work(burst=burst)
  File "/usr/local/lib/python2.7/dist-packages/rq/worker.py", line 404, in work
    self.register_birth()
  File "/usr/local/lib/python2.7/dist-packages/rq/worker.py", line 238, in register_birth
    raise ValueError(msg.format(self.name))
ValueError: There exists an active worker named u'rqworker.1' already

@vieux
Copy link
Author

vieux commented Nov 5, 2015

@dnephin is there a way to hack the compose file to use

hostname: rqworker_{$COUNT}

@dnephin dnephin added this to the 1.5.1 milestone Nov 5, 2015
@dnephin
Copy link

dnephin commented Nov 5, 2015

There is not. We'll have to fix this for 1.5.1

@dnephin dnephin changed the title issue with hostname and new networking Don't set hostname to service name when using --x-networking Nov 5, 2015
@dnephin dnephin self-assigned this Nov 5, 2015
RotaruDan pushed a commit to e-ucm/rage-analytics that referenced this issue Dec 16, 2015
RotaruDan pushed a commit to e-ucm/rage-analytics that referenced this issue Dec 16, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants