griddb.github.io

— Introduction —

Purpose and structure of this manual

This manual describes the operating tools of GridDB.

It is written for system designers and system administrators responsible for GridDB system’s construction and operation management respectively.

The contents of each chapter is as follows:

— Service —

Preparing to use the service

The procedure to use and install GridDB service is as follows.

  1. Install GridDB server package and client package.
  2. Configure the respective GridDB nodes that constitute a GridDB cluster.
  3. Configure the start configuration file.

See the “GridDB Administrator Guide” for the procedure to install GridDB and configure a GridDB node.

The table above shows the kinds of files used in GridDB services.

Type Meaning
systemd unit file systemd unit definition file. It is installed in /usr/lib/systemd/system/gridstore.service by the server package of GridDB and registered on the system as GridDB service.
Service script Script file is executed automatically during OS startup.
It is installed in /usr/griddb/bin/gridstore by the server package of GridDB.
PID file File containing only the process ID (PID) of the gsserver process. This is created in $GS_HOME/conf/gridstore.pid when the gsserver process is started.
Start configuration file File containing the parameters that can be set while in service.
Depending on the GridDB server package, it is installed in /etc/sysconfig/gridstore/gridstore.conf.

Parameter setting

A list of parameters is available to control the GridDB service operations. A list of the parameters is given below.

Property Default Note
GS_USER admin GridDB user name
GS_PASSWORD admin GS_USER password
CLUSTER_NAME INPUT_YOUR_CLUSTER_NAME_HERE Cluster name to join
MIN_NODE_NUM 1 Number of nodes constituting a cluster

To change the parameters, edit the start configuration file (/etc/sysconfig/gridstore/gridstore.conf ).

When a server package is updated or uninstalled, the start configuration file will not be overwritten or uninstalled.

[Notes]

Log

See the boot log( /var/log/boot.log ) and operating command log($GS_HOME/log ) for details of the service log.

Command

GridDB service commands are shown below.

[Notes]

vi .bash_profile
GS_SSL_MODE=VERIFY
export GS_SSL_MODE
SSL_CERT_FILE=$GS_HOME/security/ca.crt
export SSL_CERT_FILE

start

Action:

$ sudo systemctl start gridstore

[Notes]

stop

Action:

$ sudo systemctl stop gridstore

[Notes]

status

Action:

$ sudo systemctl status gridstore

restart

Action:

condrestart

Action:

Error message list

Service error messages are as shown below.

Code Message Meaning
F00003 Json load error Reading of definition file failed.
F01001 Stop service timed out Stop node process timed out.
F01002 Startnode error An error occurred in the node startup process.
F01003 Startnode timed out Start node process timed out.
F01004 Joincluster error An error occurred in the join cluster process.
F01005 Joincluster timed out Join cluster process timed out.
F01006 Leavecluster error An error occurred in the leave cluster process.
F02001 Command execution error An error occurred in the command execution.
F02002 Command execution timed out Command execution timed out.

[Memo]

— Operating commands —

Command list

The following commands are available in GridDB.

Type Functions Command RPM package
(1) Start/stop node start node gs_startnode server
  stop node gs_stopnode client
(2) User management Registration of administrator user gs_adduser server
  Deletion of administrator user gs_deluser server
  Change the password of an administrator user gs_passwd server
(3) Cluster management Joining a cluster configuration gs_joincluster client
  Leaving a cluster configuration gs_leavecluster client
  Stopping a cluster gs_stopcluster client
  Getting cluster configuration data gs_config client
  Getting node status gs_stat client
  Adding a node to a cluster gs_appendcluster client
  Manual failover of a cluster gs_failovercluster client
  Getting partition data gs_partition client
  Increasing the no. of nodes of the cluster gs_increasecluster client
  Set up autonomous data redistribution of a cluster gs_loadbalance client
  Set up data redistribution goal of a cluster gs_goalconf client
  Controlling the checkpoint of the node gs_checkpoint server
(4) Log data Displaying recent event logs gs_logs client
  Displaying and changing the event log output level gs_logconf client
(5) Backup/restoration backup execution gs_backup server
  Check backup data gs_backuplist server
  Backup/restoration gs_restore server
(6) Import/export Import gs_import client
  Export gs_export client
(7) Maintenance Displaying and changing parameters gs_paramconf client
  Managing user cache for authentication gs_authcache client

[Memo]

Common functions of operating commands

[Command option]

The options below are common options that can be used in all commands.

Options Note
-h|–help Display the command help.
--version Display the version of the operating command.

[Example]

The options below are common options that can be used in some of the commands.

Options Note  
[-s <Server>[:<Port no.>] -p <Port no.>] The host name or the server name (address) and port number,
that is, the connection port no. of the operating command.
The value “localhost (127.0.0.1):10040” is used by default.
-u <User name>/<Password> Specify authentication user and password.  
-w|–wait [<No. of sec>] Wait for the process to end.
There is no time limit if the time is not set or if the time is set to 0.
 
-a --address-type <Address type> Specify the service type of the port, address to display.
system: Connection address of operating command
cluster: Reception address used for cluster administration
transaction: Reception address for transaction process
sync: Reception address used for synchronization process
--no-proxy If specified, the proxy will not be used.  
--ssl|–ssl-verify Specifying –ssl will validate SSL connection for communication for operation commands; specifying –ssl-verify will additionally perform server certificate verification as well.  

[Memo]

[Notes]

[Termination status]

The end status of the command is shown below.

[Log file]

Log file of the command will be saved in ${GS_LOG}/command name.log.

[Example] The log file below is created if the GS_LOG value is “/var/lib/gridstore/log (default)” and the “gs_startnode” command is executed.

Points to note

[Before using an operating command]

[To compose a cluster]

A cluster is composed of a group of 1 or more nodes, consisting of a master with the rest being followers.

In a cluster configuration, the number of nodes already participating in a cluster and the number of nodes constituting a cluster are important. The number of nodes already participating in a cluster is the actual number of nodes joined to the cluster. The number of nodes constituting a cluster is the number of nodes that can join the cluster which is specified in the gs_joincluster command.

The number of nodes already participating in a cluster and the number of nodes constituting a cluster can be checked by executing a gs_stat command on the master node, with the values being /cluster/activeCount and /cluster/designatedCount respectively.

The main procedure to create/change a cluster configuration is shown below for reference purposes. See the following sections for details of each command.

Starting/stopping a node

Starting a node

Execute the GridDB start node command on the machine executing the node. This command needs to be executed for each GridDB node.

[Memo]

Stopping a node

The following command is used to stop the GridDB node. To stop a node, the GridDB cluster management process needs to be stopped first.

[Memo]

User management

The user management is used to perform registration/deletion/password change for GridDB administrator user.

The default user below exists after installation.

[Notes]

Registration of administrator user

[Memo]

[Example]

Deletion of administrator user

[Memo]

[Example]

Update password

[Memo]

[Example]

Cluster management

Joining a cluster configuration

When composing a GridDB cluster, the nodes need to be attached (joined) to the cluster.

[Memo]

[Example] Compose a 3-node cluster with the cluster name “example_three_nodes_cluster” using node A - C

Leaving a cluster configuration

The following command is used to detach a node from a cluster.

[Memo]

[Example]

Stop all clusters

The following command is used to stop a cluster.

[Memo]

[Example]

Getting cluster configuration data

The following command is used to get the cluster configuration data (data on list of nodes joined to a cluster).

[Memo]

[Example]

Getting node status

The following command gets the cluster data (cluster configuration data and internal data), or backup progress status.

[Memo]

[Example]

Adding a node to a cluster

Add a new node to a cluster in operation.

[Memo]

[Example]

Manual failover of a cluster

The following command is used to execute GridDB cluster failover.

[Memo]

[Example]

Getting partition data

The following command is used to display the partition data of a GridDB node.

[Memo]

[Example]

Increasing the no. of nodes of the cluster

Increase the no. of nodes of the GridDB cluster.

[Memo]

[Example]

Set up autonomous data redistribution of a cluster

Enable/disable autonomous data redistribution of a GridDB cluster, or display the setting. As in the case of stopping nodes and rejoining them in a cluster for rolling upgrade, by disabling autonomous data redistribution, you can eliminate redundant redistribution processing and reduce the load on the operations.

[Memo]

[Example]

  Confirm the settings of autonomous data redistribution on all nodes in a cluster.
  $ gs_loadbalance -s 192.168.33.29:10040  -u admin/admin --cluster
  192.168.33.29 ACTIVE
  192.168.33.30 ACTIVE
  192.168.33.31 ACTIVE

  Disable the setting of the node, "192.168.33.31".
  $ gs_loadbalance -s 192.168.33.31:10040  -u admin/admin --off

Set up data redistribution goal of a cluster

Enabled/disable GridDB autonomous data redistribution, display the present data redistribution goal, and manual setting. These commands are used during rolling upgrades, to detach the node safely off the cluster.

[Example]

  Confirm the settings of autonomous data redistribution on all nodes in a cluster.
  $ gs_goalconf -s 192.168.33.29:10040  -u admin/admin --cluster
  192.168.33.29 ACTIVE
  192.168.33.30 ACTIVE
  192.168.33.31 ACTIVE

  Disable the setting of the node, "192.168.33.31".
  $ gs_goalconf -s 192.168.33.31:10040  -u admin/admin --off

  Set up the data redistribution goal to leave the node of "192.168.33.31" for all the nodes in a cluster.
  $ gs_goalconf -u admin/admin --manual --leaveNode 192.168.33.31 --cluster
  Switching 43 owners to backup on 192.168.33.31:10040 ...
  Setting goal requests have been sent. Sync operations will be started when loadbalancer is active.

Controlling the checkpoint

Enable/disable the periodic checkpoint of a GridDB node, or execute manual checkpoint.

[Memo]

[Example]

  Disable the periodic checkpoint
  $ gs_checkpoint -u admin/admin --off

  Perform the manual checkpoint and wait to complete.
  $ gs_checkpoint -u admin/admin --manual -w
  ...
  The manual checkpoint has been completed.

  Re-enable the periodic checkpoint
  $ gs_checkpoint -u admin/admin --on

Log data

Displaying recent event logs

The following command is used to get the most recent GridDB event log.

[Memo]

[Example]

Displaying and changing the event log output level

The following command is used to display or change the event log output level. Get the list of settings if the argument is not specified.

[Memo]

[Example]

Backup/restoration

Backup

The following command is used to get GridDB backup data on a per-node basis while continuing services.

A backup of the entire cluster can be carried out while continuing services by backing up all the nodes constituting the cluster in sequence.

<mode option>

Backup
Backup

[Memo]

[Example]

Checking backup data

The following is used to get a list of the backup data in the backup directory set up in the node definition file (gs_node.json).

[Memo]

[Example]

Restoration

The following command is used to restore a GridDB backup file.

[Memo]

[Example]

Maintenance

Displaying and changing parameters

The following command is used to display or change the node parameters.

[Memo]

Managing user cache for authentication

The following command lists and deletes cache for user information for faster authentication of general users and of LDAP.

For details on the authentication method, see the GridDB Features Reference .

[Example]

Display a list of information on all the users stored in cache.
$ gs_authcache -u admin/admin --show
{
    "usercache": [
      {
        "count": 30,
        "dbname": "mydb",
        "username": "user01"
      },
      {
        "count": 8,
        "dbname": "mydb",
        "username": "user02"
      },
      ・・・
    ]
  }
}

— Cluster operation control command interpreter (gs_sh) —

Overview

The cluster operation control command interpreter (hereinafter referred to gs_sh) is a command line interface tool to manage GridDB cluster operations and data operations.

The following can be carried out by gs_sh.

Using gs_sh

Preliminary preparations

Carry out the following preparations before using gs_sh.

gs_sh start-up

There are two types of start modes in gs_sh.

[Memo]

Definition of a GridDB cluster

The definition below is required in advance when executing a GridDB cluster operation control or data operation.

An explanation of node variables, cluster variables, and how to define user data is given below. An explanation of the definition of an arbitrary variable, display of variable definition details, and how to save and import variable definition details in a script file is also given below.

Definition of node variable

Define the IP address and port no. of a GridDB node in the node variable.

[Memo]

Definition of cluster variable

Define the GridDB cluster configuration in the cluster variable.

[Memo]

In addition, node variables can be added or deleted for a defined cluster variable.

[Memo]

Defining the SQL connection destination of a cluster

Define the SQL connection destination in the GridDB cluster configuration. This is set up only when using the GridDB NewSQL interface.

[Memo]

Definition of a user

Define the user and password to access the GridDB cluster.

[Memo]

Definition of arbitrary variables

Define an arbitrary variable.

[Memo]

Displaying the variable definition

Display the detailed definition of the specified variable.

[Memo]

Saving a variable definition in a script file

Save the variable definition details in the script file.

[Memo]

Executing a script file

Read and execute a script file.

[Memo]

Synchronizing cluster and node variable definitions

Connect to the running GridDB cluster and automatically define a cluster variable and a node variable.

[Memo]

GridDB cluster operation controls

The following operations can be executed by the administrator user only as functions to manage GridDB cluster operations.

Status

This section explains the status of a GridDB node and GridDB cluster.

A cluster is composed of 1 or more nodes. A node status represents the status of the node itself e.g. start or stop etc. A cluster status represents the acceptance status of data operations from a client. A cluster status is determined according to the status of the node group constituting the cluster.

An example of the change in the node status and cluster status due to a gs_sh sub-command operation is shown below. A cluster is composed of 4 nodes. When the nodes constituting the cluster are started (startnode), the node status changes to “Start”. When the cluster is started after starting the nodes (startcluster), each node status changes to “Join”, and the cluster status also changes to “In Operation”.

Status example
Status example

A detailed explanation of the node status and cluster status is given below.

Node status

Node status changes to “Stop”, “Start” or “Join” depending on whether a node is being started, stopped, joined or detached. If a node has joined a cluster, there are 2 types of node status depending on the status of the joined cluster.

Node status
Node status
Status Status name Note
Join SERVICING Node is joined to the cluster, and the status of the joined cluster is “In Operation”
  WAIT Node is joined to the cluster, and the status of the joined cluster is “Halted”
Start STARTED Node is started but has not joined a cluster
  STARTING Starting node
Stop STOP Stopped node
  STOPPING Stopping node

Cluster status

GridDB cluster status changes to “Stop”, “Halted” or “In Operation” depending on the operation start/stop status of the GridDB cluster or the join/leave operation of the GridDB node. Data operations from the client can be accepted only when the GridDB cluster status is “In Operation”.

Cluster status
Cluster status
Status Status name Note
In Operation SERVICE_STABLE All nodes defined in the cluster configuration have joined the cluster
  SERVICE_UNSTABLE More than half the nodes defined in the cluster configuration have joined the cluster
Halted WAIT Half and more of the nodes defined in the cluster configuration have left the cluster
  INIT_WAIT 1 or more of the nodes defined in the cluster configuration have left the cluster (when the cluster is operated for the first time, the status will not change to “In Operation” unless all nodes have joined the cluster)
Stop STOP All nodes defined in the cluster configuration have left the cluster

The GridDB cluster status will change from “Stop” to “In Operation” when all nodes constituting the GridDB cluster are allowed to join the cluster. In addition, the GridDB cluster status will change to “Halted” when half and more of the nodes have left the cluster, and “Stop” when all the nodes have left the cluster.

Join and leave operations (which affect the cluster status) can be applied in batch to all the nodes in the cluster, or to individual node.

When the operating target is a single node Operation When the operating targets are all nodes
Join startcluster : Batch entry of a group of nodes that are already operating but have not joined the cluster yet. joincluster : Entry by a node that is in operation but has not joined the cluster yet.
Leave stopcluster : Batch detachment of a group of nodes joined to a cluster. leavecluster : Detachment of a node joined to a cluster.

[Memo]

Details of the various operating methods are explained below.

Starting a node

Start the specified node.

[Memo]

Stopping a node

Stop the specified node.

In addition, the specified node can be forced to stop as well.

[Memo]

Batch entry of nodes in a cluster

Explanation on how to add batch nodes into a cluster is shown below. In this case when a group of unattached but operating nodes are added to the cluster, the cluster status will change to “In Operation”.

[Memo]

Batch detachment of nodes from a cluster

To stop a GridDB cluster, simply make the attached nodes leave the cluster using the stopcluster command.

[Memo]

Node entry in a cluster

Join a node that is temporarily left from the cluster by leavecluster sub-command or failure into the cluster.

[Memo]

Detaching a node from a cluster

Detach the specified node from the cluster. Also force the specified active node to be detached from the cluster.

[Memo]

Adding a node to a cluster

Add an undefined node to a pre-defined cluster.

[Memo]

Displaying cluster status data

Display the status of an active GridDB cluster, and each node constituting the cluster.

[Memo]

Displaying configuration data

Display the cluster configuration data.

[Memo]

Displaying node status

Display the node configuration data.

[Memo]

Displaying event log

Displays the log of the specified node.

The output level of a log can be displayed and changed.

[Memo]

Displaying SQL processing under execution

Display the SQL processing under execution.

Displaying executing event

Display the event list executed by the thread in each node in a cluster.

Displaying connection

Display the list of connections.

SQL cancellation

Cancel the SQL processing in progress.

[Memo]

Data operation in a database

To execute a data operation, there is a need to connect to the cluster subject to the operation. Data in the database configured during the connection (“public” when the database name is omitted) will be subject to the operation.

Connecting to a cluster

Establish connection to a GridDB cluster to execute a data operation.

[Memo]

Search (TQL)

Execute a search and retain the search results.

[Memo]

SQL command execution

Execute an SQL command and retains the search result.

Sub-command name ‘sql’ can be omitted when the first word of SQL statement is one of the follows.

[Memo]

Getting search results

The following command gets the inquiry results and presents them in different formats. There are 3 ways to output the results as listed below.

(A) Display the results obtained in a standard output.

(B) Save the results obtained in a file in the CSV format.

(C) Results obtained will not be output.

Example:

  //execute a search
  gs[public]> tql c001 select *;
  5 results.   

  //Get first result and display
  gs[public]> get 1
  name,status,count
  mie,true,2
  The 1 result has been acquired.

  //Get second and third results and save them in a file
  gs[public]> getcsv /var/lib/gridstore/test2.csv 2
  The 2 results had been acquired.

  //Get fourth result
  gs[public]> getnoprint 1
  The 1 result has been acquired.

  //Get fifth result and display
  gs[public]> get 1
  name,status,count
  akita,true,45
  The 1 result has been acquired.

[Memo]

Getting the execution plan

Execute the specified TQL command and display the execution plan and actual measurement values such as the number of cases processed etc. Search is not executed.

In addition, the actual measurement values such as the number of processing rows etc. can also be displayed together with the executive plan by actually executing the specified TQL command.

[Memo]

Discarding search results

Close the tql and discard the search results saved.

Close the query and discard the search results saved.

Example:

  //Discard search results
  gs[public]> tqlclose

  gs[public]> queryclose

[Memo]

Disconnecting from a cluster

Disconnect from a GridDB cluster.

[Memo]

Hit count setting

Set whether to execute count query when SQL querying.

[Memo]

Database management

This section explains the available sub-commands that can be used for database management. Connect to the cluster first prior to performing database management with connect sub-command. (Subcommand connect)

Creating a database

Create a database with the specified name.

[Memo]

Deleting a database

Delete the specified database.

[Memo]

Displaying current database

Display the current database name.

Database list

List the databases with access right information.

[Memo]

Granting access rights

Grant the database access rights to user.

[Memo]

Revoking access rights

Revoke access rights to the database.

[Memo]

User management

This section explains the available sub-commands that can be used to perform user management. Connect to the cluster first prior to performing user management (sub-command connect).

Creating a general user

Create a general user (username and password).

[Memo]

Deleting a general user

Delete the specified general user

[Memo]

Update password

Update the user password.

[Memo]

Listing general users

List information on a general user data and a role.

[Memo]

Container management

This section explains the available sub-commands that can be used when performing container operations. Connect to the cluster first before performing container management (sub-command connect). The container in the connected database will be subject to the operation.

Creating a container

Create a container.

Simplified version

Specify the container name and column data (column name and type) to create the container.

Detailed version

Specify the container definition data in the json file to create a container.

Deleting container

Delete a container

[Memo]

Registering a row

Register a row in a container

Deleting a row

Delete a row from a container

[Memo]

Displaying a container data

Display the container data.

[Memo]

Displaying a table data

Display the table data. It is compatible command of showcontainer.

Searching for container

Search for a container by specifying a container name.

Searching for a view

Search for a view by specifying a view name.

Creating an index

Create an index in the column of a specified container.

[Memo]

Creating a compound index

Create a composite index on the column of a specified container.

Deleting an index

Delete the index in the column of a specified container.

[Memo]

Deleting a compound index

Delete the compound index in the column of a specified container.

[Memo]

Execution plan

This section explains subcommands to displays an SQL execution plan.

Getting an SQL analysis result (global plan)

Display an SQL analysis result (global plan) in text format or in JSON format.

Text format

[Memo]

JSON format

[Memo]

Getting detailed information about an SQL analysis result

Display the detailed information of an SQL analysis result in JSON format.

[Memo]

Other operations

This section explains the sub-commands for other operations.

Echo back setting

Display the executed sub-command in the standard output.

[Memo]

Displaying a message

Display the definition details of the specified character string or variable.

[Memo]

Sleep

Set the time for the sleeping function.

[Memo]

Executing external commands

Execute an external command.

[Memo]

Terminating gs_sh

The above command is used to terminate gs_sh.

In addition, if an error occurs in the sub-command, the setting can be configured to end gs_sh.

[Memo]

Help

Display a description of the sub-command.

[Memo]

Version

Display the version of gs_sh.

[Memo]

Setting the time zone

Set the time zone.

[Memo]

Specifying the authentication method

Specify the authentication method. For details on the authentication method, see the GridDB Features Reference .

[Memo]

Setting SSL connection

Secure communication with the GridDB cluster with SSL,

After enabling SSL connection on the GridDB cluster, enable SSL connection with the following subcommand of the gs_sh command. For details on SSL connection, see the GridDB Features Reference.

[Memo]

Example:

GS_COMMON_JVM_ARGS="-Djavax.net.ssl.trustStore=/var/lib/gridstore/admin/keystore.jks -Djavax.net.ssl.trustStorePassword=changeit"
export GS_COMMON_JVM_ARGS

Setting the address of the interface to receive the multicast packets from

To configure the cluster network in multicast mode when multiple network interfaces are available, specify the IP address of the interface to receive the multicast packets from.

[Memo]

Displaying history and rerunning a previous subcommand

Display previously run subcommands.

Rerun recent subcommands from the subcommand history displayed with the history subcommand.

Rerun the previously run subcommand.

[Memo]

Options and sub-commands specifications

Option

[Memo]

Sub-command list

— Integrated operation control GUI (gs_admin) —

Overview

The integrated operation control GUI (hereinafter described as gs_admin) is a Web application that integrates GridDB cluster operation functions.

The following operations can be carried out using gs_admin.

gs_admin configuration

gs_admin needs to be installed on a machine in which nodes constituting a cluster have been started, or in a machine on the network with the same subnet and multicast distribution.

Setting up gs_admin

gs_admin is a Web application that contains Web containers.

To use gs_admin, Java have to be installed beforehand. The supported versions are as follows.

The GridDB version supported by gs_admin Ver. 5.0 is:

The procedure to use gs_admin is as follows.

  1. Configure the respective GridDB nodes that constitute a GridDB cluster.
  2. Install and configure gs_admin.
  3. Access the gs_admin application URI with a browser, and log in as a gs_admin user.

See the “GridDB Quickstart Guide” for the procedure to configure a GridDB node.

The procedure to install and configure gs_admin is as follows.

  1. Installation of GridDB client package
  2. gs_admin user settings
  3. gs_admin.properties file settings
  4. Node repository settings

Installation of client package

Install the GridDB Web UI package (griddb-ee-webui).

On a machine where the Web application is placed, install the package using the command below.

$ sudo rpm -Uvh griddb-ee-webui-X.X.X-linux.x86_64.rpm

``` example(Ubuntu Server) $ sudo dpkg -i griddb-ee-webui_X.X.X_amd64.deb

*X.X.X indicates the GridDB version.

When a client package is installed, a directory named admin is created in the GridDB home directory ( `/var/lib/gridstore` ). This directory (`/var/lib/gridstore/admin` ) is known as adminHomehereinafter.

The configuration under adminHome is as follows.

``` example
capture/                                                # snapshot storage directory (*)
        \<Node address\>_\<port\>/YYYYMMDDHHMMSS.json   # snapshotfile(*)
conf/                                                   # configuration file directory
     gs_admin.properties                                # Static parameter file to be configured initially
     gs_admin.settings                                  # dynamic parameter file to configure display-related settings
     password                                           # gs_admin user definition file
     repository.json                                    # node repository file
log/                                                    # log file directory of gs_admin (*)
    gs_admin-YYYYMMDD.log                               # log file (*)
tree/                                                   # structural file directory of container tree (*)
     foldertree-\<cluster name\>-\<user name\>.json     # folder tree file (*)

Files and directories marked with a (*) are created automatically by gs_admin.

[Notes]

gs_admin user settings

When using gs_admin, perform authentication as a gs_admin user.

Administrator users of GridDB clusters under management need to be set up as gs_admin users.

The gs_admin user definition file is found in /var/lib/gridstore/admin/conf/password

This file will not be created when a client package is installed.

To create this file easier, overwrite the user definition file of the node in the cluster you want to manage (/var/lib/gridstore/conf/password ) to the gs_admin user definition file ( /var/lib/gridstore/admin/conf/password ). In this case, all administrator users listed in the copied user definition file will become gs_admin users.

[Memo]

gs_admin.properties file settings

The configuration file is found in /var/lib/gridstore/admin/conf/gs_admin.properties . Set together with the GridDB cluster configuration as a gsadm user.

If the property file has been modified, restart the griddb-webui service.

gs_admin.properties contains the following settings.

Property Default Description
adminUser admin Set the gs_admin administrator user. Multiple user names can be set by separating the names with commas. This function can be used by a gs_admin administrator user.
- cluster operation function
- Repository management function
ospassword - Set the password of the node gsadm user (OS user). The following functions can be used when the password is set.
- Node start operation (start) in the cluster operation functions
- OS information display screen
timeZone - Set timeZone as a property for cluster connection.
The set value is used as the time zone of the TIMESTAMP type column value on the TQL screen and SQL screen. If not specified, the time zone will be UTC.
logging.performance FALSE Specify TRUE to retrieve the performance log.
gs_admin.debug FALSE Specify TRUE to start in debug mode.
sqlLoginTimeout   Specify the SQL login timeout in seconds.
authenticationMethod *dependent on the GridDB cluster settings Specify either INTERNAL (internal authentication) or LDAP (LDAP authentication) as an authentication method to be used.
notificationInterfaceAddress *OS-dependent To configure the cluster network in multicast mode when multiple network interfaces are available, specify the IP address of the interface to receive the multicast packets from.
sslMode DISABLED For SSL connection settings, specify DISABLED (SSL is invalid), REQUIRED (SSL is valid), or VERIFY (SSL is valid and performs server certificate verification).

[Memo]

Example:

GS_COMMON_JVM_ARGS="-Djavax.net.ssl.trustStore=/var/lib/gridstore/admin/keystore.jks -Djavax.net.ssl.trustStorePassword=changeit"

Example:

server.ssl.enabled=true
server.port=8443
server.ssl.key-store-type=JKS
server.ssl.key-store=/var/lib/gridstore/admin/keystore.jks
server.ssl.key-store-password=changeit
server.ssl.key-alias=tomcat

Node repository settings

Node repository files are files to centrally manage cluster configuration data and node data (/var/lib/gridstore/admin/conf/repository.json ). They are used to specify cluster under management and cluster operation functions. Set together with the GridDB cluster configuration as a gsadm user.

The default file contents are as follows.

{
    "header" : {
        "lastModified" : "",
        "version" : "5.0.0"
    },
    "clusters" : [
        {
            "name" : "INPUT_YOUR_CLUSTER_NAME_HERE",
            "address" : "239.0.0.1",
            "port" : 31999,
            "jdbcAddress" : "239.0.0.1",
            "jdbcPort" : 41999
        }
    ],
    "nodes" : [
        {
            "address" : "192.168.1.10",
            "port" : 10040,
            "sshPort" : 22,
            "clusterName" : "INPUT_YOUR_CLUSTER_NAME_HERE"
        }
    ]
}

To configure a node repository, either edit the file directly or use the repository management screen. Repository management screen is recommended. When configuring using the repository management screen, see the functions on the repository management screen and Starting management of a cluster in operation with gs_admin.

Use of the operation control command or command interpreter (gs_sh) is recommended when performing cluster configuration for the first time.

Start and stop

Use the systemctl command to start and stop gs_admin.

$ sudo systemctl [start|stop|status|restart] griddb-webui

Login and login destination screen

Login screen

Access the application URI below to access gs_admin.

http://[Tomcat operating machine address]:8080/gs_admin

he login screen appears when you access the gs_admin application URI.

Login screen
Login screen

In the log-in screen, you can choose from 2 different environment; cluster or repository manager. In the former option, you need to select the cluster that you would like to manage from the drop-down list. Once logged in, you will be taken to the Integrated operation control screen

On the other hand, for the latter option, you will be taken to the Repository management screen.

When logging in, enter your gs_admin user name and password in the box next to “user” and “password” respectively, and press the Login button.

[Memo]

Integrated operation control screen

The integrated operation control screen is shown below.

Integrated operation control screen
Integrated operation control screen

The integrated operation control screen is made up of the following elements.

Element Abbreviation Location Functions
Tree view Tree Left Display, select a list of operating targets
Data display and input section View Right Data display and data input subject to operation
Menu area Top Log out
Message area Bottom

Tree function

In Tree, a cluster or container can be selected as the main operation target by switching tabs at the top.

Tab Tree name Main functions
ClusterTree Cluster tree Display a list of the clusters and nodes, select the operating targets
ContainerTree Container tree Display a list of the databases, search for containers, select operating targets

View function

In View, the tab displayed at the top of View differs for each operating target selected in Tree. The function can be switched by selecting the tab at the top.

See the items of each tree and screen for details.

Repository management screen

This function can be used by a gs_admin administrator user only.

Select repository manager in the login screen and login as a gs_admin administrator user to arrive at the repository management screen.

The repository management screen is shown below.

Repository management screen
Repository management screen

The following functions are available in the repository management screen.

The specifications of the input column are as follows.

Cluster

Node

Cluster tree

Summary

In a cluster tree, the nodes constituting a cluster under management, i.e the repository nodes (clusterName is the cluster under management) are displayed in a tree format.

Cluster tree
Cluster tree

An * will appear at the beginning of a node which has not been registered in the repository.

A description of the icons shown in a cluster tree is given below.

Icon Note
Cluster
Master node
Follower node
Started node
Stopped node
Status unconfirmed node
Message

Context menu

When an element of the tree is right clicked, a context menu appears according to which element is clicked, cluster or node. Data update and element operation can then be performed by selecting an item from the menu.

The menus and functions for the respective selected elements are as follows.

Selection element Menu Functions
Cluster refresh Get list of nodes in a tree again
Node refresh Display the latest node information in View

Operating target and view tab

When an element in the tree is left clicked, the functions appear in the View according to which element is clicked, cluster or node. The function can be changed by tapping the top section of the View.

Selection element Tab Screen name Functions
Cluster Dashboard Dashboard screen The dashboard screen contains a variety of information related to the entire cluster such as memory usage, cluster health, log information, etc.
  Status Cluster status screen Display configuration data and information of cluster under management.
  Monitor OS data display screen Display OS data of a machine with operating nodes.
  Configuration Cluster operation screen The cluster operations screen consists of a list of table of the running nodes, as well as the start and end node features.
Node System System data screen Display system data of the node.
  Container Container list screen The container list screen contains containers information such as the name of the containers and to which database it belongs to.
  Performance Performance data screen Display performance data of the node as a graph.
  Snapshot Snapshot screen The snapshot screen shows the node’s performance at a point in time. The values can be compared with the values measured earlier.
  Log Log screen The log screen contains the event log information of a node and the corresponding setting of its output level.

[Memo]

Dashboard screen

Summary

The dashboard screen contains a variety of information related to the entire cluster such as memory usage, cluster health, log information, etc.

Method of use

Type of tree Operating target Tab
Cluster tree Cluster Dashboard

Screen

Dashboard screen
Dashboard screen

Functions

The following functions are available in the dashboard screen.

Cluster status screen

Summary

Display configuration data and information of cluster under management.

Method of use

Type of tree Operating target Tab
Cluster tree Cluster Status

Screen

Cluster status screen
Cluster status screen

Functions

The cluster status screen is comprised of the following components.

OS data display screen

Summary

The OS data display screen is comprised of two components, Resource Information and OS Performance of the current cluster. The GridDB performance analysis, and the CPU and Network load status are displayed by pie charts and line graphs respectively.

Method of use

Type of tree Operating target Tab
Cluster tree Cluster Monitor

Screen

OS data display screen
OS data display screen

Functions

The OS data display screen is comprised of the following components.

[Memo]

Cluster operation screen

This function can be used by the gs_admin administrator only.

Summary

The cluster operations screen consists of a list of table of the running nodes, as well as the start and end node features.

Method of use

Type of tree Operating target Tab
Cluster tree Cluster Configuration

Screen

Cluster operation screen
Cluster operation screen

Functions

The following functions are available in the cluster operation screen.

[Memo]

System data screen

Summary

Display system data of the node.

Method of use

Type of tree Operating target Tab
Cluster tree Node System

Screen

Cluster operation screen
Cluster operation screen

Functions

The following functions are available in the system data screen.

Container list screen

Summary

The container list screen contains containers information such as the name of the containers and to which database it belongs to.

Method of use

Type of tree Operating target Tab
Cluster tree Node Container

Screen

Container list screen
Container list screen

Functions

The following functions are available in the container list screen.

[Memo]

Performance data screen

Summary

Display performance data of the node as a graph.

Method of use

Type of tree Operating target Tab
Cluster tree Node Performance

Screen

Performance data screen
Performance data screen

Functions

The following functions are available in the performance data screen.

Snapshot screen

Summary

The snapshot screen shows the node’s performance at a point in time. The values can be compared with the values measured earlier.

Method of use

Type of tree Operating target Tab
Cluster tree Node Snapshot

Screen

Snapshot screen
Snapshot screen

Functions

The following functions are available in the snapshot screen.

Log screen

Summary

The log screen contains the event log information of a node and the corresponding setting of its output level.

Method of use

Type of tree Operating target Tab
Cluster tree Node Log

Screen

Log screen
Log screen

Functions

The following functions are available in the log screen.

[Notes]

Container tree

Summary

In a container tree, the databases and containers which exist in a cluster under management are displayed in a tree format.

The cluster under management is displayed at the top of the tree (the figure within the parentheses () refer to the total number of databases in the cluster).

Container tree
Container tree

A description of the icons shown in a container tree is given below.

Icon Note
Cluster
Database
Database (does not exist)
Container (collection)
Container (timeseries container)
Partitioned table (container)
Search folder
Temporary work folder
Message

Functions

The following functions are available in a container tree.

After login, the ClusterTree tab and node list are displayed automatically. Upon switching to the ContainerTree tab, the tree structure of the container tree will be added automatically if it has been saved. However, search folders will not be searched again automatically.

The following operations cannot be carried out in a container tree.

Context menu

When an element of the tree is right clicked, a context menu appears according to which element is clicked, cluster or node. Data update and element operation can then be performed by selecting an item from the menu.

The menus and functions for the respective selected elements are as follows.

Selection element Menu Functions
Cluster refresh Read the tree structure of the tree again and automatically detect the database
Database refresh Check the database existence and search for containers again
Container refresh Display the latest container information in View
  drop Deletion of container (with confirmation dialog)
Search folder refresh Search for container again
  remove Deletion of the search folder
Temporary work folder remove Deletion of a temporary work folder

[Memo]

Operating target and view tab

When an element in the tree is left clicked, the functions appear in the View according to which element is clicked, cluster or node. The function can be changed by tapping the top section of the View.

Selection element Tab Screen name Function overview
Cluster Database Database management screen A database can be created or deleted, and access rights can be assigned or revoked.
  User User management screen In the user management window, addition and deletion of general user, as well as modification of the password can be performed.
  SQL SQL screen The results of a SQL command executed on the database can be displayed.
Database Create Container creation screen A container can be created in a database.
  SQL SQL screen The results of a SQL command executed on the database can be displayed.
Container Details Container details screen The container details screen contains column and index configuration data of a container.
  Index Index setting screen Index setting window allows an index to be created or deleted for each column of a container.
  TQL TQL screen Execute a TQL (query language) on a container and display the results.
Partition Details Container details screen Column, index and table partitioning data of a container will be displayed.

Database management screen

Summary

A database can be created or deleted, and access rights can be assigned or revoked.

Method of use

Type of tree Operating target Tab
Container tree Cluster Database

Screen

Database management screen
Database management screen

Functions

The following functions are available in the database management screen.

User management screen

Summary

In the user management window, addition and deletion of general user, as well as modification of the password can be performed.

Method of use

Type of tree Operating target Tab
Container tree Cluster User

Screen

User management screen
User management screen

Functions

SQL screen

Summary

The results of a SQL command executed on the database can be displayed.

Method of use

Type of tree Operating target Tab
Container tree Cluster SQL
Container tree Database SQL

Screen

SQL screen
SQL screen

Functions

The following functions are available in the SQL screen.

[Memo]

Container creation screen

Summary

A container can be created in a database.

Method of use

Type of tree Operating target Tab
Container tree Database Create

Screen

Container creation screen (collection)
Container creation screen (collection)
Container creation screen (timeseries container)
Container creation screen (timeseries container)

Functions

The following functions are available in the container creation screen.

[Memo]

Container details screen

Summary

The container details screen contains column and index configuration data of a container.

Method of use

Type of tree Operating target Tab
Container tree Container Details

Screen

Container details screen
Container details screen

Functions

The following functions are available in the container details screen.

Index setting screen

Summary

An index can be created or deleted for each container.

Method of use

Type of tree Operating target Tab
Container tree Container Index

Screen

Index setting screen
Index setting screen

Functions

The following functions are available in the index setting screen.

[Memo]

TQL screen

Summary

Execute a TQL (query language) on a container and display the results.

Method of use

Type of tree Operating target Tab
Container tree Container TQL

Screen

TQL screen
TQL screen

Functions

The following functions are available in the TQL screen.

[Memo]

How to use gs_admin

This section provides a guide on how to use various functions accessible by gs_admin.

Commencing management of a cluster in operation

To manage the current active cluster in gs_admin, use the repository management function and follow the procedure below.

  1. Select the repository manager in the login screen and login as a gs_admin administrator user.
  2. Click the Sync button, enter the following data of any cluster in operation, and then click Sync to synchronize the data.
    • Specify /system/serviceAddress of the node definition file (gs_node.json) as the IP address.
    • Specify /system/servicePort of the node definition file (gs_node.json) as the port.
  3. Data of a cluster in operation will be reflected in the cluster list and node list.
  4. Click the Save button to save repository data.
  5. Click the Logout button to return to the login screen.
  6. Select the name of the cluster in operation from the list of clusters on the login screen.
  7. Log in as a gs_admin administrator user or a normal user to commence the operating functions.

Managing multiple clusters

When managing multiple clusters as a single gs_admin user, take note of the gs_admin user settings.

gs_admin user is managed in a single file, therefore if an administrator managing multiple clusters use different passwords for each of the cluster, the admin cannot be specified as a gs_admin user.

Therefore, the appropriate settings need to be configured according to number of admin in charge of the entire clusters.

The procedure to register a new gs_admin user is shown below.

  1. Use the gs_adduser command to add an administrator user to a single node among the clusters that you want to manage as a new user.

    Example: If the new user name/password is gs#newuser/newuser

  $ su - gsadm
  $ gs_adduser gs#newuser -p newuser
  $ cat /var/lib/gridstore/conf/password
  admin,8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918
  gs#newuser,9c9064c59f1ffa2e174ee754d2979be80dd30db552ec03e7e327e9b1a4bd594e
  system,6ee4a469cd4e91053847f5d3fcb61dbcc91e8f0ef10be7748da4c4a1ba382d17
  1. Distribute the above-mentioned user definition file to all the other nodes of the cluster that you want to manage as a new user.
  2. All nodes will be restarted to reconstitute the cluster.
  3. Add the user name and password added above to the gs_admin user definition file as a Tomcat execution user.

    Example: If the new user name/password is gs#newuser/newuser

  $ echo gs#newuser,9c9064c59f1ffa2e174ee754d2979be80dd30db552ec03e7e327e9b1a4bd594e >> /var/lib/gridstore/admin/conf/password

Gathering of error data

gs_admin error data and other logs are output to the adminHome log directory.

The default output level is info.

This command is used in collecting data when a gs_admin problem occurs, or when there is a request from the support desk, etc.

The log output level can be set in the /webapps/gs_admin/WEB-INF/classes/logback.xml under the Tomcat home directory ( /usr/local/tomcat by default).

Error list

Error type Error no. Message Treatment method
Internal Server Error E00104 Cluster is not servicing. Cluster under management is not operating. Use the configuration tab and other operation tools to operate the cluster, refresh the clusters from the cluster tree, or login again.
Internal Server Error E00105 D10135: Failed to check a node status. Nodes from Ver.1.5 or lower may have been registered in the nodes registered in the repository. Check the version of each node.
Internal Server Error   Failed to create <File path>. File creation failed. Check if there is any directory which does not exist in the displayed path, or any directory for which access rights of Tomcat user have not been assigned.
Internal Server Error E0030C [Code:******] <Error message> Error message of GridDB node.
See GridDB Error Codes and check the countermeasure with the corresponding code.
Bad Request E00300 Container “Container name” already exists. Container name is duplicated. Specify another container name to create a container.
Bad Request E00303 Container “Container name” not found. Specified container does not exist. Right click the ContainerTree cluster, select refresh and search for the container again.
Bad Request   [Code:******] <Error message> Error message of GridDB node.
See GridDB Error Codes and check the countermeasure with the corresponding code.
Input Error   <Field name> is required. The input field has been left blank. Enter a value in the <Field name> input file.
Input Error   <Field name> is invalid. An invalid value has been entered in the <Field name> input field. See “GridDB Operation Tools Reference” and input a possible types value.

— Export/import tools —

In the GridDB export/import tools, to recover a database from local damages or the database migration process, save/recovery functions are provided in the database and container unit.

Installed directories and files

The export tool saves the container and row data of a GridDB cluster in the file below. A specific container can also be exported by specifying its name.

The import tool imports the container and export execution data files, and recover the container and row data in GridDB. A specific container data can also be imported as well.

Export/import configuration
Export/import configuration

Container data files

Container data files are composed of metadata files and row data files.

A metadata file is a json-format file which contains the container type and schema, and the index data that has been set up.

There are 2 types of row data file, one of which is the CSV data file in which container data is stored in the CSV format, and the other is the binary data file in which data is stored in a zip format.

See Format of a container data file for details of the contents described in each file.

In addition, there are 2 types of container data file as shown below depending on the number of containers to be listed.

Hereinafter, container data files of various configurations will be written as single container data file and multi-container data file.

Container data file
Container data file

When a large container is specified as a single container data file and export is executed, management becomes troublesome as a large amount of metadata files and row data files are created. On the other hand, even if a large container is specified as a multi-container data file, only 1 metadata file and row data file is output.

Therefore, it is recommended that these 2 configurations be used differently depending on the application.

A single container data file is used in the following cases.

A multi-container data file is used in the following cases.

Export execution data file

Data such as the export date and time, the number of containers, container name etc. is saved in the export execution data file. This file is required to directly recover exported data in a GridDB cluster.

[Memo]

Configuration of export/import execution environment

The following settings are required to execute an export/import command.

RPM package installation

To execute the export/import commands, the client package containing the export/import functions and Java library package need to be installed.

[Example]

# rpm -Uvh griddb-ee-client-X.X.X-linux.x86_64.rpm
Preparing...                ########################################### [100%]
User and group has already been registered correctly.
GridDB uses existing user and group.
   1:griddb-ee-client          ########################################### [100%]

# rpm -Uvh griddb-ee-java_lib-X.X.X-linux.x86_64.rpm
Preparing...                ########################################### [100%]
   1:griddb-ee-java_lib        ########################################### [100%]

Property file settings

Set the property file in accordance with the GridDB cluster configuration used by a gsadm user. Property file is /var/lib/gridstore/expimp/conf/gs_expimp.properties.

The property file contains the following settings.

Property Required Default value Note
mode Required MULTICAST Specify the type of connection method. If the method is not specified, the method used will be the multicast method.
MULTICAST ・・MULTICAST: multicast method
FIXED_LIST・・fixed list method
PROVIDER ・・provider method
hostAddress Essential if mode=MULTICAST 239.0.0.1 Specify the /transaction/notificationAddress in the GridDB cluster definition file (gs_cluster.json). Multicast address used by the export/import tool to access a cluster.
hostPort Essential if mode=MULTICAST 31999 Specify the /transaction/notificationPort in the GridDB cluster definition file (gs_cluster.json). Port of multicast address used by the export/import tool to access a cluster.
jdbcAddress Essential if mode=MULTICAST 239.0.0.1 Specify /sql/notificationAddress in the GridDB cluster definition file (gs_cluster.json) when using the multicast method.
jdbcPort Essential if mode=MULTICAST 41999 Specify /sql/notificationPort in the GridDB cluster definition file (gs_cluster.json) when using the multicast method.
notificationMember Essential if mode=FIXED_LIST Specify /cluster/notificationMember/transaction of the cluster definition file (gs_cluster.json) when using the fixed list method to connect. Connect address and port with a “:” in the description. For multiple nodes, link them up using commas.
Example)192.168.0.100:10001,192.168.0.101:10001
jdbcNotificationMember Essential if mode=FIXED_LIST Specify sql/address and sql/port under the /cluster/notificationMember of the cluster definition file (gs_cluster.json) when using the fixed list method to connect. Connect address and port with a “:” in the description. For multiple nodes, link them up using commas.
Example)192.168.0.100:20001,192.168.0.101:20001
notificationProvider.url Essential if mode=PROVIDER Specify /cluster/notificationProvide/url of the cluster definition file (gs_cluster.json) when using the provider method to connect.
restAddress 127.0.0.1 Specify /system/listenerAddress of the GridDB node definition file (gs_node.json). Parameter for future expansion.
restPort 10040 Specify /system/listenerPort of the GridDB node definition file (gs_node.json). Parameter for future expansion.
clusterName Required INPUT_YOUR_CLUSTER_NAME_HERE Specify the cluster name of GridDB which is used in the command “gs_joincluster”.
logPath /var/lib/gridstore/log Specify the directory to output the error data and other logs when using the export/import tools. Log is output in gs_expimp-YYYYMMDD.log under the directory.
commitCount 1000 Specify the number of rows as a unit to register data when registering container data with the import tool. When the numerical value becomes larger, the buffer for data processing gets larger too. If the row size is small, raise the numerical value, and if the row size is large, lower the numerical value. The parameter affects the registration performance for data import.
transactionTimeout 2147483647 Specify the time allowed from the start until the end of a transaction. When registering or acquiring a large volume of data, a large numerical value matching the data volume needs to be set. A maximum value has been specified for processing a large volume of data by default. (Unit: second)
failoverTimeout 10 Specify the failover time to repeat retry starting from the time a node failure is detected. This is also used in the timeout of the initial connection to the cluster subject to import/export. Increase the value when performing a process such as registering/acquiring a large volume of data in/from a container. (Unit: second)
jdbcLoginTimeout 10 Specify the time of initial connection timeout for JDBC. (Unit: second)
authenticationMethod *dependent on the GridDB cluster settings Specify either INTERNAL (internal authentication) or LDAP (LDAP authentication) as an authentication method to be used.
notificationInterfaceAddress *OS-dependent To configure the cluster network in multicast mode when multiple network interfaces are available, specify the IP address of the interface to receive the multicast packets from.
sslMode DISABLED For SSL connection settings, specify DISABLED (SSL is invalid), REQUIRED (SSL is valid), or VERIFY (SSL is valid and performs server certificate verification).

[Memo]

Example:

