-
Notifications
You must be signed in to change notification settings - Fork 47
Cluster Management Cookbook
Using herddb-cli.sh you can manage tablespace metadata and modify the configuration even without having any server running. Yes, because in order to execute "ALTER TABLESPACE" commands the client needs a server to be up and running. Since 0.10.0 the CLI will write and read directly to the ZooKeeper ensemble. Metadata are stored inside ZooKeeper in a binary format, do not try to alter such data without the CLI, in case of troubles please open a ticket or reach us on the mailing list.
bin/herddb-cli.sh -x jdbc:herddb:zookeeper:localhost:2181/herd --list-tablespaces
(example for tablespace 'herd')
bin/herddb-cli.sh -x jdbc:herddb:zookeeper:localhost:2181/herd --show-tablespace --schema herd
bin/herddb-cli.sh -x jdbc:herddb:zookeeper:localhost:2181/herd --list-nodes
bin/herddb-cli.sh -x jdbc:herddb:zookeeper:localhost:2181/herd --add-replica --schema herd --node vitello
bin/herddb-cli.sh -x jdbc:herddb:zookeeper:localhost:2181/herd --show-tablespace --schema herd
bin/herddb-cli.sh -x jdbc:herddb:zookeeper:localhost:2181/herd --remove-replica --schema herd --node vitello
bin/herddb-cli.sh -x jdbc:herddb:zookeeper:localhost:2181/herd --set-leader --schema herd --node vitello
bin/herddb-cli.sh -x jdbc:herddb:zookeeper:localhost:2181/herd --alter-tablespace --schema herd --param expectedreplicacount --value 2
bin/herddb-cli.sh -x jdbc:herddb:zookeeper:localhost:2181/herd --alter-tablespace --schema herd --param maxleaderinactivitytime --value 60000
Every of the functions above can be executed with the custom 'ALTER TABLESPACE' SQL syntax.
ALTER TABLESPACE 'herd','leader:foo'
ALTER TABLESPACE 'herd','expectedreplicacount:2'
Beware that the client needs to contact the active leader for the default tablespace (named 'herd'). If you are using a HDBC drive you can set a default 'schema' on the java.sql.Connection