3.3. Managing the Database Contents

Documentation

VoltDB Home » Documentation » VoltDB Kubernetes Administrator's Guide

3.3. Managing the Database Contents

Once the VoltDB database starts, you are ready to manage the database contents. Using Kubernetes does not change how you manage the database content. However, it does require a few extra steps to ensure you have access to the database, as described in Section 3.1.1, “Accessing the Database Interactively”.

First you need to identify the pods using the kubectl get pods command. You can then access the pods, individually, using the kubectl exec command, specifying the pod you want to access and the command you want to run. For example, to run sqlcmd on the first pod, use the following command:

$ kubectl exec -it mydb-voltdb-cluster-0 -- sqlcmd
SQL Command :: localhost:21212
1>

You can execute a local batch file of sqlcmd commands remotely by piping the file into the utility. For example:

$ cat schema.sql
 CREATE TABLE HELLOWORLD ( 
    HELLO VARCHAR(15), WORLD VARCHAR(15),
    DIALECT VARCHAR(15) NOT NULL
 );
 PARTITION TABLE HELLOWORLD ON COLUMN DIALECT;
$ kubectl exec -it mydb-voltdb-cluster-0 -- sqlcmd < schema.sql
Command succeeded.
Command succeeded.
$