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

Added command customisation for environment variables #75

Closed
wants to merge 23 commits into from

Conversation

Richard-Mathie
Copy link

so that seeds, and broadcast addresses can be calculated at container creation time

Also description of how to initiate Cassandra in docker 1.12 swarm mode.

@nbaillie
Copy link

Is there any plan to incude this?
as I'm interested to test Cassandra in docker 1.12 swarm mode. or are there other ways or ideas to run in swarm mode?

@Richard-Mathie
Copy link
Author

try this
https://hub.docker.com/r/webscam/cassandra/
the modified config script is here
https://github.com/amey-sam/cassandra/blob/master/docker-entrypoint.sh

available settings:

CASSANDRA_SEEDS
CASSANDRA_BROADCAST_ADDRESS
CASSANDRA_BROADCAST_RPC_ADDRESS
CASSANDRA_CLUSTER_NAME
CASSANDRA_ENDPOINT_SNITCH
CASSANDRA_LISTEN_ADDRESS
CASSANDRA_LISTEN_INTERFACE
CASSANDRA_NUM_TOKENS
CASSANDRA_RPC_ADDRESS
CASSANDRA_START_RPC

available customization commands

HOST_COMMAND   # sets the default listening and broadcast address
SEEDS_COMMAND # sets the addresses to bootstrap off
CASSANDRA_LISTEN_ADDRESS_COMMAND
CASSANDRA_BROADCAST_ADDRESS_COMMAND

e.g.

docker service create --name cassandra \
  --mode global \
  --network yourinternalnetwork \
  --constraint 'node.labels.cassandra == true' \
  -e "SEEDS_COMMAND=nslookup tasks.cassandra | awk '/^Address: / {print \$2}' | paste -d, -s -" \
  -e 'CASSANDRA_SEEDS=auto' \
  -e 'CASSANDRA_BROADCAST_ADDRESS=auto' \
  -e "CASSANDRA_LISTEN_ADDRESS_COMMAND=ip r | awk '{ ip[\$3] = \$NF } END { print ( ip[\"eth2\"] ) }'" \
  -e "CASSANDRA_BROADCAST_ADDRESS_COMMAND=ip r | awk '{ ip[\$3] = \$NF } END { print ( ip[\"eth2\"] ) }'" \
  --publish '9042:9042' \
  webscam/cassandra:3.7

its not ideal but a start

branch is a bit behind so would need to merge to get 3.9 working....

@Richard-Mathie
Copy link
Author

Also note: docker 1.12 has a load of issues with lib networking stuff, loosing track of services and service discovery stuff (DNS records getting messed up). Not sure if they fixed it all in the end with the final releases 1.12.2 or whatever. So I ended up using 1.13, which has a rc out now...

so yeah personally I would skip 1.12....

@nbaillie
Copy link

Thanks, appreciated.


Neil Baillie
Solutions Architect

Office: +44 131 554 3438
Mobile: +44 7860 507284
[http://hutchinsonnetworks.com/assets/images/logo.png]

[cid:[email protected]]


hutchinsonnetworks.comhttp://hutchinsonnetworks.com/

UK: 3 Wester Shawfair, Shawfair Park, Edinburgh, EH22 1FD
US: The Chrysler Building, 26th Floor, 405 Lexington Ave, New York, NY10174

Worldwide Solutions
Delivered Locally

On 23 Nov 2016, at 11:04, Richard Mathie <[email protected]mailto:[email protected]> wrote:

Also note: docker 1.12 has a load of issues with lib networking stuff, loosing track of services and service discovery stuff (DNS records getting messed up). Not sure if they fixed it all in the end with the final releases 1.12.2 or whatever. So I ended up using 1.13, which has a rc out now...

so yeah personally I would skip 1.12....


You are receiving this because you commented.
Reply to this email directly, view it on GitHubhttps://github.com//pull/75#issuecomment-262485708, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ASktvYE8fezF7SEtR6vJt3HxlmROHeOlks5rBB3UgaJpZM4Jcpx5.

The content of this message and any attached file are confidential and/or privileged and are intended for the recipient only. If you are not the intended recipient, any unauthorized review, use, re-transmission, dissemination, copying, disclosure or other use of, or taking of any action in reliance of this information is strictly prohibited. If you receive this message in error please contact the sender immediately and then delete this email from your system. Hutchinson Networks Ltd cannot be held responsible for any failure by the recipient to test for viruses before opening any attachments.

Hutchinson Networks is a limited company registered in England and Wales.
Company Registration Number: 7487684. Registered Office: 4 Harecroft Lane, Ickenham, Uxbridge UB108FD.

  • Please consider the environment before printing this email

@tianon
Copy link
Member

tianon commented Oct 3, 2018

I'm sorry, but honestly if we're going to do anything more with environment variables it would likely be in the opposite direction (which we won't do due to the backwards compatibility implications) -- modifying a YAML file via shell script is very fragile, and setting complex configuration in this way is not great. For custom configuration, the only/best recommendation is to provide an appropriate cassandra.yaml file to your running instance (via a new image with FROM / COPY in a short Dockerfile, via Docker Configs, via bind mount, etc).

Closing in favor of #160 + docker-library/docs#1317.

@tianon tianon closed this Oct 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants