tobert / cassandra-docker

Cassandra in Docker
https://registry.hub.docker.com/u/tobert/cassandra/
Apache License 2.0
130 stars 56 forks source link

Options for Cassandra version and memory #18

Closed allan-stewart closed 9 years ago

allan-stewart commented 9 years ago

It would be great if there was an option which let you pick a specific version of Cassandra. Also if there was a way to specify how much memory should be used; ~4GB is way too big for a development environment, especially on a laptop.

tobert commented 9 years ago

Picking versions will probably remain in docker tags, e.g. docker pull tobert/cassandra:2.0.13 (which I need to publish).

I will look into adding an option to set the heap size on the first start. I removed it initially but just the other day I needed to do the start/edit/restart cycle and that was annoying.

allan-stewart commented 9 years ago

Okay, I see the multiple cassandra versions in the Docker registry. Cool. Will you be keeping the images up-to-date w/ new config options then? My team specifically uses Cassandra 2.0.11 in production, so we want that for dev boxes as well.

Looking forward for the memory options; we're currently using sed to rewrite the memory requirements.

tobert commented 9 years ago

Yeah, I'll roll a new 2.0 image with the changes. I'm testing the changes to add -heap and -new now.

joshblum commented 9 years ago

+1 @allan-stewart for the memory stuff. thanks @tobert awesome image :)

tobert commented 9 years ago

Seems to be working OK on my machine. Please test and let me know. I've pushed an image to the tag tobert/cassandra:213memflags

joshblum commented 9 years ago

@tobert i'm pretty new to using dockers can you provide a full example of using the -heap/-new args?

tobert commented 9 years ago

@joshblum I'll add something to the README soon. I started my most recent cluster thus:

$ docker run --net=host -v /data -d tobert/cassandra:2.1.3 -heap 2048 -new 256 -seeds 192.168.10.11 -name "My Cluster"
$ ps -efwww |grep java
datastax  26538    241 66 22:12 ?        00:00:09 /usr/bin/java -ea -javaagent:/opt/cassandra/lib/jamm-0.3.0.jar -XX:+CMSClassUnloadingEnabled -XX:+UseThreadPriorities -XX:ThreadPriorityPolicy=42 -Xmx2048M -Xms2048M -Xmn512M

Note: only the 2.1.3 and 2.0.13 tags have the changes at the moment. I'll bump latest once I test it a little more as there are other changes to the entrypoint.

tobert commented 9 years ago

Oh, hey look at that. My -new didn't get picked up. I'll look into tomorrow.

joshblum commented 9 years ago

@tobert thanks!!