GS_COMMON_JVM_ARGS="-Djavax.net.ssl.trustStore=/var/lib/gridstore/admin/keystore.jks -Djavax.net.ssl.trustStorePassword=changeit"
export GS_COMMON_JVM_ARGS

Export function

The options that can be specified when using the export function is explained here (based on usage examples of the export function).

Specifying a process target

How to specify a container

There are 3 ways to specify a container from a GridDB cluster, by specifying all the containers of the cluster: by specifying the database, and by specifying the container individually.

(1) Specify all containers

(2) Specify the database

(3) Specify container individually

How to specify a row

Rows located by a search query can be exported by specifying a search query to remove rows from a container. All rows stored in a container which has not been specified in the search query will be exported.

Specify search query

[Example] Execution example

$ gs_export -c c001 c002 -u admin/admin --filterfile filter1.txt

$ gs_export --all -u admin/admin --filterfile filter2.txt

[Example] Description of definition file

^cont_month     :select * where time > 100
^cont_minutes_.*:select * where flag = 0
cont_year2014   :select * where timestamp > TIMESTAMP('2014-05-21T08:00:00.000Z')

[Memo]

How to specify user access rights

Information on GridDB cluster users and their access rights can also be exported. Use the following command when migrating all data in the cluster.

[Example]

$ gs_export --all -u admin/admin --acl

[Memo]

How to specify a view

A view of a GridDB cluster can also be exported as well as the container.

Specify –all option or –db option to export the view of the database to be exported.

$ gs_export --db public -u admin/admin
Export Start.
Directory : /tmp/export
     :
Number of target container:5 ( Success:5 Failure:0 )

The number of target  views : 15
Export Completed.

Specifying the output format of a row data file

A CSV data file or binary data file can be specified as the output format of a row data file.

[Example]

$ gs_export -c c001 c002 -u admin/admin --binary

$ gs_export --all -u admin/admin --binary 500       //Export Completed.

Specifying the output configuration of container data file

A single container data file to create container data file in a container unit, or a multi-container data file to output all containers to a single container data file can be specified.

[Example]

$ gs_export -c c001 c002 -u admin/admin --out test

$ gs_export --all -u admin/admin --out           //file is created with the date

Specifying the output destination

The directory of the container data file can be specified as the output destination. Create a directory if the specified directory does not exist. If the directory is not specified, data will be output to the current directory when a command is executed. Use the -d option to specify the output destination.

[Example]

$ gs_export --all -u admin/admin --out test -d /tmp

[Memo]

Specifying the number parallel executions

Get data to access a cluster in parallel with the export tool. If a command is executed in parallel on a cluster composed of multiple nodes, data can be acquired at a high speed as each node is accessed in parallel.

[Memo]

[Example]

$ gs_export --all -u admin/admin --binary --out --parallel 4

Test execution function

Before exporting a container, the user can assess whether the export can be carried out correctly.

[Example]

$ gs_export -u admin/admin --all --test
Export Start.
[TEST Mode]
Directory : /var/lib/gridstore/export
The number of target containers  : 5

Name                                      PartitionId Row
------------------------------------------------------------------
public.container_2                                 15          10
public.container_3                                 25          20
public.container_0                                 35          10
public.container_1                                 53          10
public.container_4                                 58          20

Number of target container:5 ( Success:5 Failure:0 )

The number of target views : 15
Export Completed.

Error continuation specification

Export processing can be continued even if a row data acquisition error were to occur due to a lock conflict with another application.

[Example]

$ gs_export --all -u admin/admin --force

[Memo]

Other functions

Detailed settings in the operating display

[Example]

$ gs_export --containerregex "^c0" -u admin/admin --verbose
Export Start.
Directory : /data/exp
Number of target container : 4

public.c003 : 1
public.c002 : 1
public.c001 : 1
public.c010 : 1
The row data has been acquired. : time=[5080]

Number of target container:4 ( Success:4 Failure:0 )
Export Completed.

Suppressed settings in the operating display

[Example]

$ gs_export -c c002 c001 -u admin/admin --silent

Import function

Import the container data file data into the GridDB cluster.

Types of data source for import

The input data sources used by the import tool are as follows.

Importing from a container data file

Use the export function to import data in the exported data format into a GridDB cluster.

Specifying a process target

Processing data to be imported from the container data file needs to be specified.

How to specify a container

There are 3 ways to specify a container, by specifying all the containers in the container data file, by specifying the database, and by specifying the container individually.

(1) Specify all containers

(2) Specify the database

(3) Specify container individually

[Points to note]

[Memo]

How to specify user access rights

If data is exported by specifying the –acl option in the export function, data on the user and access rights can also be imported. Use the following command when migrating all data in the cluster.

[Example]

$ gs_import --all --acl -u admin/admin

[Memo]

How to specify a view

If the view was exported using the export function, a view can also be imported together with the container data.

Specify –all option or –db option to import the view of the database to be imported.

[Memo]

Specifying a container data file

Specify the container data file. If this is not specified, the file in the current directory will be processed.

[Example]

//Specify all containers from the current directory
$ gs_import --all -u admin/admin

//Specify multiple databases from a specific directory
$ gs_import --db db002 db001 -u admin/admin  -d /data/expdata

//Specify multiple containers from a specific directory
$ gs_import -c c002 c001 -u admin/admin  -d /data/expdata

[Memo]

Getting a container list

The container data can be checked before importing.

[Example]

$ gs_import --list
Container List in local export file
DB            Name              Type            FileName
public        container_2       COLLECTION      container_2.csv
public        container_0       TIME_SERIES     container_0.csv
public        container_1       COLLECTION      container_1.csv
userDB        container_1_db    TIME_SERIES     userDB.container_1_db.csv
userDB        container_2_db    TIME_SERIES     userDB.container_2_db.csv
userDB        container_0_db    COLLECTION      userDB.container_0_db.csv

Data registration option

When importing, if a specific option is not specified, an error will occur if the container that you are trying to register already exists in the GridDB cluster. Data can be added or replaced by specifying the next option. During data registration, the number of containers registered successfully and the number of containers which failed to be registered are shown.

[Example]

$ gs_import -c c002 c001 -u admin/admin  --append
Import initiated (Append Mode)
Import completed
Success:2 Failure:0

$ gs_import -c c002 c001 -u admin/admin  --replace
Import initiated (Replace Mode)
Import completed
Success:2 Failure:0

$ gs_import --all  -u admin/admin  -d /datat/expdata   --replace

Error continuation specification

The import process can be continued even if a registration error were to occur in a specific row data due to a user editing error in the container data file.

[Example]

$ gs_import --all -u admin/admin -d /data/expdata --force

[Memo]

Other functions

Detailed settings in the operating display

Command/option specifications

Export command

[Memo]

Import command

[Memo]

Format of container data file

The respective file formats to configure container data files are shown below.

Metadata file

The metadata file stores the container data in the JSON format. The container data to be stored is shown below.

Item Note
<Container name> Name of the container.
Container type Refers to a collection or time series container.
Schema data Data of a group of columns constituting a row. Specify the column name, data type, and column constraints.
Index setting data Index type data set in a container. Availability of index settings. Specify the type of index, including tree index and spatial index.
Row key setting data Set up a row key when collection container is used. For time series containers, either there is no row key set or the default value, if set, will be valid.
Table partitioning data Specify table partitioning data.

The tag and data items of the metadata in the JSON format are shown below. Tags that are essential for new creations by the user are also listed (tag setting condition).

