Create a script to configure the data store

You now know the steps to configure a data store. You can collect all the configuration steps into a script file (for example, script.txt), and then run the script in a single batch operation. To do this, use the load command in the command line interface.

You can do one of the following:

Use load -file as a command-line option while running the runadmin command:

java -Xmx64m -Xms64m \
-jar $KVHOME/lib/kvstore.jar runadmin -port 5000 -host $KVHOST \
-security $KVROOT/security/client.security \
load -file script.txt

Use load -file command directly from the kv prompt:


 java -Xmx64m -Xms64m \
-jar $KVHOME/lib/kvstore.jar runadmin -port 5000 -host $KVHOST \
-security $KVROOT/security/client.security 
kv-> load -file <path to file> 

If you collected all the Configuration Steps and stored them in a file called script.txt, then you would have the list of commands shown below. The name of the store in this example is mystore.

### Begin Script ###
configure -name mystore
plan deploy-zone -name "Boston" -rf 3 -wait
plan deploy-sn -zn zn1 -host <hostname> -port 5000 -wait
plan deploy-admin -sn sn1 -wait
pool create -name BostonPool
pool join -name BostonPool -sn sn1
plan deploy-sn -zn zn1 -host <host2> -port 5000 -wait
pool join -name BostonPool -sn sn2
plan deploy-sn -zn zn1 -host <host3> -port 5000 -wait
pool join -name BostonPool -sn sn3
topology create -name topo -pool BostonPool -partitions 300
plan deploy-topology -name topo -wait
exit
### End Script ### 

After you run the script, you can use the show plans command to see a summary of all the plans that have been created, including their IDs, names, and current status. You can use the show plan -id <plan number> command to see more details about a specific plan, such as its execution timeline, attempt counts, and task progress.