-
Notifications
You must be signed in to change notification settings - Fork 0
How to use it in command line
CassandraUnit provide a command line tools to load Data Set in your cassandra cluster.
- Get the latest CassandraUnit distribution (cassandra-unit-{last-version}-bin.tar.gz) :
-
extract the distribution into the directory of your choice
-
add the bin directory of the distribution to your path (to allow the use of the command everywhere)
-
execute : "cu-loader" (it's the name of the command)
If the usage is printed, everything is ok :
Missing required options: f, h, p
usage: CassandraUnitLoader is a tool to load CassandraUnit data Set into cassandra cluster
-f,--file <arg> dataset to load
-h,--host <arg> target host (required)
-o,--onlySchema only load schema (optional)
-p,--port <arg> target port (required)
-r,--replicationFactor <arg> override the replication factor set in the dataset (optional)
-s,--strategy <arg> override the strategy set in the dataset (optional)
The command is available for :
- linux and Macosx platform : cu-loader
- windows platform : cu-loader.bat
Here is the argument options list you can use :
-
-f (or --file) : dataset to load (required)
-
-h (or --host) : target cassandra node host (required)
-
-p (or --port) : target cassandra node port (required)
-
-o (or --onlySchema) : only load schema (optional)
-
-r (or --replicationFactor) : override the replication factor set in the dataset (optional)
-
-s (or --strategy) : override the strategy set in the dataset (optional)
A simple example :
cu-loader -f datasetDefaultValue.xml -h localhost -p 9160
A more complex example :
cu-loader -f datasetDefaultValue.xml -h 10.10.10.01 -p 9160 -o -r 3 -s org.apache.cassandra.locator.NetworkTopologyStrategy