field Item Note Setting conditions
Common parameters      
database <Database name> <Database name> Arbitrary, “public” by default
container <Container name> <Container name> Required
containerType Container type Specify either COLLECTION or TIME_SERIES Required
containerFileType Container data file type Specify either csv or binary. Required
containerFile Container data file name File name Arbitrary
dataAffinity Data affinity name Specify the data affinity name. Arbitrary
partitionNo Partition Null string indicates no specification. Arbitrary, output during export. Not used even if it is specified when importing.
columnSet Column data set (, schema data) Column data needs to match when adding data to an existing container Required
columnName Column name   Required
type JSON Data type Specify either of the following values: BOOLEAN/ STRING/ BYTE/ SHORT/ INTEGER/ LONG/ FLOAT/ DOUBLE/ TIMESTAMP/ GEOMETRY/ BLOB/ BOOLEAN[]/ STRING[]/ BYTE[] /SHORT. []/ INTEGER[]/ LONG[]/ FLOAT[]/ DOUBLE[]/ TIMESTAMP[]. Required
notNull NOT NULL constraint true/false Arbitrary, “false” by default
rowKeyAssigned Row key setting (*1) specify either true/false
Specifying also rowKeySet causes an error
Arbitrary, “false” by default
rowKeySet Row key column names Specify row key column names in array format.
The row key needs to match when adding data to an existing container
Arbitrary (*2)
indexSet Index data set Can be set for each column. Non-existent column name will be ignored or an error will be output. Arbitrary
columnNames Column names Specify column names in array format. Arbitrary (essential when indexSet is specified)
type Index type Specify one of the following values: TREE (STRING/ BOOLEAN/ BYTE/ SHORT/ INTEGER/ LONG/ FLOAT/ DOUBLE/ TIMESTAMP) or SPATIAL (GEOMETRY). Arbitrary (essential when indexSet is specified)
indexName Index name Index name Arbitrary, not specified either by default or when null is specified.
Table partitioning data      
tablePartitionInfo Table partitioning data For Interval-Hash partitioning, specify the following group of items for both Interval and Hash as an array in that order Arbitrary
type Table partitioning type Specify either HASH or INTERVAL Essential if tablePartitionInfo is specified
column Partitioning key Column types that can be specified are as follows
Any type if type=HASH
BYTE, SHORT, INTEGER, LONG, TIMESTAMP if type=INTERVAL
Essential if tablePartitionInfo is specified
divisionCount Number of hash partitions (Effective only if type=HASH) Specify the number of hash partitions Essential if type=HASH
intervalValue Interval value (Effective only if type=INTERVAL) Specify the interval value Essential if type=INTERVAL
intervalUnit Interval unit (Effective only if type=INTERVAL) DAY only Essential if type=INTERVAL and column=TIMESTAMP
Interval or interval-hash partitioning only parameter      
expirationType Type of expiry release function Specify “partition”, when specifying partition expiry release. Arbitrary
expirationTime Length of expiration Integer value Essential if expirationType is specified
expirationTimeUnit Elapsed time unit of row expiration Specify either of the following values: DAY/ HOUR/ MINUTE/ SECOND/ MILLISECOND. Essential if expirationType is specified

[Memo]

[Notes]

[Example1] Example of a collection in a single container data file (public.c001_properties.json)

[Example 2] Example of a collection and timeseries container in a multi-container data file (public.container01_properties.json)

[Example 3] Example of a description for table partitioning

[Memo]

Row data file (binary data file)

A row data file, binary data file, is in zip format and can be created by gs_export only. No readability, and cannot be edited as well.

Row data file (CSV data file)

A row data file, csv file, is in CSV format and describes the references to the metadata file, which defines rows, in the container data file data section.

[Memo]

<CSV data file format>

1. Header section (1st - 2nd row)

Header section contains data output during export. Header data is not required during import.

[Example]

"#2017-10-01T17:34:36.520+0900 GridDB V4.0.00"
"#User:admin "

2. Container data file data section (3rd and subsequent rows)

Describe the references to the metadata file.

3. Row data section (container data and subsequent sections)

The following section describes the row data.

[Memo]

4. Comments section

The comment section can be described anywhere in the CSV data file except the header section.

[Memo]

<File name format>

The name of the CSV data file output by the export tool is as follows.

[Example] a meta data file in CSV format ,including external object file, for Example 1

"#2017-10-01T11:19:03.437+0900  GridDB V4.0.00"
"#User:admin"
"%","public.c001_properties.json"
"$","public.c001"
"1","Tokyo"
"2","Kanagawa"
"3","Osaka"

When the data below is included in some of the rows of the CSV data file, prepare an external object file separate from the CSV data file as an external object. List the references of the external data file in the target column of the CSV file as below. “@data type”: (file name)

When an external object file is exported, the external object file name is created in accordance with the following rules during export.

For import purposes, any file name can be used for the external object file. List down the CSV data file with a file name of any data type in the relevant column.

[Example] Naming example of an external object file

//When a collection (colb) having a BYTE array in the 3rd column is exported

10月  4 12:51 2017 public.colb.csv
10月  4 12:51 2017 public.colb_0_3.byte_array
10月  4 12:51 2017 public.colb_1_3.byte_array
10月  4 12:51 2017 public.colb_2_3.byte_array
10月  4 12:51 2017 public.colb_3_3.byte_array
10月  4 12:51 2017 public.colb_4_3.byte_array
10月  4 12:51 2017 public.colb_properties.json

[Example] Description of an external object file in a single container data file is shown below.

— Database file migration tool —

Overview

Migrate the database files created in GridDB V4 to the format that can be used in GridDB V5. The following section provides the procedure for migration by using the migration tool on a single machine.

[Notes]

2021-12-26T16:10:41.211+09:00 RHEL83-1 31897 WARNING MAIN [100002:CT_PARAMETER_INVALID] Unknown parameter (source=gs_node.json, group=dataStore, name=storeWarmStart)

Preparation for migration

If the V4 database meets any of the following conditions, the database file migration tool fails to run.

Before using the database file migration tool, delete the functions not supported in V5 from the database to be migrated and complete the background process.

Starting a GridDB V4 cluster

To check the V4 database, start a GridDB V4 cluster. GridDB clusters can be started using the GridDB service and various tools. For detailed operation, see the following chapters:

Checking unsupported functions and deleting them

Functions not supported in V5 (trigger, HASH, row expiry release, and timeseries compression) cannot be migrated. In SQL, check whether unsupported functions are used. They must be deleted. The following procedure is based on the sections on Cluster operation control command interpreter (gs_sh) and Export/import tools.

Checking and deleting a trigger

Execute the following SQL statement using gs_sh to check if there is any trigger.

gs[public]> select database_name, table_name, trigger_name from "#event_triggers";

Checking and deleting a Hash index

Execute the following SQL statement using gs_sh to check if there is any Hash index.

gs[public]> select database_name, table_name, column_name from "#index_info" where index_type='HASH';

Checking and deleting row expiry release

Execute the following SQL statement using gs_sh to check if there is any container with row expiry release.

gs[public]> select database_name, table_name from "#tables" where EXPIRATION_TYPE='ROW';

Checking and deleting timeseries compression

Execute the following SQL statement using gs_sh to check if there is any container with timeseries compression.

gs[public]> select database_name, table_name from "#tables" where COMPRESSION_METHOD is not null;

Checking the completion of a background process

Using the cluster information retrieval command gs_stat, check the completion of a background process. If numBackground is equal to 0, the background process is completed.

$ gs_stat -u admin/admin | grep numBackground
        "numBackground": 0,

Check the completion on all the GridDB clusters. If numBackground is one or more, the background process is currently running. Wait with the GridDB cluster running until the background process is completed (i.e., until numBackground reaches 0).

Stopping a GridDB V4 cluster

After checking the deletion of the functions not supported in V5 and the completion of the background process, stop the V4 cluster and then each node. To prepare for the installation of GridDB V5, rename the storage directory for database files.

Example:

$ mv /var/lib/gridstore/data /var/lib/gridstore/data-v4

Installing GridDB V5

Before installing GridDB V5, uninstall all the GridDB V4 packages.

[example of running CentOS]

$ sudo rpm -e griddb-ee-server
$ sudo rpm -e griddb-ee-client
$ sudo rpm -e griddb-ee-java-lib
$ sudo rpm -e griddb-ee-c-lib

[Memo]

After uninstalling GridDB V4, install GridDB V5. For details on installation, see the “GridDB Administrator Guide” .

Running the database file migration tool

On the machine where V4 databases reside, run the database file migration tool.

[example of running the command]

  $ gs_convdbv4tov5 --v4data /var/lib/gridstore/data-v4 --v5data /var/lib/gridstore/data --v5txnlog /var/lib/gridstore/txnlog

[Notes]

Starting a GridDB V5 cluster

After completing running the database file migration tool, start a GridDB V5 cluster and make sure that the data has been migrated. Import the container exported in the section 7.2.2. Checking unsupported functions and deleting them as needed.

[Notes]