mfussenegger / cr8

CLI collection of utilities for working with CrateDB or PostgreSQL. Benchmark queries, insert data.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Starting clusters with several nodes

joemoe opened this issue · comments

I use cr8 to also do tests with CrateDB clusters containing several nodes.
It is always a bit of an hassle to properly setup the configuration.

Would it make sense to be able to start several CrateDB nodes forming a cluster with cr8?

@joemoe I guess it would make sense.
Any suggestions how the CLI arguments would look like?

Maybe something like cr8 run-crates --num 3 plus the same options as run-crate takes?
And defaulting to use the same cluster name.

i guess so.

i'd suggest to use something bold. e.g.: cr8 launch-cluster --nodes 3
this should start a working cluster.

if you want to pass some parameters, there are two options.

  • provide one value: each node gets the same
  • provide a list of values: it must be the same number as specified for the number of nodes to launch and each gets its dedicated value.

it should be possible maybe at some point to start and stop specific nodes in the cluster.

I've been thinking about this every now and then and I think I won't be adding this.

There are many different uses cases. Sometimes you want to spawn multiple nodes locally to test something out. In that case you can launch cr8 run-crate multiple times and set the same cluster name:

cr8 run-crate latest-nightly -s cluster.name=foo
cr8 run-crate latest-nightly -s cluster.name=foo
cr8 run-crate latest-nightly -s cluster.name=foo

This will cause it to form a cluster and you're good to go.

For other use cases where you want a cluster, you want to have multiple machines running CrateDB. In that case it is better to utilize another tool like Ansible to do the orchestration.

In cases where you want to script certain scenarios - like start 3 nodes, add a fourth, then stop a random node - you're better off using cr8 as an API in a python script.

Maybe one day I'll have a good idea how to do this, until then I'm closing this.