<?php require_once( dirname(dirname(dirname( __FILE__ ))) . '/wp-load.php' ); ?>
<!-- START of header -->
<?php get_header(); ?>
<!-- END of header -->

<!-- warapper -->

<div class="docs-content">
<!-- START of page navigation -->
<?php get_template_part( 'docs_navigation' ); ?>
<!-- END of page navigation -->
<!-- START of pusher -->
<div class="docs-content-body">
<div id="content" class="docs-content-body__inner">

<div id="outline-container-1" class="outline-3">
<h1 id="sec-1"><span class="section-number-3">6.6</span> Cluster Administration &amp; Operations </h1>
<div class="outline-text-3" id="text-1">

	<p>
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.
</p>
<p>
The following can be carried out by gs_sh.
</p><ul>
<li>
Operation control of GridDB cluster
<ul>
<li>
Definition of GridDB cluster
</li>
<li>
Starting and stopping a GridDB node and cluster
</li>
<li>
Status, log display
</li>
</ul>
</li>
<li>
GridDB cluster data operation
<ul>
<li>
Database and user management
</li>
<li>
Collection, trigger display
</li>
<li>
Index setting, deletion
</li>
<li>
Search using a tql/sql

</li>
</ul>
</li>
</ul>

<p><b>[Memo]</b>
</p><ul>
<li>
All functions provided in the GridDB operating commands are planned to be provided as gs_sh subcommands. Where possible, use of gs_sh is recommended as there is a possibility that the operating commands may be deleted in future releases. See the chapter on “Operating Commands” for details of the operating commands.

</li>
</ul>
</div>

</div>

<div id="outline-container-4.2" class="outline-3">
<h3 id="sec-1.1"> Using gs_sh </h3>
<div class="outline-text-3" id="text-4.2">



</div>

<div id="outline-container-4.2.1" class="outline-4">
<h3 id="sec-4.2.1"> Preliminary Preparations </h3>
<div class="outline-text-4" id="text-4.2.1">

<p>Carry out the following preparations before using gs_sh.
</p><ul>
<li>
GridDB setup
<ul>
<li>
Installation of GridDB node, client library
</li>
<li>
User creation
</li>
<li>
Network setting (GridDB cluster definition file, node definition file)

</li>
</ul>

<p>　See the chapter on “System Design &amp; Construction” in the “GridDB Quick Start Guide” (<a href="GridDB_QuickStartGuide.html">GridDB_QuickStartGuide.html</a>) for details on the procedure.
</p>
</li>
<li>
Remote connection setting using SSH
<ul>
<li>
This setting is necessary in order to connect to each GridDB node execution environment from the gs_sh execution environment as an OS user “gsadm”.
</li>
</ul>

<p>　*See the manual of each OS for details on the SSH connection procedure.
</p>

</li>
</ul>
</div>

</div>

<div id="outline-container-4.2.2" class="outline-4">
<h3 id="sec-4.2.2"> gs_sh start-up </h3>
<div class="outline-text-4" id="text-4.2.2">


<p>
There are two types of start modes in gs_sh.
</p>
<ul>
<li>
Startup in interactive mode
<ul>
<li>
The interactive mode is started when gs_sh is executed without any arguments. The gs_sh prompt will appear, allowing subcommands to be entered.
</li>
<li>
Example:

</li>
</ul>


<pre class="example">$ gs_sh
// execution of subcommand “version”
gs> version
gs_sh version 2.0.0
</pre>




<p>
<b>[Memo]</b>
</p><ul>
<li>
When a subcommand is started in the interactive mode, 
<ul>
<li>
a .gssh_history file is created in the home directory of the execution user and saved in the history.
</li>
<li>
Click the arrow key to display/execute up to 20 subcommands started earlier.
</li>
<li>
Enter some of the subcommands and click the Tab key to display a list of the subcommand input candidates.


</li>
</ul>
</li>
</ul>
</li>
<li>
Startup in batch mode
<ul>
<li>
When the script file for user creation is specified in gs_sh, the system will be started in the batch mode. Batch processing of a series of subcommands described in the script file will be carried out. gs_sh will terminate at the end of the batch processing.
</li>
<li>
Example:  

</li>
</ul>


<pre class="example">// specify the script file (test.gsh) and execute
$ gs_sh test.gsh
</pre>




</li>
</ul>

<p><b>[Memo]</b>
</p><ul>
<li>
Execute gs_sh commands as the OS user “gsadm”.
</li>
<li>
During gs_sh startup, .gsshrc script files under the gsadm user home directory are imported automatically. The .gsshrc contents will also be imported to the destination from other script files.
</li>
<li>
Extension of script file is gsh.
</li>
<li>
A script file is described using the character code UTF-8.


</li>
</ul>
</div>
</div>

</div>

<div id="outline-container-4.3" class="outline-3">
<h3 id="sec-1.2">Definition of a GridDB Cluster </h3>
<div class="outline-text-3" id="text-4.3">


<p>
The definition below is required in advance when executing a GridDB cluster operation control or data operation.
</p><ul>
<li>
Define each node data in the <span style="text-decoration:underline;">node variable</span> 
</li>
<li>
Use the node variable to define the GridDB cluster configuration in the <span style="text-decoration:underline;">cluster variable</span> 
</li>
<li>
<span style="text-decoration:underline;">Define the user data</span> of the GridDB cluster 

</li>
</ul>

<p>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.
</p>


</div>

<div id="outline-container-4.3.1" class="outline-4">
<h3 id="sec-4.3.1"> Definition of Node Variable </h3>
<div class="outline-text-4" id="text-4.3.1">

<p>Define the IP address and port no. of a GridDB node in the node variable.
</p>
<ul>
<li>
Subcommand
<table class="table-dl-connector"  border="0" cellspacing="0" cellpadding="6" rules="none" frame="box" >
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<tbody>
<tr><td>setnode</td><td>Node variable name IP address and port no. [SSH port no.]</td></tr>
</tbody>
</table>


</li>
<li>
Description of each argument
<table class="table-dl-connector"  border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<thead>
<tr><th scope="col">Argument</th><th scope="col">Description</th></tr>
</thead>
<tbody>
<tr><td>Node variable name</td><td>Specify the node variable name. If the same variable name already exists, its definition will be overwritten.</td></tr>
<tr><td>IP address</td><td>Specify the IP address of the GridDB node (for connecting operation control tools).</td></tr>
<tr><td>Port no.</td><td>Specify the port no. of the GridDB node (for connecting operation control tools).</td></tr>
<tr><td>SSH port no.</td><td>Specify the SSH port number. Number 22 is used by default.</td></tr>
</tbody>
</table>


</li>
<li>
Example:



<pre class="example">//Define 4 GridDB nodes
gs> setnode node0 192.168.0.1 10000
gs> setnode node1 192.168.0.2 10000
gs> setnode node2 192.168.0.3 10000
gs> setnode node3 192.168.0.4 10000
</pre>




</li>
</ul>

<p><b>[Memo]</b>
</p><ul>
<li>
Only single-byte alphanumeric characters and the symbol "_" can be used in the node variable name.
</li>
<li>
Check the GridDB node “IP address” and “port no. ” for connecting the operation control tools in the <span style="text-decoration:underline;">node definition file</span> of each tool.
<ul>
<li>
“IP address”: /system/serviceAddress
</li>
<li>
“Port no.” : /system/servicePort
</li>
</ul>
</li>
</ul>

<p>　
</p>
</div>

</div>

<div id="outline-container-4.3.2" class="outline-4">
<h3 id="sec-4.3.2"> Definition of Cluster Variable </h3>
<div class="outline-text-4" id="text-4.3.2">

<p>Define the GridDB cluster configuration in the cluster variable.
</p>
<ul>
<li>
Subcommand
<table class="table-dl-connector"  border="0" cellspacing="0" cellpadding="6" rules="none" frame="box" >
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<tbody>
<tr><td>setcluster</td><td>&lt;Cluster variable name> &lt;Cluster name> &lt;Multicast address> &lt;Port no.> [&lt; Node variable>...]</td></tr>
<tr><td>setcluster</td><td>&lt;Cluster variable name> &lt;Cluster name> FIXED_LIST &lt; Address list of fixed list method> [&lt;Node variable>...]</td></tr>
<tr><td>setcluster</td><td>&lt;Cluster variable name> &lt;Cluster name> PROVIDER &lt;URL of provider method> [&lt;Node variable>...]</td></tr>
</tbody>
</table>


</li>
<li>
Description of each argument
<table class="table-dl-connector"  border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<thead>
<tr><th scope="col">Argument</th><th scope="col">Description</th></tr>
</thead>
<tbody>
<tr><td>Cluster variable name</td><td>Specify the cluster variable name. If the same variable name already exists, its definition will be overwritten.</td></tr>
<tr><td>Cluster name</td><td>Specify the cluster name.</td></tr>
<tr><td>Multicast address</td><td>[For the multicast method] Specify the GridDB cluster multicast address (for client connection).</td></tr>
<tr><td>Port no.</td><td>[For the multicast method] Specify the GridDB cluster multicast port no. (for client connection).</td></tr>
<tr><td>Node variable</td><td>Specify the nodes constituting a GridDB cluster with a node variable.</td></tr>
<tr><td></td><td>When using a cluster variable in a data operation subcommand, the node variable may be omitted.</td></tr>
<tr><td>Address list of fixed list method</td><td>[For fixed list method] Specify the list of transaction addresses and ports for cluster.notificationMember in gs_cluster.json Example: 192.168.15.10:10001,192.168.15.11:10001</td></tr>
<tr><td>URL of provider method</td><td>[For provider method] Specify the value of cluster.notificationProvider in gs_cluster.json.</td></tr>
</tbody>
</table>


</li>
<li>
Example:



<pre class="example">// define the GridDB cluster configuration
gs> setcluster cluster0 name 200.0.0.1 1000 $node0 $node1 $node2
</pre>




</li>
</ul>

<p><b>[Memo]</b>
</p><ul>
<li>
Only single-byte alphanumeric characters and the symbol "_" can be used in the cluster variable name.
</li>
<li>
Append "$" in front of the variable name when using a node variable.
</li>
<li>
Check the “cluster name”, “multicast address” and “port no.” defined in a cluster variable in the cluster definition file of each GridDB node.
<ul>
<li>
“Cluster name”: /clustergs/clusterName
</li>
<li>
“Multicast address”: /transaction/notificationAddress
</li>
<li>
“Port no.”: /transaction/notificationPort
</li>
</ul>

<p>*All settings in the cluster definition file of a node constituting a GridDB cluster have to be configured the same way. If the settings are configured differently, the cluster cannot be composed.
</p></li>
</ul>

<p>　
</p>
<p>
In addition, node variables can be added or deleted for a defined cluster variable.
</p><ul>
<li>
Subcommand
<table class="table-dl-connector"  border="0" cellspacing="0" cellpadding="6" rules="none" frame="box" >
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<tbody>
<tr><td>modcluster</td><td>Add cluster variable name｜remove node variable name...</td></tr>
</tbody>
</table>


</li>
<li>
Description of each argument
<table class="table-dl-connector"  border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<thead>
<tr><th scope="col">Argument</th><th scope="col">Description</th></tr>
</thead>
<tbody>
<tr><td>Cluster variable name</td><td>Specify the name of a cluster variable to add or delete a node.</td></tr>
<tr><td>add｜remove</td><td>Specify add when adding a node variable, and remove when deleting a node variable.</td></tr>
<tr><td>Node variable</td><td>Specify a node variable to add or delete a cluster variable.</td></tr>
</tbody>
</table>



</li>
<li>
Example:



<pre class="example">//Add a node to a defined GridDB cluster configuration
gs> modcluster cluster0 add $node3
//Delete a node from a defined GridDB cluster configuration
gs> modcluster cluster0 remove $node3
</pre>




</li>
</ul>

<p><b>[Memo]</b>
</p><ul>
<li>
Append "$" in front of the variable name when using a node variable.
</li>
</ul>

<p>　
</p></div>

</div>

<div id="outline-container-4.3.3" class="outline-4">
<h3 id="sec-4.3.3"> Defining the SQL Connection Destination of a Cluster </h3>
<div class="outline-text-4" id="text-4.3.3">

<p>Define the SQL connection destination in the GridDB cluster configuration.  <span style="text-decoration:underline;">This is set up only when using the GridDB Advanced Edition NewSQL interface. </span>
</p>
<ul>
<li>
Subcommand
<table class="table-dl-connector"  border="0" cellspacing="0" cellpadding="6" rules="none" frame="box" >
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<tbody>
<tr><td>setclustersql</td><td>&lt;Cluster variable name> &lt;Cluster name> &lt;SQL address> &lt;SQL port no.></td></tr>
<tr><td>setclustersql</td><td>&lt;Cluster variable name> &lt;Cluster name> FIXED_LIST &lt; SQL address list of fixed list method></td></tr>
<tr><td>setclustersql</td><td>&lt;Cluster variable name> &lt;Cluster name> PROVIDER &lt;URL of provider method></td></tr>
</tbody>
</table>



</li>
<li>
Description of each argument
<table class="table-dl-connector"  border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<thead>
<tr><th scope="col">Argument</th><th scope="col">Description</th></tr>
</thead>
<tbody>
<tr><td>Cluster variable name</td><td>Specify the cluster variable name. If the same variable name already exists, the SQL connection data will be overwritten.</td></tr>
<tr><td>Cluster name</td><td>Specify the cluster name.</td></tr>
<tr><td>SQL address</td><td>[For multicast method] Specify the reception address for the SQL client connection.</td></tr>
<tr><td>SQL port no.</td><td>[For multicast method] Specify the port no. for the SQL client connection.</td></tr>
<tr><td>SQL address list of fixed list method</td><td>[For fixed list method] Specify the list of sql addresses and ports for cluster.notificationMember in gs_cluster.json Example: 192.168.15.10:20001,192.168.15.11:20001</td></tr>
<tr><td>URL of provider method</td><td>[For provider method] Specify the value of cluster.notificationProvider in gs_cluster.json.</td></tr>
</tbody>
</table>


</li>
<li>
Example:



<pre class="example">//Definition method when using both NoSQL interface and NewSQL interface to connect to a NewSQL server
gs> setcluster    cluster0 name 239.0.0.1 31999 $node0 $node1 $node2
gs> setclustersql cluster0 name 239.0.0.1 41999
</pre>




</li>
</ul>

<p><b>[Memo]</b>
</p><ul>
<li>
Only single-byte alphanumeric characters and the symbol "_" can be used in the cluster variable name.
</li>
<li>
This is set up only when using the GridDB Advanced Edition NewSQL interface.
</li>
<li>
When an existing cluster variable name is specified, only the section containing SQL connection data will be overwritten. When overwriting, the same method as the existing connection method needs to be specified.
</li>
<li>
Execute only this command when using SQL only.
</li>
<li>
Check the “SQL address” and “SQL port no.” defined in a cluster variable in the cluster definition file of each GridDB node.
<ul>
<li>
“SQL address”: /sql/notificationAddress
</li>
<li>
“SQL port no.”: /sql/notificationPort


</li>
</ul>
</li>
</ul>
</div>

</div>

<div id="outline-container-4.3.4" class="outline-4">
<h3 id="sec-4.3.4"> Definition of a user </h3>
<div class="outline-text-4" id="text-4.3.4">

<p>Define the user and password to access the GridDB cluster.
</p><ul>
<li>
Subcommand
<table class="table-dl-connector"  border="0" cellspacing="0" cellpadding="6" rules="none" frame="box" >
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<tbody>
<tr><td>setuser</td><td>User name and password [gsadm password]</td></tr>
</tbody>
</table>


</li>
<li>
Description of each argument
<table class="table-dl-connector"  border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<thead>
<tr><th scope="col">Argument</th><th scope="col">Description</th></tr>
</thead>
<tbody>
<tr><td>User name</td><td>Specify the name of the user accessing the GridDB cluster.</td></tr>
<tr><td>Password</td><td>Specify the corresponding password.</td></tr>
<tr><td>gsadm password</td><td>Specify the password of the OS user gs_admin.</td></tr>
<tr><td></td><td>This may be omitted if start node (startnode subcommand) is not going to be executed.</td></tr>
</tbody>
</table>


</li>
<li>
Example:



<pre class="example">//Define the user, password and gsadm password to access a GridDB cluster
gs> setuser admin admin gsadm
</pre>




</li>
</ul>

<p><b>[Memo]</b>
</p><ul>
<li>
The user definition is divided and stored in the variable below.
<table class="table-dl-connector"  border="2" cellspacing="0" cellpadding="6" rules="all" frame="box">
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<thead>
<tr><th scope="col">Variable Name</th><th scope="col">Storage data</th></tr>
</thead>
<tbody>
<tr><td>user</td><td>User name</td></tr>
<tr><td>password</td><td>Password</td></tr>
<tr><td>ospassword</td><td>gsadm password</td></tr>
</tbody>
</table>


</li>
<li>
Multiple users cannot be defined. The user and password defined earlier will be overwritten. When operating multiple GridDB clusters in gs_sh, reset the user and password with the setuser subcommand every time the connection destination cluster is changed.
</li>
</ul>

<p>　
</p>
</div>

</div>

<div id="outline-container-4.3.5" class="outline-4">
<h3 id="sec-4.3.5"> Definition of arbitrary variables </h3>
<div class="outline-text-4" id="text-4.3.5">

<p>Define an arbitrary variable.
</p>
<ul>
<li>
Subcommand
<table class="table-dl-connector"  border="0" cellspacing="0" cellpadding="6" rules="none" frame="box" >
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<tbody>
<tr><td>set</td><td>Variable name [value]</td></tr>
</tbody>
</table>


</li>
<li>
Description of each argument
<table class="table-dl-connector"  border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<thead>
<tr><th scope="col">Argument</th><th scope="col">Description</th></tr>
</thead>
<tbody>
<tr><td>Variable Name</td><td>Specify the variable name.</td></tr>
<tr><td>Value</td><td>Specify the setting value. The setting value of the variable concerned can be cleared by omitting the specification.</td></tr>
</tbody>
</table>


</li>
<li>
Example:



<pre class="example">// define variable
gs> set GS_PORT 10000
// clear variable settings
gs> set GS_PORT
</pre>




</li>
</ul>

<p><b>[Memo]</b>
</p><ul>
<li>
Node variable and cluster variable settings can also be cleared with the set subcommand.
</li>
<li>
Only single-byte alphanumeric characters and the symbol "_" can be used in the variable name.
</li>
</ul>

<p>　
</p>
</div>

</div>

<div id="outline-container-4.3.6" class="outline-4">
<h3 id="sec-4.3.6"> Displaying the variable definition </h3>
<div class="outline-text-4" id="text-4.3.6">

<p>Display the detailed definition of the specified variable.
</p>
<ul>
<li>
Subcommand
<table class="table-dl-connector"  border="0" cellspacing="0" cellpadding="6" rules="none" frame="box" >
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<tbody>
<tr><td>show</td><td>[Variable name]</td></tr>
</tbody>
</table>


</li>
<li>
Description of each argument
<table class="table-dl-connector"  border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<thead>
<tr><th scope="col">Argument</th><th scope="col">Description</th></tr>
</thead>
<tbody>
<tr><td>Variable Name</td><td>Specify the name of the variable to display the definition details. If the name is not specified, details of all defined variables will be displayed.</td></tr>
</tbody>
</table>


</li>
<li>
Example:



<pre class="example">//Display all defined variables
gs> show
Node variable:
node0=Node[192.168.0.1:10000,ssh=22]
node1=Node[192.168.0.2:10000,ssh=22]
node2=Node[192.168.0.3:10000,ssh=22]
node3=Node[192.168.0.4:10000,ssh=22]
Cluster variable:
cluster0=Cluster[name=name,200.0.0.1:1000,nodes = (node0,node1,node2
Other variables:
user=admin
password=*****
ospassword=*****
</pre>





</li>
</ul>

<p><b>[Memo]</b>
</p><ul>
<li>
Password character string will not appear. Display replaced by "*****".
</li>
</ul>

<p>　
</p>
</div>

</div>

<div id="outline-container-4.3.7" class="outline-4">
<h3 id="sec-4.3.7"> Saving a variable definition in a script file </h3>
<div class="outline-text-4" id="text-4.3.7">

<p>Save the variable definition details in the script file.
</p><ul>
<li>
Subcommand
<table class="table-dl-connector"  border="0" cellspacing="0" cellpadding="6" rules="none" frame="box" >
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<tbody>
<tr><td>save</td><td>[Script file name]</td></tr>
</tbody>
</table>


</li>
<li>
Description of each argument
<table class="table-dl-connector"  border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<thead>
<tr><th scope="col">Argument</th><th scope="col">Description</th></tr>
</thead>
<tbody>
<tr><td>Script file name</td><td>Specify the name of the script file serving as the storage destination. Extension of script file is gsh.</td></tr>
<tr><td></td><td>If the name is not specified, the data will be saved in the .gsshrc file in the gsadm user home directory.</td></tr>
</tbody>
</table>


</li>
<li>
Example:



<pre class="example">// Save the defined variable in a file
gs> save test.gsh
</pre>





</li>
</ul>

<p><b>[Memo]</b>
</p><ul>
<li>
If the storage destination script file does not exist, a new file will be created. If the storage destination script file exists, the contents will be overwritten.
</li>
<li>
A script file is described using the character code UTF-8.
</li>
<li>
Contents related to the user definition (user, password, gsadm password) will not be output to the script file.
</li>
<li>
Contents in the .gsshrc script file will be automatically imported during gs_sh start-up.
</li>
</ul>

<p>　
</p>
</div>

</div>

<div id="outline-container-4.3.8" class="outline-4">
<h3 id="sec-4.3.8"> Executing a script file </h3>
<div class="outline-text-4" id="text-4.3.8">

<p>Execute a read script file.
</p>
<ul>
<li>
Subcommand
<table class="table-dl-connector"  border="0" cellspacing="0" cellpadding="6" rules="none" frame="box" >
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<tbody>
<tr><td>load</td><td>[Script file name]</td></tr>
</tbody>
</table>


</li>
<li>
Description of each argument
<table class="table-dl-connector"  border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<thead>
<tr><th scope="col">Argument</th><th scope="col">Description</th></tr>
</thead>
<tbody>
<tr><td>Script file name</td><td>Specify the script file to execute.</td></tr>
<tr><td></td><td>If the script file is not specified, the .gsshrc file in the gsadm user home directory will be imported again.</td></tr>
</tbody>
</table>


</li>
<li>
Example:



<pre class="example">//execute script file
gs> load test.gsh
</pre>





</li>
</ul>

<p><b>[Memo]</b>
</p><ul>
<li>
Extension of script file is gsh.
</li>
<li>
A script file is described using the character code UTF-8.
</li>
</ul>

<p>　
</p>
</div>
</div>

</div>

<div id="outline-container-4.4" class="outline-3">
<h3 id="sec-1.3"> GridDB cluster operation controls </h3>
<div class="outline-text-3" id="text-4.4">


<p>
The following operations can be executed by the administrator user only as functions to manage GridDB cluster operations.
</p><ul>
<li>
GridDB node start, stop, join cluster, leave cluster (startnode/stopnode/joincluster/leavecluster)
</li>
<li>
GridDB cluster operation start, operation stop (startcluster/stopcluster)
</li>
<li>
Increase the number of new nodes in a GridDB cluster (appendcluster)
</li>
<li>
Get various data


</li>
</ul>

</div>

<div id="outline-container-4.4.1" class="outline-4">
<h3 id="sec-4.4.1"> Cluster status </h3>
<div class="outline-text-4" id="text-4.4.1">


<p>
This section explains the status of a GridDB node and GridDB cluster.
</p>
<p>
A cluster is composed of 1 or more nodes.<br/>
The node status represents the status of the node itself e.g. start or stop etc.<br/>
The cluster status represents the acceptance status of data operations from a client. Cluster statuses are determined according to the status of the node group constituting the cluster.
</p>

<p>
An example of the change in the node status and cluster status due to a gs_sh subcommand operation is shown below.<br/>
A cluster is composed of 4 nodes.<br/>
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”.
</p>

<div class="figure">
<p><img class="center" src="img/statusSample.png" width="700" alt="Status example" /></p>
<p>Status example</p>
</div>


<p>
<br/>
A detailed explanation of the node status and cluster status is given below.<br/>
</p>

<ul>
<li>
Node status
</li>
</ul>

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

<div class="figure">
<p><img class="center" src="img/nodeStatus.png" width="650" alt="Node status" /></p>
<p>Node status</p>
</div>


<table class="table-dl-connector"  border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<caption></caption>
<colgroup><col align="left" /><col align="left" /><col align="left" />
</colgroup>
<thead>
<tr><th scope="col">Status</th><th scope="col">Status name</th><th scope="col">Description</th></tr>
</thead>
<tbody>
<tr><td>Join</td><td>SERVICING</td><td>Node is joined to the cluster, and the status of the joined cluster is “In Operation”</td></tr>
<tr><td></td><td>WAIT</td><td>Node is joined to the cluster, and the status of the joined cluster is “Halted”</td></tr>
<tr><td>Start</td><td>STARTED</td><td>Node is started but has not joined a cluster</td></tr>
<tr><td></td><td>STARTING</td><td>Starting node</td></tr>
<tr><td>Stop</td><td>STOP</td><td>Stop node</td></tr>
<tr><td></td><td>STOPPING</td><td>Stopping node</td></tr>
</tbody>
</table>

　


<ul>
<li>
Cluster status

<p>
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”.
</p>

<div class="figure">
<p><img class="center" src="img/clusterStatus.png" width="500" alt="Cluster status" /></p>
<p>Cluster status</p>
</div>


<table class="table-dl-connector"  border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<caption></caption>
<colgroup><col align="left" /><col align="left" /><col align="left" />
</colgroup>
<thead>
<tr><th scope="col">Status</th><th scope="col">Status name</th><th scope="col">Description</th></tr>
</thead>
<tbody>
<tr><td>Operation</td><td>SERVICE_STABLE</td><td>All nodes defined in the cluster configuration have joined the cluster</td></tr>
<tr><td></td><td>SERVICE_UNSTABLE</td><td>More than half the nodes defined in the cluster configuration have joined the cluster</td></tr>
<tr><td>Halted</td><td>WAIT</td><td>More than half the nodes defined in the cluster configuration have left the cluster</td></tr>
<tr><td></td><td>INIT_WAIT</td><td>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)</td></tr>
<tr><td>Stop</td><td>STOP</td><td>All nodes defined in the cluster configuration have left the cluster</td></tr>
</tbody>
</table>



<p>
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 more than half the nodes have left the cluster, and “Stop” when all the nodes have left the cluster.
</p>
<p>
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.
</p>
<table class="table-dl-connector"  border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<caption></caption>
<colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" />
</colgroup>
<thead>
<tr><th scope="col"></th><th scope="col"></th><th scope="col">When all nodes are subject to the operation</th><th scope="col">When the operating target is a single node</th></tr>
</thead>
<tbody>
<tr><td>Operation</td><td>Join</td><td><a href="#*GridDBクラスタへノード一括参加">startcluster</a> Batch entry of a group of nodes that are already operating but have not joined the cluster yet.</td><td><a href="#*GridDBクラスタへノード参加">joincluster</a> Entry by a node that is in operation but has not joined the cluster yet.</td></tr>
<tr><td></td><td>Left</td><td><a href="#*GridDBクラスタからノード一括離脱">stopcluster</a> Batch detachment of a group of nodes attached to a cluster.</td><td><a href="#*GridDBクラスタからノード離脱">leavecluster</a> Detachment of a node attached to a cluster.</td></tr>
</tbody>
</table>



</li>
</ul>

<p><b>[Memo]</b>
</p><ul>
<li>
Join and leave cluster operations can be carried out on nodes that are in operation only.
</li>
<li>
A node which has failed will be detached automatically from the GridDB cluster.
</li>
<li>
The GridDB cluster status can be checked with the cluster status data display subcommand (<a href="#sec-4.4.9">configcluster</a>).
</li>
</ul>

<p>　
</p>

<p>
Details of the various operating methods are explained below.　
</p>
</div>

</div>

<div id="outline-container-4.4.2" class="outline-4">
<h3 id="sec-4.4.2"> Starting a node </h3>
<div class="outline-text-4" id="text-4.4.2">

<p>Explanation on how to start a node is shown below.
</p>
<ul>
<li>
Sub-command
<table class="table-dl-connector"  border="0" cellspacing="0" cellpadding="6" rules="none" frame="box" >
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<tbody>
<tr><td>startnode</td><td>node variable｜cluster variable [timeout time in sec]</td></tr>
</tbody>
</table>


</li>
<li>
Description of each argument
<table class="table-dl-connector"  border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<thead>
<tr><th scope="col">Argument</th><th scope="col">Description</th></tr>
</thead>
<tbody>
<tr><td>Node variable｜cluster variable</td><td>Specify the node to start by its node variable or cluster variable.</td></tr>
<tr><td></td><td>If the cluster variable is specified, all nodes defined in the cluster variable will be started.</td></tr>
<tr><td>Timeout time in sec.</td><td>Specify the wait time after node start-up is completed.</td></tr>
<tr><td></td><td>Immediate recovery if -1 is specified. Wait with no time limit if nothing is specified, or 0 is specified.</td></tr>
</tbody>
</table>


</li>
<li>
Example:



<pre class="example">// start node
gs> startnode $node1
Node  Start node 1.
All nodes have been started.
</pre>





</li>
</ul>

<p><b>[Memo]</b>
</p><ul>
<li>
Command can be executed by an administrator user only.
</li>
<li>
Append "$" in front of the variable name when using a variable.
</li>
<li>
The cluster start process (startcluster subcommand) can be executed in batches by waiting for the start process to complete.
</li>
</ul>

<p>　
</p>
</div>

</div>

<div id="outline-container-4.4.3" class="outline-4">
<h3 id="sec-4.4.3">Stopping a node </h3>
<div class="outline-text-4" id="text-4.4.3">

<p>Explanation on how to stop a node is shown below.
</p>
<ul>
<li>
Sub-command
<table class="table-dl-connector"  border="0" cellspacing="0" cellpadding="6" rules="none" frame="box" >
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<tbody>
<tr><td>stopnode</td><td>Node｜cluster variable [Timeout time in sec.]</td></tr>
</tbody>
</table>


</li>
<li>
Description of each argument
<table class="table-dl-connector"  border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<thead>
<tr><th scope="col">Argument</th><th scope="col">Description</th></tr>
</thead>
<tbody>
<tr><td>node｜cluster variable</td><td>Specify the node to stop by its node variable or cluster variable.</td></tr>
<tr><td></td><td>If the cluster variable is specified, all nodes defined in the cluster variable will be stopped.</td></tr>
<tr><td>Timeout time in sec.</td><td>Specify the wait time after node start-up is completed.</td></tr>
<tr><td></td><td>Immediate recovery if -1 is specified. Wait with no time limit if nothing is specified, or 0 is specified.</td></tr>
</tbody>
</table>


</li>
<li>
Example:



<pre class="example">// stop node
gs> stopnode $node1
Node Stop Node 1.
Node 1 has started the stop process.
Waiting for the node stop process to end.
All nodes have been stopped.
</pre>





</li>
</ul>

<p>In addition, a specified node can be forced to stop as well.
</p><ul>
<li>
Sub-command
<table class="table-dl-connector"  border="0" cellspacing="0" cellpadding="6" rules="none" frame="box" >
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<tbody>
<tr><td>stopnodeforce</td><td>Node｜cluster variable [Timeout time in sec.]</td></tr>
</tbody>
</table>


</li>
<li>
Description of each argument
<table class="table-dl-connector"  border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<thead>
<tr><th scope="col">Argument</th><th scope="col">Description</th></tr>
</thead>
<tbody>
<tr><td>node｜cluster variable</td><td>Specify the node to stop by force by its node variable or cluster variable.</td></tr>
<tr><td></td><td>If the cluster variable is specified, all nodes defined in the cluster variable will be stopped by force.</td></tr>
<tr><td>Timeout time in sec.</td><td>Specify the wait time after node start-up is completed.</td></tr>
<tr><td></td><td>Immediate recovery if -1 is specified. Wait with no time limit if nothing is specified, or 0 is specified.</td></tr>
</tbody>
</table>


</li>
<li>
Example:



<pre class="example">// stop node by force
gs> stopnodeforce $node1
Node Stop Node 1.
Node 1 has started the stop process.
Waiting for the node stop process to end.
All nodes have been stopped.
</pre>





</li>
</ul>

<p><b>[Memo]</b>
</p><ul>
<li>
Command can be executed by an administrator user only.
</li>
<li>
Append "$" in front of the variable name when using a variable.
</li>
<li>
In a stopnode sub-command, nodes which have joined the GridDB cluster cannot be stopped. In a stopnodeforce command, nodes which have joined the GridDB cluster can also be stopped but data may be lost.
</li>
</ul>

<p>　
</p>
</div>

</div>

<div id="outline-container-4.4.4" class="outline-4">
<h3 id="sec-4.4.4"> Batch entry of nodes in a cluster </h3>
<div class="outline-text-4" id="text-4.4.4">

<p>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.
</p>
<ul>
<li>
Sub-command
<table class="table-dl-connector"  border="0" cellspacing="0" cellpadding="6" rules="none" frame="box" >
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<tbody>
<tr><td>startcluster</td><td>Cluster variable [Timeout time in sec.]</td></tr>
</tbody>
</table>


</li>
<li>
Description of each argument
<table class="table-dl-connector"  border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<thead>
<tr><th scope="col">Argument</th><th scope="col">Description</th></tr>
</thead>
<tbody>
<tr><td>Cluster variable</td><td>Specify a GridDB cluster by its cluster variable.</td></tr>
<tr><td>Timeout time in sec.</td><td>Specify the wait time after node start-up is completed.</td></tr>
<tr><td></td><td>Immediate recovery if -1 is specified. Wait with no time limit if nothing is specified, or 0 is specified.</td></tr>
</tbody>
</table>


</li>
<li>
Example:



<pre class="example">// start GridDB cluster
gs> startcluster $cluster1
Waiting for cluster to start.
Cluster has started.
</pre>





</li>
</ul>

<p><b>[Memo]</b>
</p><ul>
<li>
Command can be executed by an administrator user only.
</li>
<li>
Append "$" in front of the variable name when using a variable.
</li>
<li>
To change the status of a GridDB cluster from “Stop” to “In Operation”, all nodes must be allowed to join the cluster. Check beforehand that all nodes constituting the GridDB cluster are in operation.


</li>
</ul>
</div>

</div>

<div id="outline-container-4.4.5" class="outline-4">
<h3 id="sec-4.4.5"> Batch detachment of nodes from a cluster </h3>
<div class="outline-text-4" id="text-4.4.5">

<p>Explanation on how to perform batch detachment of nodes in the cluster is shown below. To stop a GridDB cluster, simply make the attached nodes leave the cluster using the stopluster command.
</p>
<ul>
<li>
Sub-command
<table class="table-dl-connector"  border="0" cellspacing="0" cellpadding="6" rules="none" frame="box" >
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<tbody>
<tr><td>stopcluster</td><td>Cluster variable [Timeout time in sec.]</td></tr>
</tbody>
</table>



</li>
<li>
Description of each argument
<table class="table-dl-connector"  border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<thead>
<tr><th scope="col">Argument</th><th scope="col">Description</th></tr>
</thead>
<tbody>
<tr><td>Cluster variable</td><td>Specify a GridDB cluster by its cluster variable.</td></tr>
</tbody>
<tbody>
<tr><td>Timeout time in sec.</td><td>Specify the wait time after node start-up is completed.</td></tr>
<tr><td></td><td>Immediate recovery if -1 is specified. Wait with no time limit if nothing is specified, or 0 is specified.</td></tr>
</tbody>
</table>


</li>
<li>
Example:



<pre class="example">// stop GridDB cluster
gs> stopcluster $cluster1
Waiting for a cluster to stop.
Cluster has stopped.
</pre>



</li>
</ul>

<p>　
</p>
<p>
<b>[Memo]</b>
</p><ul>
<li>
Command can be executed by an administrator user only.
</li>
<li>
Append "$" in front of the variable name when using a variable.
</li>
</ul>

<p>　
</p>

</div>

</div>

<div id="outline-container-4.4.6" class="outline-4">
<h3 id="sec-4.4.6"> Node entry in a cluster </h3>
<div class="outline-text-4" id="text-4.4.6">

<p>Explanation on how to attach a node into a cluster is shown below. Use the joincluster command to attach the node. 
</p>
<ul>
<li>
Sub-command
<table class="table-dl-connector"  border="0" cellspacing="0" cellpadding="6" rules="none" frame="box" >
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<tbody>
<tr><td>joincluster</td><td>Cluster variable node variable [Timeout time in sec.]</td></tr>
</tbody>
</table>


</li>
<li>
Description of each argument
<table class="table-dl-connector"  border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<thead>
<tr><th scope="col">Argument</th><th scope="col">Description</th></tr>
</thead>
<tbody>
<tr><td>Cluster variable</td><td>Specify a GridDB cluster by its cluster variable.</td></tr>
<tr><td>Node variable</td><td>Specify the node to join with the node variable.</td></tr>
<tr><td>Timeout time in sec.</td><td>Specify the wait time after node start-up is completed.</td></tr>
<tr><td></td><td>Immediate recovery if -1 is specified. Wait with no time limit if nothing is specified, or 0 is specified.</td></tr>
</tbody>
</table>


</li>
<li>
Example:



<pre class="example">// start node
gs> startnode $node2
Node  Start node 2.
All nodes have been started.
// join node
joincluster $cluster1 $node2
Waiting for a node to be joined to a cluster.
Node has joined the cluster.
</pre>





</li>
</ul>

<p><b>[Memo]</b>
</p><ul>
<li>
Command can be executed by an administrator user only.
</li>
<li>
Append "$" in front of the variable name when using a variable.
</li>
<li>
Only nodes that are in operation can join a GridDB cluster. Check that the nodes joining a cluster are in operation.
</li>
<li>
Use the appendcluster sub-command when adding a node that is not yet defined in the cluster’s configuration to the cluster (the node is not part of the cluster).
</li>
</ul>

<p>　
</p>
</div>

</div>

<div id="outline-container-4.4.7" class="outline-4">
<h3 id="sec-4.4.7"> Detaching a node from a cluster </h3>
<div class="outline-text-4" id="text-4.4.7">

<p>Explanation on how to remove a node from a cluster is shown below. Use the leavecluster or leavecluster force command to detach the node. 
</p>
<ul>
<li>
Sub-command
<table class="table-dl-connector"  border="0" cellspacing="0" cellpadding="6" rules="none" frame="box" >
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<tbody>
<tr><td>leavecluster</td><td>Node variable [Timeout time in sec.]</td></tr>
<tr><td>leaveclusterforce</td><td>Node variable [Timeout time in sec.]</td></tr>
</tbody>
</table>


</li>
<li>
Description of each argument
<table class="table-dl-connector"  border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<thead>
<tr><th scope="col">Argument</th><th scope="col">Description</th></tr>
</thead>
<tbody>
<tr><td>Node variable</td><td>Specify the node to detach with the node variable.</td></tr>
<tr><td>Timeout time in sec.</td><td>Specify the wait time after node start-up is completed.</td></tr>
<tr><td></td><td>Immediate recovery if -1 is specified. Wait with no time limit if nothing is specified, or 0 is specified.</td></tr>
</tbody>
</table>


</li>
<li>
Example:



<pre class="example">// leave node
gs> leavecluster $node2
Waiting for node to separate from cluster
Node has separated from cluster.
</pre>





</li>
</ul>

<p><b>[Memo]</b>
</p><ul>
<li>
Command can be executed by an administrator user only.
</li>
<li>
Append "$" in front of the variable name when using a variable.
</li>
<li>
A node can safely leave a GridDB cluster only when the data has been duplicated in other nodes. However, a leavecluster subcommand forces a node to leave regardless of whether the data has been duplicated or not and so there is always a risk of data loss. Use the gs_leavecluster command to detach a node. See the section on “System Design &amp; Construction - Designing Tuning Parameters” in the “GridDB Quick Start Guide” (<a href="GridDB_QuickStartGuide.html">GridDB_QuickStartGuide.html</a>) for details regarding data duplication.
</li>
<li>
A leaveclusterforce command forces a node to leave a cluster even if there is a risk that data may be lost due to the detachment.



</li>
</ul>
</div>

</div>

<div id="outline-container-4.4.8" class="outline-4">
<h3 id="sec-4.4.8">Adding a note to a cluster </h3>
<div class="outline-text-4" id="text-4.4.8">

<p>Explanation on how to append a node to a pre-defined cluster is shown below. Use the appendcluster command to add the node.
</p>
<ul>
<li>
Sub-command
<table class="table-dl-connector"  border="0" cellspacing="0" cellpadding="6" rules="none" frame="box" >
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<tbody>
<tr><td>appendcluster</td><td>Cluster variable node variable [Timeout time in sec.]</td></tr>
</tbody>
</table>


</li>
<li>
Description of each argument
<table class="table-dl-connector"  border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<thead>
<tr><th scope="col">Argument</th><th scope="col">Description</th></tr>
</thead>
<tbody>
<tr><td>Cluster variable</td><td>Specify a GridDB cluster by its cluster variable.</td></tr>
<tr><td>Node variable</td><td>Specify the node to join with the node variable.</td></tr>
<tr><td>Timeout time in sec.</td><td>Specify the wait time after node start-up is completed.</td></tr>
<tr><td></td><td>Immediate recovery if -1 is specified. Wait with no time limit if nothing is specified, or 0 is specified.</td></tr>
</tbody>
</table>


</li>
<li>
Example:



<pre class="example">// define node
gs> setnode node5 192.168.0.5 10044
// start node
gs> startnode $node5
// increase no. of nodes
gs> appendcluster $cluster1 $node5
Waiting for a node to be added to a cluster.
A node has been added to the cluster.
Add node variables$ node5 to cluster variable $cluster1. (Execute a save command when saving changes to a variable. )

Cluster[name=name1,239.0.5.111:33333,nodes=($node1,$node2,$node3,$node4,$node5)]
</pre>




</li>
</ul>

<p><b>[Memo]</b>
</p><ul>
<li>
Command can be executed by an administrator user only.
</li>
<li>
Append "$" in front of the variable name when using a variable.
</li>
<li>
To increase the number of new nodes, all nodes that constitute a GridDB cluster needs to join the cluster. If there is any node detached from the GridDB cluster, re-attach the nodes first. In addition, check that the new node to be added is in operation.
</li>
<li>
When executing an appendcluster subcommand, the node variable to be added is added to the cluster variable automatically. There is no need to manually change the cluster variable definition.
</li>
<li>
If a variable is changed, execute a save command to save the data. Unsaved contents will be discarded.
</li>
<li>
See the chapter on “System Design &amp; Construction” in the “GridDB Quick Start Guide” (<a href="GridDB_QuickStartGuide.html">GridDB_QuickStartGuide.html</a>) for details on how to set up a new node.

</li>
</ul>
</div>

</div>

<div id="outline-container-4.4.9" class="outline-4">
<h3 id="sec-4.4.9"> Displaying cluster status data </h3>
<div class="outline-text-4" id="text-4.4.9">

<p>The following command displays the status of a GridDB cluster and each node constituting the cluster.
</p>
<ul>
<li>
Sub-command
<table class="table-dl-connector"  border="0" cellspacing="0" cellpadding="6" rules="none" frame="box" >
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<tbody>
<tr><td>configcluster</td><td>Cluster variable</td></tr>
</tbody>
</table>


</li>
<li>
Description of each argument
<table class="table-dl-connector"  border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<thead>
<tr><th scope="col">Argument</th><th scope="col">Description</th></tr>
</thead>
<tbody>
<tr><td>Cluster variable</td><td>Specify a GridDB cluster by its cluster variable.</td></tr>
</tbody>
</table>


</li>
<li>
Example:



<pre class="example">// display cluster data
gs> configcluster $cluster1
Name                  : cluster1
ClusterName           : defaultCluster
Designated Node Count : 4
Active Node Count     : 4
ClusterStatus         : SERVICE_STABLE

Nodes:
Name    Role Host:Port              Status
-------------------------------------------------
node1     F  10.45.237.151:10040    SERVICING 
node2     F  10.45.237.152:10040    SERVICING 
node3     M  10.45.237.153:10040    SERVICING 
node4     F  10.45.237.154:10040    SERVICING
</pre>




</li>
</ul>

<p><b>[Memo]</b>
</p><ul>
<li>
Command can be executed by an administrator user only.
</li>
<li>
ClusterStatus will be one of the following.
<ul>
<li>
INIT_WAIT: Waiting for cluster to be composed
</li>
<li>
SERVICE_STABLE: In operation
</li>
<li>
SERVICE_UNSTABLE: Halted (specified number of nodes constituting a cluster has not been reached)

</li>
</ul>
</li>
<li>
Role will be one of the following.
<ul>
<li>
M: MASTER (master)
</li>
<li>
F: FOLLOWER (follower)
</li>
<li>
S: SUB_CLUSTER (temporary status in a potential master candidate)
</li>
<li>
-: Not in operation


</li>
</ul>
</li>
</ul>
</div>

</div>

<div id="outline-container-4.4.10" class="outline-4">
<h3 id="sec-4.4.10"> Display of configuration data </h3>
<div class="outline-text-4" id="text-4.4.10">

<p>The following command displays the GridDB cluster configuration data.
</p>
<ul>
<li>
Sub-command
<table class="table-dl-connector"  border="0" cellspacing="0" cellpadding="6" rules="none" frame="box" >
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<tbody>
<tr><td>config</td><td>Node variable</td></tr>
</tbody>
</table>


</li>
<li>
Description of each argument
<table class="table-dl-connector"  border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<thead>
<tr><th scope="col">Argument</th><th scope="col">Description</th></tr>
</thead>
<tbody>
<tr><td>Node variable</td><td>Specify the node belonging to a GridDB cluster to be displayed with a node variable.</td></tr>
</tbody>
</table>


</li>
<li>
Example:



<pre class="example">// display cluster configuration data
gs> config $node1
{
"follower" : [ {
	"address" : "10.45.237.151",
	"port" : 10040
}, {
	"address" : "10.45.237.152",
	"port" : 10040
}, {
	"address" : "10.45.237.153",
	"port" : 10040
}, {
	"address" : "10.45.237.154",
	"port" : 10040
} ],
"master" : {
	"address" : "10.45.237.155",
	"port" : 10040
},
"multicast" : {
	"address" : "239.0.5.111",
	"port" : 33333
},
"self" : {
	"address" : "10.45.237.150",
	"port" : 10040,
	"status" : "ACTIVE"
}
}
</pre>



</li>
</ul>

<p>　
</p>
<p>
<b>[Memo]</b>
</p><ul>
<li>
Command can be executed by an administrator user only.
</li>
<li>
Append "$" in front of the variable name when using a variable.
</li>
<li>
The output contents differ depending on the version of the GridDB node. Check with the support desk for details. 
</li>
</ul>

<p>　
</p>
</div>

</div>

<div id="outline-container-4.4.11" class="outline-4">
<h3 id="sec-4.4.11"> Status display </h3>
<div class="outline-text-4" id="text-4.4.11">

<p>The following command displays the status of the specified node and the statistical data.
</p>
<ul>
<li>
Sub-command
<table class="table-dl-connector"  border="0" cellspacing="0" cellpadding="6" rules="none" frame="box" >
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<tbody>
<tr><td>stat</td><td>Node variable</td></tr>
</tbody>
</table>


</li>
<li>
Description of each argument
<table class="table-dl-connector"  border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<thead>
<tr><th scope="col">Argument</th><th scope="col">Description</th></tr>
</thead>
<tbody>
<tr><td>Node variable</td><td>Specify the node to display by its node variable.</td></tr>
</tbody>
</table>


</li>
<li>
Example:



<pre class="example">// display node status, statistical data
gs> stat $node1
{
"checkpoint" : {
	"archiveLog" : 0,
	"backupOperation" : 0,
	"duplicateLog" : 0,
	"endTime" : 1413852025843,
	"mode" : "NORMAL_CHECKPOINT",
			:
			:
}
</pre>





</li>
</ul>

<p><b>[Memo]</b>
</p><ul>
<li>
Command can be executed by an administrator user only.
</li>
<li>
Append "$" in front of the variable name when using a variable.
</li>
<li>
The output contents differ depending on the version of the GridDB node.


</li>
</ul>
</div>

</div>

<div id="outline-container-4.4.12" class="outline-4">
<h3 id="sec-4.4.12">Log display </h3>
<div class="outline-text-4" id="text-4.4.12">

<p>The following command displays the log of the specified node.
</p>
<ul>
<li>
Sub-command
<table class="table-dl-connector"  border="0" cellspacing="0" cellpadding="6" rules="none" frame="box" >
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<tbody>
<tr><td>logs</td><td>Node variable</td></tr>
</tbody>
</table>


</li>
<li>
Description of each argument
<table class="table-dl-connector"  border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<thead>
<tr><th scope="col">Argument</th><th scope="col">Description</th></tr>
</thead>
<tbody>
<tr><td>Node variable</td><td>Specify the node to display by its node variable.</td></tr>
</tbody>
</table>


</li>
<li>
Example:



<pre class="example">// display log of node
gs> logs $node0
2013-02-26T13:45:58.613+0900 c63x64n1 4051 INFO SYSTEM_SERVICE ../server/system_service.cpp void SystemService::joinCluster(const char8_t*, uint32_t) line=179 : joinCluster requested (clusterName="defaultCluster", minNodeNum=1) 
2013-02-26T13:45:58.616+0900 c63x64n1 4050 INFO SYSTEM_SERVICE ../server/system_service.cpp virtual void SystemService::JoinClusterHandler::callback(EventEngine&amp;, util::StackAllocator&amp;, Event*, NodeDescriptor) line=813 : ShutdownClusterHandler called g
2013-02-26T13:45:58.617+0900 c63x64n1 4050 INFO SYSTEM_SERVICE ../server/system_service.cpp void SystemService::completeClusterJoin() line=639 : completeClusterJoin requested 
2013-02-26T13:45:58.617+0900 c63x64n1 4050 INFO SYSTEM_SERVICE ../server/system_service.cpp virtual void SystemService::CompleteClusterJoinHandler::callback(EventEngine&amp;, util::StackAllocator&amp;, Event*, NodeDescriptor) line=929 : CompleteClusterJoinHandler called
</pre>



</li>
</ul>

<p>　
</p>
<p>
In addition, the log output level can be displayed and changed.
</p><table class="table-dl-connector"  border="0" cellspacing="0" cellpadding="6" rules="none" frame="box">
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<tbody>
<tr><td>logconf</td><td>Node variable [category name [log level]]</td></tr>
</tbody>
</table>


<ul>
<li>
Description of each argument
<table class="table-dl-connector"  border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<thead>
<tr><th scope="col">Argument</th><th scope="col">Description</th></tr>
</thead>
<tbody>
<tr><td>Node variable</td><td>Specify the node to operate by its node variable.</td></tr>
</tbody>
<tbody>
<tr><td>Category name</td><td>Specify the log category name subject to the operation. Output level of all log categories will be <span style="text-decoration:underline;">displayed</span> by default.</td></tr>
</tbody>
<tbody>
<tr><td>Log level</td><td>Specify the log level to <span style="text-decoration:underline;">change</span> the log level of the specified category.</td></tr>
<tr><td></td><td>Log level of the specified category <span style="text-decoration:underline;">will be displayed</span> by default.</td></tr>
</tbody>
</table>


</li>
<li>
Example:



<pre class="example">// display log level of node
gs> logconf $node0
{
"CHECKPOINT_SERVICE" : "INFO",
"CHUNK_MANAGER" : "ERROR",
"CLUSTER_OPERATION" : "INFO",
"CLUSTER_SERVICE" : "ERROR",
"COLLECTION" : "ERROR",
"DATA_STORE" : "ERROR",
"EVENT_ENGINE" : "WARNING",
"HASH_MAP" : "ERROR",
"IO_MONITOR" : "WARNING",
"LOG_MANAGER" : "WARNING",
"MAIN" : "ERROR",
"OBJECT_MANAGER" : "INFO",
"RECOVERY_MANAGER" : "INFO",
"REPLICATION" : "WARNING",
"REPLICATION_TIMEOUT" : "WARNING",
"SESSION_TIMEOUT" : "WARNING",
"SYNC_SERVICE" : "ERROR",
"SYSTEM_SERVICE" : "INFO",
"TIME_SERIES" : "ERROR",
"TRANSACTION_MANAGER" : "ERROR",
"TRANSACTION_SERVICE" : "ERROR",
"TRANSACTION_TIMEOUT" : "WARNING",
"TRIGGER_SERVICE" : "ERROR"
}
</pre>




</li>
</ul>

<p><b>[Memo]</b>
</p><ul>
<li>
Command can be executed by an administrator user only.
</li>
<li>
Log levels are ERROR, WARNING, INFO, and DEBUG. Be sure to follow the instructions of the support desk when changing the log level.
</li>
<li>
Log level is initialized by restarting the node. Changes to the log level are not saved.
</li>
<li>
Batch changes cannot be made to the log level of multiple categories.
</li>
<li>
The output contents differ depending on the version of the GridDB node. Check with the support desk for details. 


</li>
</ul>
</div>
</div>

</div>

<div id="outline-container-4.5" class="outline-3">
<h3 id="sec-1.4"> Data Operation in a Database </h3>
<div class="outline-text-3" id="text-4.5">


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


</div>

<div id="outline-container-4.5.1" class="outline-4">
<h3 id="sec-4.5.1"> Connecting to a Cluster </h3>
<div class="outline-text-4" id="text-4.5.1">

<p>The following command establishes connection to a GridDB cluster to execute a data operation.
</p>
<ul>
<li>
Sub-command
<table class="table-dl-connector"  border="0" cellspacing="0" cellpadding="6" rules="none" frame="box" >
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<tbody>
<tr><td>connect</td><td>Cluster variable [database name]</td></tr>
</tbody>
</table>


</li>
<li>
Description of each argument
<table class="table-dl-connector"  border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<thead>
<tr><th scope="col">Argument</th><th scope="col">Description</th></tr>
</thead>
<tbody>
<tr><td>Cluster variable</td><td>Specify a GridDB cluster serving as the connection destination by its cluster variable.</td></tr>
</tbody>
<tbody>
<tr><td>Database name</td><td>Specify the database name.</td></tr>
</tbody>
</table>


</li>
<li>
Example:



<pre class="example">// connect to GridDB cluster
// for NoSQL
gs> connect $cluster1
Connection successful (NoSQL).
gs[public]> 

gs> connect $cluster1 userDB
Connection successful (NoSQL).
gs[userDB]> 

// for NewSQL (configure both NoSQL/NewSQL interfaces)
gs> connect $cluster1
Connection successful (NoSQL).
Connection successful (NewSQL).
gs[public]> 


</pre>




</li>
</ul>

<p><b>[Memo]</b>
</p><ul>
<li>
Connect to the database when the database name is specified. Connect to the “public” database if the database name is omitted.
</li>
<li>
If the connection is successful, the connection destination database name appears in the prompt.
</li>
<li>
Append "$" in front of the variable name when using a variable.
</li>
<li>
When executing a data operation subcommand, it is necessary to connect to a GridDB cluster.
</li>
<li>
If the SQL connection destination is specified (execution of setclustersql sub-command), SQL connection is also carried out.


</li>
</ul>
</div>

</div>

<div id="outline-container-4.5.2" class="outline-4">
<h3 id="sec-4.5.2"> Search (TQL) </h3>
<div class="outline-text-4" id="text-4.5.2">

<p>The following command will execute a search and retain the search results.
</p>
<ul>
<li>
Sub-command
<table class="table-dl-connector"  border="0" cellspacing="0" cellpadding="6" rules="none" frame="box" >
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<tbody>
<tr><td>tql</td><td>Container name query;</td></tr>
</tbody>
</table>


</li>
<li>
Description of each argument
<table class="table-dl-connector"  border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<thead>
<tr><th scope="col">Argument</th><th scope="col">Description</th></tr>
</thead>
<tbody>
<tr><td>Container name</td><td>Specify the container subject to the search.</td></tr>
</tbody>
<tbody>
<tr><td>Query;</td><td>Specify the TQL command to execute. A semicolon (;) is required at the end of a TQL command.</td></tr>
</tbody>
</table>


</li>
<li>
Example:



<pre class="example">// execute search
gs[public]> tql c001 select *;
5 hits located.
</pre>




</li>
</ul>

<p><b>[Memo]</b>
</p><ul>
<li>
When executing a data operation subcommand, it is necessary to connect to a GridDB cluster.
</li>
<li>
A return can be inserted in the middle of a TQL command.
</li>
<li>
Retain the latest search result. Search results are discarded when a tql or sql subcommand is executed.
</li>
<li>
See the chapter on “TQL Syntax &amp; Operating Functions” in the “GridDB API Reference” (<a href="GridDB_API_Reference.html">GridDB_API_Reference.html</a>) for the TQL details.
</li>
</ul>

<p>　
</p>

</div>

</div>

<div id="outline-container-4.5.3" class="outline-4">
<h3 id="sec-4.5.3">SQL Command Execution </h3>
<div class="outline-text-4" id="text-4.5.3">

<p>The following command executes an SQL command and retains the search result. <span style="text-decoration:underline;">This function can be executed in the GridDB Advanced Edition only. </span>
</p>
<ul>
<li>
Sub-command
<table class="table-dl-connector"  border="0" cellspacing="0" cellpadding="6" rules="none" frame="box" >
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<tbody>
<tr><td>sql</td><td>SQL command;</td></tr>
</tbody>
</table>


</li>
<li>
Description of each argument
<table class="table-dl-connector"  border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<thead>
<tr><th scope="col">Argument</th><th scope="col">Description</th></tr>
</thead>
<tbody>
<tr><td>SQL command;</td><td>Specify the SQL command to execute. A semicolon (;) is required at the end of the SQL command.</td></tr>
</tbody>
</table>


</li>
<li>
Example:



<pre class="example">gs[public]> sql select * from con1; → search for SQL
10,000 hits located.
gs[public]> get 1 → display SQL results
id,name
----------------------
0,tanaka


</pre>




</li>
</ul>

<p><b>[Memo]</b>
</p><ul>
<li>
Can be executed in the GridDB Advanced Edition only.
</li>
<li>
Before executing a sql command, there is a need to specify the SQL connection destination and perform a connection first.
</li>
<li>
Retain the latest search result. Search results are discarded when a sql or tql sub-command is executed.
</li>
<li>
The following results will appear depending on the type of SQL command.
<table class="table-dl-connector"  border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<thead>
<tr><th scope="col">Process</th><th scope="col">Execution results when terminated normally</th></tr>
</thead>
<tbody>
<tr><td>Search SELECT</td><td>Display the no. of search results found. Search results are displayed in sub-command get/getcsv/getnoprint.</td></tr>
</tbody>
<tbody>
<tr><td>Update INSERT/UPDATE/DELETE</td><td>Display the no. of rows updated.</td></tr>
</tbody>
<tbody>
<tr><td>DDL text</td><td>Nothing is displayed.</td></tr>
</tbody>
</table>


</li>
<li>
See “GridDB API Reference” (<a href="GridDB_API_Reference.html">GridDB_API_Reference.html</a>) for the SQL details.
</li>
</ul>

<p>　
</p>


</div>

</div>

<div id="outline-container-4.5.4" class="outline-4">
<h3 id="sec-4.5.4"> Getting Search Results </h3>
<div class="outline-text-4" id="text-4.5.4">

<p>The following command gets the inquiry results and presents them in different formats. There are 3 ways to output the results as listed below.
</p>
<p>
(A) Display the results obtained in a standard output.
</p>
<ul>
<li>
Sub-command
<table class="table-dl-connector"  border="0" cellspacing="0" cellpadding="6" rules="none" frame="box" >
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<tbody>
<tr><td>get</td><td>[No. of cases acquired]</td></tr>
</tbody>
</table>


</li>
<li>
Description of each argument
<table class="table-dl-connector"  border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<thead>
<tr><th scope="col">Argument</th><th scope="col">Description</th></tr>
</thead>
<tbody>
<tr><td>No. of cases acquired</td><td>Specify the number of search results to be acquired. All search results will be obtained and displayed by default.</td></tr>
</tbody>
</table>


</li>
</ul>

<p>(B) Save the results obtained in a file in the CSV format.
</p>
<ul>
<li>
Sub-command
<table class="table-dl-connector"  border="0" cellspacing="0" cellpadding="6" rules="none" frame="box" >
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<tbody>
<tr><td>getcsv</td><td>CSV file name [No. of search results found]</td></tr>
</tbody>
</table>


</li>
<li>
Description of each argument
<table class="table-dl-connector"  border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<thead>
<tr><th scope="col">Argument</th><th scope="col">Description</th></tr>
</thead>
<tbody>
<tr><td>File name</td><td>Specify the name of the file where the search results are saved.</td></tr>
</tbody>
<tbody>
<tr><td>No. of cases acquired</td><td>Specify the number of search results to be acquired. All search results will be obtained and saved in the file by default.</td></tr>
</tbody>
</table>


</li>
</ul>

<p>Results obtained in (C) will not be output.
</p>
<ul>
<li>
Sub-command
<table class="table-dl-connector"  border="0" cellspacing="0" cellpadding="6" rules="none" frame="box" >
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<tbody>
<tr><td>getnoprint</td><td>[No. of cases acquired]</td></tr>
</tbody>
</table>


</li>
<li>
Description of each argument
<table class="table-dl-connector"  border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<thead>
<tr><th scope="col">Argument</th><th scope="col">Description</th></tr>
</thead>
<tbody>
<tr><td>No. of cases acquired</td><td>Specify the number of search results to be acquired. All search results will be obtained by default.</td></tr>
</tbody>
</table>


</li>
<li>
Example:



<pre class="example">// execute search
gs[public]> tql c001 select *;
5 hits located.

//Get first result and display
gs[public]> get 1
name,status,count
mie,true,2
Acquisition of one result completed.

//Get second and third results and save them in a file
gs[public]> getcsv /var/lib/gridstore/test2.csv 2
Acquisition of 2 results completed.

//Get fourth result
gs[public]> getnoprint 1
Acquisition of one result completed.

//Get fifth result and display
gs[public]> get 1
name,status,count
akita,true,45
Acquisition of one result completed.

</pre>




</li>
</ul>

<p><b>[Memo]</b>
</p><ul>
<li>
When executing a data operation subcommand, it is necessary to connect to a GridDB cluster.
</li>
<li>
Output the column name to the first row of the search results
</li>
<li>
An error will occur if the search results are obtained when a search has not been conducted, or after all search results have been obtained or discarded.


</li>
</ul>
</div>

</div>

<div id="outline-container-4.5.5" class="outline-4">
<h3 id="sec-4.5.5"> Getting the Execution Plan </h3>
<div class="outline-text-4" id="text-4.5.5">

<p>The following command displays the execution plan of the specified TQL command. Search is not executed.
</p>
<ul>
<li>
Sub-command
<table class="table-dl-connector"  border="0" cellspacing="0" cellpadding="6" rules="none" frame="box" >
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<tbody>
<tr><td>tqlexplain</td><td>Container name query;</td></tr>
</tbody>
</table>


</li>
<li>
Description of each argument
<table class="table-dl-connector"  border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<thead>
<tr><th scope="col">Argument</th><th scope="col">Description</th></tr>
</thead>
<tbody>
<tr><td>Container name</td><td>Specify the target container.</td></tr>
</tbody>
<tbody>
<tr><td>Query;</td><td>Specify the TQL command to get the execution plan. A semicolon (;) is required at the end of a TQL command.</td></tr>
</tbody>
</table>


</li>
<li>
Example:



<pre class="example">//Get execution plan
gs[public]> tqlexplain c001 select * ;
0       0       SELECTION       CONDITION       NULL
1       1       INDEX   BTREE   ROWMAP
2       0       QUERY_EXECUTE_RESULT_ROWS       INTEGER 0
</pre>




</li>
</ul>

<p>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.
</p>
<ul>
<li>
Sub-command
<table class="table-dl-connector"  border="0" cellspacing="0" cellpadding="6" rules="none" frame="box" >
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<tbody>
<tr><td>tqlanalyze</td><td>Container name query;</td></tr>
</tbody>
</table>


</li>
<li>
Description of each argument
<table class="table-dl-connector"  border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<thead>
<tr><th scope="col">Argument</th><th scope="col">Description</th></tr>
</thead>
<tbody>
<tr><td>Container name</td><td>Specify the target container.</td></tr>
</tbody>
<tbody>
<tr><td>Query;</td><td>Specify the TQL command to get the execution plan. A semicolon (;) is required at the end of a TQL command.</td></tr>
</tbody>
</table>


</li>
<li>
Example:



<pre class="example">// Execute search to get execution plan
gs[public]> tqlanalyze c001 select *;
0       0       SELECTION       CONDITION       NULL
1       1       INDEX   BTREE   ROWMAP
2       0       QUERY_EXECUTE_RESULT_ROWS       INTEGER 5
3       0       QUERY_RESULT_TYPE       STRING  RESULT_ROW_ID_SET
4       0       QUERY_RESULT_ROWS       INTEGER 5
</pre>




</li>
</ul>

<p><b>[Memo]</b>
</p><ul>
<li>
When executing a data operation sub-command, it is necessary to connect to a GridDB cluster. 
</li>
<li>
See the chapter on “TQL Syntax &amp; Operating Functions” in the “GridDB API Reference” (<a href="GridDB_API_Reference.html">GridDB_API_Reference.html</a>) for the detailed execution plan.
</li>
<li>
Since search results are not retained, search results cannot be acquired and thus there is also no need to execute a tqlclose subcommand. When the search results are required, execute a query with the tql subcommand.


</li>
</ul>
</div>

</div>

<div id="outline-container-4.5.6" class="outline-4">
<h3 id="sec-4.5.6"> Discarding Search Results </h3>
<div class="outline-text-4" id="text-4.5.6">

<p>Close the tql and discard the search results saved.
</p><ul>
<li>
Sub-command
<table class="table-dl-connector"  border="0" cellspacing="0" cellpadding="6" rules="none" frame="box" >
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<tbody>
<tr><td>tqlclose</td><td></td></tr>
</tbody>
</table>


</li>
</ul>

<p>Close query. Discard the search results retained. 。
</p><ul>
<li>
Sub-command
<table class="table-dl-connector"  border="0" cellspacing="0" cellpadding="6" rules="none" frame="box" >
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<tbody>
<tr><td>queryclose</td><td></td></tr>
</tbody>
</table>



</li>
<li>
Example:



<pre class="example">//Discard search results
gs[public]> tqlclose

gs[public]> queryclose
</pre>




</li>
</ul>

<p><b>[Memo]</b>
</p><ul>
<li>
Search results are discarded at the following timing.
<ul>
<li>
When a tqlclose or query close sub-command is executed
</li>
<li>
When executing a new search using a tql or sql sub-command
</li>
<li>
When disconnecting from a GridDB cluster using a disconnect sub-command
</li>
</ul>
</li>
<li>
An error will occur if search results are acquired (get sub-command, etc.) after they have been discarded.


</li>
</ul>
</div>

</div>

<div id="outline-container-4.5.7" class="outline-4">
<h3 id="sec-4.5.7"> Disconnecting from a Cluster </h3>
<div class="outline-text-4" id="text-4.5.7">

<p>The following command disconnect user from a GridDB cluster.
</p>
<ul>
<li>
Sub-command
<table class="table-dl-connector"  border="0" cellspacing="0" cellpadding="6" rules="none" frame="box" >
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<tbody>
<tr><td>disconnect</td><td></td></tr>
</tbody>
</table>


</li>
<li>
Example:



<pre class="example">//Disconnect from a GridDB cluster
gs[public]> disconnect
gs> 

</pre>




</li>
</ul>

<p><b>[Memo]</b>
</p><ul>
<li>
Retained search results are discarded.
</li>
<li>
When disconnected, the connection database name will disappear from the prompt.


</li>
</ul>
</div>
</div>

</div>

<div id="outline-container-4.6" class="outline-3">
<h3 id="sec-1.5"> Database Management </h3>
<div class="outline-text-3" id="text-4.6">

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


</div>

<div id="outline-container-4.6.1" class="outline-4">
<h3 id="sec-4.6.1"> Creating a Database </h3>
<div class="outline-text-4" id="text-4.6.1">

<p>The following command is used to create a database.
</p>
<ul>
<li>
Sub-command
<table class="table-dl-connector"  border="0" cellspacing="0" cellpadding="6" rules="none" frame="box" >
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<tbody>
<tr><td>createdatabase</td><td>Database name</td></tr>
</tbody>
</table>


</li>
<li>
Description of each argument
<table class="table-dl-connector"  border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<thead>
<tr><th scope="col">Argument</th><th scope="col">Description</th></tr>
</thead>
<tbody>
<tr><td>Database name</td><td>Specify the name of the database to be created.</td></tr>
</tbody>
</table>


</li>
<li>
Example:



<pre class="example">//Create a database with the name “db1”
gs[public]> createdatabase db1
</pre>




</li>
</ul>

<p><b>[Memo]</b>
</p><ul>
<li>
Command can be executed by an administrator user only.
</li>
<li>
Only the administrator user can access a database immediately after it has been created. Assign access rights to general users where necessary.

</li>
</ul>
</div>

</div>

<div id="outline-container-4.6.2" class="outline-4">
<h3 id="sec-4.6.2"> Deleting a Database </h3>
<div class="outline-text-4" id="text-4.6.2">

<p>The following command is used to delete a database.
</p>
<ul>
<li>
Sub-command
<table class="table-dl-connector"  border="0" cellspacing="0" cellpadding="6" rules="none" frame="box" >
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<tbody>
<tr><td>dropdatabase</td><td>Database name</td></tr>
</tbody>
</table>


</li>
<li>
Description of each argument
<table class="table-dl-connector"  border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<thead>
<tr><th scope="col">Argument</th><th scope="col">Description</th></tr>
</thead>
<tbody>
<tr><td>Database name</td><td>Specify the name of the database to be deleted.</td></tr>
</tbody>
</table>


</li>
<li>
Example:



<pre class="example">//Delete databases like those shown below
//db1: No container exists in the database
//db2: Database does not exist
//db3: Container exists in the database

gs[public]> dropdatabase db1　　　　　　　　　// normal termination
gs[public]> dropdatabase db2　　　　　　　　　// abnormal termination
D20340: Database "db2" does not exist.
gs[public]> dropdatabase db3　　　　　　　　　// abnormal termination
D20336: Error occurred in deleting the database : msg=[[145045:JC_DATABASE_NOT_EMPTY] Illegal target error by non-empty database.]
</pre>




</li>
</ul>

<p><b>[Memo]</b>
</p><ul>
<li>
Command can be executed by an administrator user only.
</li>
<li>
A public database which is a default connection destination cannot be deleted.

</li>
</ul>
</div>

</div>

<div id="outline-container-4.6.3" class="outline-4">
<h3 id="sec-4.6.3"> Current DB Display </h3>
<div class="outline-text-4" id="text-4.6.3">

<p>The following command is used to display the current database name.
</p>
<ul>
<li>
Sub-command
<table class="table-dl-connector"  border="0" cellspacing="0" cellpadding="6" rules="none" frame="box" >
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<tbody>
<tr><td>getcurrentdatabase</td><td>　</td></tr>
</tbody>
</table>


</li>
<li>
Example:



<pre class="example">gs[db1]> getcurrentdatabase
db1
</pre>





</li>
</ul>
</div>

</div>

<div id="outline-container-4.6.4" class="outline-4">
<h3 id="sec-4.6.4"> Database List </h3>
<div class="outline-text-4" id="text-4.6.4">

<p>The following command is used to display the database list and access rights data.
</p>
<ul>
<li>
Sub-command
<table class="table-dl-connector"  border="0" cellspacing="0" cellpadding="6" rules="none" frame="box" >
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<tbody>
<tr><td>showdatabase</td><td>[Database name]</td></tr>
</tbody>
</table>


</li>
<li>
Description of each argument
<table class="table-dl-connector"  border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<thead>
<tr><th scope="col">Argument</th><th scope="col">Description</th></tr>
</thead>
<tbody>
<tr><td>Database name</td><td>Specify the name of the database to be displayed.</td></tr>
</tbody>
</table>


</li>
<li>
Example:



<pre class="example">gs[public]> showdatabase
database     ACL
----------------------------
public       ALL_USER
db1          user1
db2          user1
db3          user3

gs[public]> showdatabase db1
database     ACL
----------------------------
public       ALL_USER
db1          user1
</pre>




</li>
</ul>

<p><b>[Memo]</b>
</p><ul>
<li>
For general users, only databases for which access rights have been assigned will be displayed. For administrator users, a list of all the databases will be displayed.

</li>
</ul>
</div>

</div>

<div id="outline-container-4.6.5" class="outline-4">
<h3 id="sec-4.6.5"> Assignment of Access Rights </h3>
<div class="outline-text-4" id="text-4.6.5">

<p>The following command is used to assign access rights to the database.
</p>
<ul>
<li>
Sub-command
<table class="table-dl-connector"  border="0" cellspacing="0" cellpadding="6" rules="none" frame="box" >
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<tbody>
<tr><td>grant</td><td>Database name  user name</td></tr>
</tbody>
</table>


</li>
<li>
Description of each argument
<table class="table-dl-connector"  border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<thead>
<tr><th scope="col">Argument</th><th scope="col">Description</th></tr>
</thead>
<tbody>
<tr><td>Database name</td><td>Specify the name of the database for which access rights are going to be assigned</td></tr>
</tbody>
<tbody>
<tr><td>User name</td><td>Specify the name of the user to assign access rights to.</td></tr>
</tbody>
</table>


</li>
<li>
Example:



<pre class="example">gs[public]> grant db1 user001
</pre>




</li>
</ul>

<p><b>[Memo]</b>
</p><ul>
<li>
Command can be executed by an administrator user only.
</li>
<li>
An error will occur if access rights have already been assigned (only 1 user can be assigned access rights to each database). Execute this command after revoking the access rights ("revoke" command).

</li>
</ul>
</div>

</div>

<div id="outline-container-4.6.6" class="outline-4">
<h3 id="sec-4.6.6">Revoking of Access Rights </h3>
<div class="outline-text-4" id="text-4.6.6">

<p>The following command is used to revoke access rights to the database.
</p>
<ul>
<li>
Sub-command
<table class="table-dl-connector"  border="0" cellspacing="0" cellpadding="6" rules="none" frame="box" >
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<tbody>
<tr><td>revoke</td><td>Database name  user name</td></tr>
</tbody>
</table>


</li>
<li>
Description of each argument
<table class="table-dl-connector"  border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<thead>
<tr><th scope="col">Argument</th><th scope="col">Description</th></tr>
</thead>
<tbody>
<tr><td>Database name</td><td>Specify the name of the database for which access rights are going to be revoked.</td></tr>
</tbody>
<tbody>
<tr><td>User name</td><td>Specify the name of the user whose access rights are going to be revoked.</td></tr>
</tbody>
</table>


</li>
<li>
Example:



<pre class="example">gs[public]> revoke db1 user001
</pre>




</li>
</ul>

<p><b>[Memo]</b>
</p><ul>
<li>
Command can be executed by an administrator user only.


</li>
</ul>
</div>
</div>

</div>

<div id="outline-container-4.7" class="outline-3">
<h3 id="sec-1.6"> User Management </h3>
<div class="outline-text-3" id="text-4.7">


<p>
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).
</p>

</div>

<div id="outline-container-4.7.1" class="outline-4">
<h3 id="sec-4.7.1">Creating a General User </h3>
<div class="outline-text-4" id="text-4.7.1">

<p>The following command is used to create a general user (username and password).
</p>
<ul>
<li>
Sub-command
<table class="table-dl-connector"  border="0" cellspacing="0" cellpadding="6" rules="none" frame="box" >
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<tbody>
<tr><td>createuser</td><td>User name  password</td></tr>
</tbody>
</table>


</li>
<li>
Description of each argument
<table class="table-dl-connector"  border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<thead>
<tr><th scope="col">Argument</th><th scope="col">Description</th></tr>
</thead>
<tbody>
<tr><td>User name</td><td>Specify the name of the user to be created.</td></tr>
</tbody>
<tbody>
<tr><td>Password</td><td>Specify the password of the user to be created.</td></tr>
</tbody>
</table>


</li>
<li>
Example:



<pre class="example">gs[public]> createuser user01 pass001
</pre>




</li>
</ul>

<p><b>[Memo]</b>
</p><ul>
<li>
Command can be executed by an administrator user only.
</li>
<li>
A name starting with "gs#" cannot be specified as the name of a general user as it is reserved for use by the administrator user.
</li>
<li>
When creating an administrator user, use the gs_adduser command in all the nodes constituting the cluster.

</li>
</ul>
</div>

</div>

<div id="outline-container-4.7.2" class="outline-4">
<h3 id="sec-4.7.2"> Deleting a General User </h3>
<div class="outline-text-4" id="text-4.7.2">

<p>The following command is used to delete a user.
</p>
<ul>
<li>
Sub-command
<table class="table-dl-connector"  border="0" cellspacing="0" cellpadding="6" rules="none" frame="box" >
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<tbody>
<tr><td>dropuser</td><td>User name</td></tr>
</tbody>
</table>


</li>
<li>
Description of each argument
<table class="table-dl-connector"  border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<thead>
<tr><th scope="col">Argument</th><th scope="col">Description</th></tr>
</thead>
<tbody>
<tr><td>User name</td><td>Specify the name of the user to be deleted.</td></tr>
</tbody>
</table>


</li>
<li>
Example:



<pre class="example">gs[public]> dropuer user01
</pre>




</li>
</ul>

<p><b>[Memo]</b>
</p><ul>
<li>
Command can be executed by an administrator user only.

</li>
</ul>
</div>

</div>

<div id="outline-container-4.7.3" class="outline-4">
<h3 id="sec-4.7.3"> Update Password </h3>
<div class="outline-text-4" id="text-4.7.3">

<p>The following command is used to update the user password.
</p>
<ul>
<li>
Sub-command
<table class="table-dl-connector"  border="0" cellspacing="0" cellpadding="6" rules="none" frame="box" >
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<tbody>
<tr><td>setpassword</td><td>　Password (general user only)</td></tr>
<tr><td>setpassword</td><td>　User name password (administrator user only)</td></tr>
</tbody>
</table>


</li>
<li>
Description of each argument
<table class="table-dl-connector"  border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<thead>
<tr><th scope="col">Argument</th><th scope="col">Description</th></tr>
</thead>
<tbody>
<tr><td>Password</td><td>Specify the password to change.</td></tr>
</tbody>
<tbody>
<tr><td>User name</td><td>Specify the name of the user whose password is going to be changed.</td></tr>
</tbody>
</table>


</li>
</ul>

<p><b>[Memo]</b>
</p><ul>
<li>
The general user can change its own password only.
</li>
<li>
An administrator user can change the passwords of other general users only.
<ul>
<li>
Example:

</li>
</ul>


<pre class="example">gs[public]> setpassword newPass009
</pre>





</li>
</ul>
</div>

</div>

<div id="outline-container-4.7.4" class="outline-4">
<h3 id="sec-4.7.4"> General User List </h3>
<div class="outline-text-4" id="text-4.7.4">

<p>The following command displays the user data.
</p>
<ul>
<li>
Sub-command
<table class="table-dl-connector"  border="0" cellspacing="0" cellpadding="6" rules="none" frame="box" >
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<tbody>
<tr><td>showuser</td><td>[User name]</td></tr>
</tbody>
</table>


</li>
<li>
Description of each argument
<table class="table-dl-connector"  border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<thead>
<tr><th scope="col">Argument</th><th scope="col">Description</th></tr>
</thead>
<tbody>
<tr><td>User name</td><td>Specify the name of the user to be displayed.</td></tr>
</tbody>
</table>


</li>
<li>
Example:



<pre class="example">gs[public]> showuser
UserName
------------------------------------
user002
user001
user003

gs[public]> showuser user001
Name     : user001
GrantedDB: public, userDB

</pre>




</li>
</ul>

<p><b>[Memo]</b>
</p><ul>
<li>
Command can be executed by an administrator user only.

</li>
</ul>
</div>
</div>

</div>

<div id="outline-container-4.8" class="outline-3">
<h3 id="sec-1.7">Container Management </h3>
<div class="outline-text-3" id="text-4.8">

<p>This section explains the available sub-commands that can be used when performing container operations. Connect to the cluster first before performing container management. Containers in the database at the (sub-command connect) connection destination will be subject to the operation.
</p>

</div>

<div id="outline-container-4.8.1" class="outline-4">
<h3 id="sec-4.8.1"> Container Creation </h3>
<div class="outline-text-4" id="text-4.8.1">

<p>Create a container.
</p>
<ul>
<li>
Sub-command
<ul>
<li>
Simplified version
<table class="table-dl-connector"  border="0" cellspacing="0" cellpadding="6" rules="none" frame="box" >
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<thead>
<tr><th scope="col">　</th><th scope="col">　</th></tr>
</thead>
<tbody>
<tr><td>Container (collection)</td><td></td></tr>
<tr><td>　createcollection</td><td>Container name  Column name  Type [Column name  Type …]</td></tr>
</tbody>
<tbody>
<tr><td>Container (time series container)</td><td></td></tr>
<tr><td>　createtimeseries</td><td>Container name   Compression method  Column name type [Column name  Type …]</td></tr>
</tbody>
</table>

</li>
<li>
Detailed version
<table class="table-dl-connector"  border="0" cellspacing="0" cellpadding="6" rules="none" frame="box" >
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<tbody>
<tr><td>　createcontainer</td><td>Container data file [Container name]</td></tr>
</tbody>
</table>


</li>
</ul>
</li>
<li>
Description of each argument
<table class="table-dl-connector"  border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<thead>
<tr><th scope="col">Argument</th><th scope="col">Description</th></tr>
</thead>
<tbody>
<tr><td>Container name</td><td>Specify the name of the container to be created. If the name is omitted in the createcontainer command, a container with the name given in the container data file will be created.</td></tr>
</tbody>
<tbody>
<tr><td>Column name</td><td>Specify the column name.</td></tr>
</tbody>
<tbody>
<tr><td>Type</td><td>Specify the column type.</td></tr>
</tbody>
<tbody>
<tr><td>Compression method</td><td>For time series data, specify the data compression method.</td></tr>
</tbody>
<tbody>
<tr><td>Container definition file</td><td>Specify the file storing the container data in JSON format.</td></tr>
</tbody>
</table>



<p>
<b>Simplified version</b> 
</p>
<p>
Specify the container name and column data (column name and type) to create the container. The compression type can also be specified for time series containers only.
</p>
<ul>
<li>
Specify "NO", "SS" for the compression method. Use the detailed version if "HI" is specified.
</li>
<li>
The collection will be created with a specified row key. The first column will become the row key.

</li>
</ul>

<p><b>Detailed version</b> 
</p>
<p>
Specify the container definition data in the json file to create a container.
</p>
<ul>
<li>
The container definition data has the same definition as the metadata file output by the export tool. See <a href="#impexp_metadata">Metadata files</a> with <a href="#container_dataform">the container data file format</a> for the column type and data compression method, container definition format, etc. However, the following data will be invalid in this command even though it is defined in the metadata file of the export command.
<ul>
<li>
version  Export tool version
</li>
<li>
database  Database name
</li>
<li>
containerFileType  Export data file type
</li>
<li>
containerFile  Export file name
</li>
<li>
partitionNo Partition no.
</li>
</ul>
</li>
<li>
Describe a single container definition in a single container definition file.
</li>
<li>
If the container name is omitted in the argument, create the container with the name described in the container definition file.
</li>
<li>
If the container name is omitted in the argument, ignore the container name in the container definition file and create the container with the name described in the argument.
</li>
<li>
An error will not result even if the database name is described in the container definition file but the name will be ignored and the container will be created in the database currently being connected.
</li>
<li>
When using the container definition file, <a href="#impexp_export"> the metadata file will be output when the --out option is specified in the export function</a>. The output metadata file can be edited and used as a container definition file.
</li>
</ul>
</li>
</ul>

<p>　　Example: When using the output metadata file as a container definition file
</p>


<pre class="example">{
	"version":"2.1.00",　　　　　　　　　　　　　　　←invalid
	"container":"container_354",
	"database":"db2",　　　　　　　　　　　　　　　　←invalid
	"containerType":"TIME_SERIES",
	"containerFileType":"binary",　　　　　　　　　　←invalid
	"containerFile":"20141219_114232_098_div1.mc", 　←invalid
	"rowKeyAssigned":true,
	"partitionNo":0,　　　　　　　　　　　　　　　　 ←invalid
	"columnSet":[
		{
			"columnName":"timestamp",
			"type":"timestamp"
		},
		{
			"columnName":"active",
			"type":"boolean"
		},
		{
			"columnName":"voltage",
			"type":"double"
		}
	],
	"timeSeriesProperties":{
		"compressionMethod":"NO",
		"compressionWindowSize":-1,
		"compressionWindowSizeUnit":"null",
		"expirationDivisionCount":8,
		"rowExpirationElapsedTime":-1,
		"rowExpirationTimeUnit":"null"
	},
	"compressionInfoSet":[
	]

</pre>






</div>

</div>

<div id="outline-container-4.8.2" class="outline-4">
<h3 id="sec-4.8.2"> Container Deletion </h3>
<div class="outline-text-4" id="text-4.8.2">

<p>The following command is used to delete a container.
</p><ul>
<li>
Sub-command
<table class="table-dl-connector"  border="0" cellspacing="0" cellpadding="6" rules="none" frame="box" >
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<tbody>
<tr><td>dropcontainer</td><td>Container name</td></tr>
</tbody>
</table>


</li>
<li>
Description of each argument
<table class="table-dl-connector"  border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<thead>
<tr><th scope="col">Argument</th><th scope="col">Description</th></tr>
</thead>
<tbody>
<tr><td>Container name</td><td>Specify the name of the container to be deleted.</td></tr>
</tbody>
</table>


</li>
<li>
Example:



<pre class="example">gs[public]> dropcontainer　Con001
</pre>





</li>
</ul>
</div>

</div>

<div id="outline-container-4.8.3" class="outline-4">
<h3 id="sec-4.8.3"> Container Indication </h3>
<div class="outline-text-4" id="text-4.8.3">

<p>The following command is used to display the container data.
</p>
<ul>
<li>
Sub-command
<table class="table-dl-connector"  border="0" cellspacing="0" cellpadding="6" rules="none" frame="box" >
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<tbody>
<tr><td>showcontainer</td><td>Container name</td></tr>
</tbody>
</table>


</li>
<li>
Description of each argument
<table class="table-dl-connector"  border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<thead>
<tr><th scope="col">Argument</th><th scope="col">Description</th></tr>
</thead>
<tbody>
<tr><td>Container name</td><td>Specify the container name to be displayed. Display a list of all containers if omitted.</td></tr>
</tbody>
</table>


</li>
<li>
Example:



<pre class="example">// display container list
gs[userDB]> showcontainer
Database : userDB
Name                  Type         PartitionId
------------------------------------------------
cont001               COLLECTION            10
col00a                COLLECTION             3
time02                TIME_SERIES            5
cont003               COLLECTION            15
cont005               TIME_SERIES           17

// display data of specified container
gs[public]> showcontainer cont003
Database    : userDB
Name : cont003
Type : COLLECTION
Partition ID: 15
DataAffinity: -

Columns:
No  Name                  Type            Index
------------------------------------------------------------
0  col1                  INTEGER         [TREE] (RowKey)
1  col2                  STRING          []
2  col3                  TIMESTAMP       []
</pre>




</li>
</ul>

<p><b>[Memo]</b>
</p><ul>
<li>
The data displayed in a container list are the “Container name”, “Container type” and “Partition ID”.
</li>
<li>
The data displayed in the specified container are the “Container name”, “Container type”, “Partition ID”, “Defined column name”, “Column data type” and “Column index setting”.
</li>
<li>
Container data of the current DB will be displayed.

</li>
</ul>
</div>

</div>

<div id="outline-container-4.8.4" class="outline-4">
<h3 id="sec-4.8.4"> Displaying a Table </h3>
<div class="outline-text-4" id="text-4.8.4">

<p>The following command is used to display the table data. <span style="text-decoration:underline;">This function can be used in the GridDB Advanced Edition only. </span>
</p>
<ul>
<li>
Sub-command
<table class="table-dl-connector"  border="0" cellspacing="0" cellpadding="6" rules="none" frame="box" >
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<tbody>
<tr><td>showtable</td><td>Table name</td></tr>
</tbody>
</table>


</li>
<li>
Description of each argument
<table class="table-dl-connector"  border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<thead>
<tr><th scope="col">Argument</th><th scope="col">Description</th></tr>
</thead>
<tbody>
<tr><td>Table name</td><td>Specify the table name to be displayed. Display a list of all tables if omitted.</td></tr>
</tbody>
</table>


</li>
<li>
Example:



<pre class="example">// display table list
gs[userdb]> showtable
Database : userdb
Name           PartitionId
------------------------------
table09                  3
table02                  7
table03                 12

Total Count: 3

//Display the specified table data
gs[userdb]> showtable table09
Database    : userdb
Name        : table09
Partition ID: 3

Columns:
No  Name            Type            Index
---------------------------------------------------
0  col1            INTEGER         [TREE]
1  col2            STRING          []
2  col3            STRING          []

</pre>




</li>
</ul>

<p><b>[Memo]</b>
</p><ul>
<li>
The data displayed in a table list are the “Table name“ and “Partition ID”.
</li>
<li>
The data displayed in the specified table are the “Table name“, “Partition ID”, “Defined column name“, “Column data type“ and “Column index setting”.
</li>
<li>
Table data of the current DB will be displayed.


</li>
</ul>
</div>

</div>

<div id="outline-container-4.8.5" class="outline-4">
<h3 id="sec-4.8.5"> Creation of Index </h3>
<div class="outline-text-4" id="text-4.8.5">

<p>The following command is used to create an index in the column of a specified container.
</p>
<ul>
<li>
Sub-command
<table class="table-dl-connector"  border="0" cellspacing="0" cellpadding="6" rules="none" frame="box" >
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<tbody>
<tr><td>createindex</td><td>Container name  Column name  Index type...</td></tr>
</tbody>
</table>


</li>
<li>
Description of each argument
<table class="table-dl-connector"  border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<thead>
<tr><th scope="col">Argument</th><th scope="col">Description</th></tr>
</thead>
<tbody>
<tr><td>Container name</td><td>Specify the name of container that the column subject to the index operation belongs to.</td></tr>
</tbody>
<tbody>
<tr><td>Column name</td><td>Specify the name of the column subject to the index operation.</td></tr>
</tbody>
<tbody>
<tr><td>Index type...</td><td>Specify the index type. Specify TREE, HASH or SPATIAL (or multiple) for the index type</td></tr>
</tbody>
</table>


</li>
<li>
Example:



<pre class="example">// create index
gs[public]> createindex cont003 col2 tree hash

gs[public]> showcontainer cont003
Database    : public
Name : cont003
Type : COLLECTION
Partition ID: 15
DataAffinity: -

Columns:
No  Name                  Type            Index
------------------------------------------------------------
0  col1                  INTEGER         [TREE] (RowKey)
1  col2                  STRING          [TREE, HASH]
2  col3                  TIMESTAMP       []
</pre>




</li>
</ul>

<p><b>[Memo]</b>
</p><ul>
<li>
An error will not occur even if an index that has already been created is specified.

</li>
</ul>
</div>

</div>

<div id="outline-container-4.8.6" class="outline-4">
<h3 id="sec-4.8.6"> Deletion of Index </h3>
<div class="outline-text-4" id="text-4.8.6">

<p>The following command is used to delete the index in the column of a specified container.
</p>
<ul>
<li>
Sub-command
<table class="table-dl-connector"  border="0" cellspacing="0" cellpadding="6" rules="none" frame="box" >
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<tbody>
<tr><td>dropindex</td><td>Container name  Column name  Index type...</td></tr>
</tbody>
</table>


</li>
<li>
Description of each argument
<table class="table-dl-connector"  border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<thead>
<tr><th scope="col">Argument</th><th scope="col">Description</th></tr>
</thead>
<tbody>
<tr><td>Container name</td><td>Specify the name of container that the column subject to the index operation belongs to.</td></tr>
</tbody>
<tbody>
<tr><td>Column name</td><td>Specify the name of the column subject to the index operation.</td></tr>
</tbody>
<tbody>
<tr><td>Index type...</td><td>Specify the index type. Specify TREE, HASH or SPATIAL (or multiple) for the index type</td></tr>
</tbody>
</table>


</li>
<li>
Example:



<pre class="example">//deletion of index
gs[public]> showcontainer cont003
Database    : public
Name : cont003
Type : COLLECTION
Partition ID: 15
DataAffinity: -

Columns:
No  Name                  Type            Index
------------------------------------------------------------
0  col1                  INTEGER         [TREE] (RowKey)
1  col2                  STRING          [TREE, HASH]
2  col3                  TIMESTAMP       [HASH]

gs[public]> dropindex cont003 col2 hash

gs[public]> showcontainer cont003
Database    : public
Name : cont003
Type : COLLECTION
Partition ID: 15
DataAffinity: -

Columns:
No  Name                  Type            Index
------------------------------------------------------------
0  col1                  INTEGER         [TREE] (RowKey)
1  col2                  STRING          [TREE]
2  col3                  TIMESTAMP       [HASH]
</pre>




</li>
</ul>

<p><b>[Memo]</b>
</p><ul>
<li>
An error will not occur even if an index that has not been created is specified.

</li>
</ul>
</div>

</div>

<div id="outline-container-4.8.7" class="outline-4">
<h3 id="sec-4.8.7"> Deletion of Trigger </h3>
<div class="outline-text-4" id="text-4.8.7">

<p>The following command is used to delete the trigger of a specified container.
</p>
<ul>
<li>
Sub-command
<table class="table-dl-connector"  border="0" cellspacing="0" cellpadding="6" rules="none" frame="box" >
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<tbody>
<tr><td>droptrigger</td><td>Container name  Trigger name</td></tr>
</tbody>
</table>


</li>
<li>
Description of each argument
<table class="table-dl-connector"  border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<thead>
<tr><th scope="col">Argument</th><th scope="col">Description</th></tr>
</thead>
<tbody>
<tr><td>Container</td><td>Specify the name of the container whose trigger is going to be deleted.</td></tr>
</tbody>
<tbody>
<tr><td>Trigger name</td><td>Specify the trigger name to delete.</td></tr>
</tbody>
</table>


</li>
<li>
Example:



<pre class="example">gs[public]> droptrigger con01 tri03
</pre>





</li>
</ul>
</div>

</div>

<div id="outline-container-4.8.8" class="outline-4">
<h3 id="sec-4.8.8"> Display of Trigger </h3>
<div class="outline-text-4" id="text-4.8.8">

<p>The following command is used to display the trigger data of a specified container.
</p>
<ul>
<li>
Sub-command
<table class="table-dl-connector"  border="0" cellspacing="0" cellpadding="6" rules="none" frame="box" >
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<tbody>
<tr><td>showtrigger</td><td>Container name [trigger name]</td></tr>
</tbody>
</table>


</li>
<li>
Description of each argument
<table class="table-dl-connector"  border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<thead>
<tr><th scope="col">Argument</th><th scope="col">Description</th></tr>
</thead>
<tbody>
<tr><td>Container</td><td>Specify the container name to be displayed.</td></tr>
</tbody>
<tbody>
<tr><td>Trigger name</td><td>Specify the trigger name to be displayed. Display a list of all trigger data if omitted.</td></tr>
</tbody>
</table>


</li>
<li>
Example:



<pre class="example">//Display the trigger data list of the specified container
gs[public]> showtrigger cont003
Name                 Type  Columns              Events
---------------------------------------------------------------
rtrig01              REST  [col1, col3]         [PUT]

gs[public]> showtrigger cont003 rtrig01
Name : rtrig01
Type          : REST
Target Columns: [col1, col3]
Target Events : [PUT]

Destination URI: http://example.com
</pre>




</li>
</ul>

<p><b>[Memo]</b>
</p><ul>
<li>
The data displayed in a trigger list are the “Trigger name”, “Notification method”, “Column to be notified”, “Operation to be monitored (create new or update, delete a row)”.
</li>
<li>
The data displayed in the specified trigger data are the “Trigger name”, “Notification method”, “Column to be notified”, “Operation to be monitored” and “Notification destination URI”. In addition, the “Destination name”, “Destination type“, “User“ and “Password” are also displayed together in a JMS notification.
</li>
<li>
See the chapter on “Trigger Function” in the “GridDB API Reference” (<a href="GridDB_API_Reference.html">GridDB_API_Reference.html</a>) for the trigger function details.

</li>
</ul>
</div>
</div>

</div>

<div id="outline-container-4.9" class="outline-3">
<h3 id="sec-1.8">Other Operations </h3>
<div class="outline-text-3" id="text-4.9">


<p>
This section explains the sub-commands for other operations.
</p>

</div>

<div id="outline-container-4.9.1" class="outline-4">
<h3 id="sec-4.9.1"> Echo Back Setting </h3>
<div class="outline-text-4" id="text-4.9.1">

<p>The following command is used to display the executed sub-command in the standard output.
</p>
<ul>
<li>
Sub-command
<table class="table-dl-connector"  border="0" cellspacing="0" cellpadding="6" rules="none" frame="box" >
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<tbody>
<tr><td>echo</td><td>boolean</td></tr>
</tbody>
</table>


</li>
<li>
Description of each argument
<table class="table-dl-connector"  border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<thead>
<tr><th scope="col">Argument</th><th scope="col">Description</th></tr>
</thead>
<tbody>
<tr><td>boolean</td><td>Display the executed subcommand in the standard output when TRUE is specified Prescribed value is FALSE.</td></tr>
</tbody>
</table>


</li>
<li>
Example:



<pre class="example">// display the executed subcommand in the standard output
gs> echo TRUE
</pre>




</li>
</ul>

<p><b>[Memo]</b>
</p><ul>
<li>
gs_sh prompt "gs>" always appear in the standard output.
</li>
</ul>

<p>　
</p>
</div>

</div>

<div id="outline-container-4.9.2" class="outline-4">
<h3 id="sec-4.9.2">Message Display </h3>
<div class="outline-text-4" id="text-4.9.2">

<p>The following command is used to display the definition details of the specified character string or variable.
</p>
<ul>
<li>
Sub-command
<table class="table-dl-connector"  border="0" cellspacing="0" cellpadding="6" rules="none" frame="box" >
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<tbody>
<tr><td>print</td><td>Message</td></tr>
</tbody>
</table>


</li>
<li>
Description of each argument
<table class="table-dl-connector"  border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<thead>
<tr><th scope="col">Argument</th><th scope="col">Description</th></tr>
</thead>
<tbody>
<tr><td>Message</td><td>Specify the character string or variable to display.</td></tr>
</tbody>
</table>


</li>
<li>
Example:



<pre class="example">// display of character string
gs> print  print executed.
Print executed.
</pre>




</li>
</ul>

<p><b>[Memo]</b>
</p><ul>
<li>
Append "$" in front of the variable name when using a variable.
</li>
</ul>

<p>　
</p>
</div>

</div>

<div id="outline-container-4.9.3" class="outline-4">
<h3 id="sec-4.9.3"> Sleep </h3>
<div class="outline-text-4" id="text-4.9.3">

<p>The following command can be used to set the time for the sleeping function.
</p>
<ul>
<li>
Sub-command
<table class="table-dl-connector"  border="0" cellspacing="0" cellpadding="6" rules="none" frame="box" >
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<tbody>
<tr><td>sleep</td><td>No. of sec</td></tr>
</tbody>
</table>


</li>
<li>
Description of each argument
<table class="table-dl-connector"  border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<thead>
<tr><th scope="col">Argument</th><th scope="col">Description</th></tr>
</thead>
<tbody>
<tr><td>No. of sec</td><td>Specify the no. of sec to go to sleep.</td></tr>
</tbody>
</table>


</li>
<li>
Example:



<pre class="example">// sleep for 10 sec
gs> sleep 10
</pre>




</li>
</ul>

<p><b>[Memo]</b>
</p><ul>
<li>
Specify a positive integer for the no. of sec number.
</li>
</ul>

<p>　
</p>
</div>

</div>

<div id="outline-container-4.9.4" class="outline-4">
<h3 id="sec-4.9.4"> Execution of External Commands </h3>
<div class="outline-text-4" id="text-4.9.4">

<p>The following command is used to execute an external command.
</p>
<ul>
<li>
Sub-command
<table class="table-dl-connector"  border="0" cellspacing="0" cellpadding="6" rules="none" frame="box" >
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<tbody>
<tr><td>exec</td><td>External command [External command argument]</td></tr>
</tbody>
</table>


</li>
<li>
Description of each argument
<table class="table-dl-connector"  border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<thead>
<tr><th scope="col">Argument</th><th scope="col">Description</th></tr>
</thead>
<tbody>
<tr><td>External command</td><td>Specify an external command.</td></tr>
</tbody>
<tbody>
<tr><td>External command argument</td><td>Specify the argument of an external command.</td></tr>
</tbody>
</table>


</li>
<li>
Example:



<pre class="example">// display the file data of the current directory
gs> exec ls -la
</pre>




</li>
</ul>

<p><b>[Memo]</b>
</p><ul>
<li>
Pipe, redirect, hear document cannot be used.
</li>
</ul>

<p>　
</p>
</div>

</div>

<div id="outline-container-4.9.5" class="outline-4">
<h3 id="sec-4.9.5"> Terminating gs_sh </h3>
<div class="outline-text-4" id="text-4.9.5">

<p>The following command is used to terminate gs_sh.
</p><ul>
<li>
Sub-command
<table class="table-dl-connector"  border="0" cellspacing="0" cellpadding="6" rules="none" frame="box" >
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<tbody>
<tr><td>exit</td><td></td></tr>
<tr><td>quit</td><td></td></tr>
</tbody>
</table>


</li>
<li>
Example:



<pre class="example">// terminate gs_sh.
gs> exit
</pre>




</li>
</ul>

<p>　In addition, if an error occurs in the sub-command, the setting can be configured to end gs_sh.
</p><ul>
<li>
Sub-command
<table class="table-dl-connector"  border="0" cellspacing="0" cellpadding="6" rules="none" frame="box" >
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<tbody>
<tr><td>errexit</td><td>boolean</td></tr>
</tbody>
</table>


</li>
<li>
Description of each argument
<table class="table-dl-connector"  border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<thead>
<tr><th scope="col">Argument</th><th scope="col">Description</th></tr>
</thead>
<tbody>
<tr><td>boolean</td><td>If TRUE is specified, gs_sh ends when an error occurs in the sub-command. Default is FALSE.</td></tr>
</tbody>
</table>


</li>
<li>
Example:



<pre class="example">// configure the setting so as to end gs_sh when an error occurs in the sub-command
gs> errexit TRUE
</pre>




</li>
</ul>

<p><b>[Memo]</b>
</p><ul>
<li>
There is no functional difference between the exit sub-command and quit sub-command.
</li>
</ul>

<p>　
</p>
</div>

</div>

<div id="outline-container-4.9.6" class="outline-4">
<h3 id="sec-4.9.6"> Help </h3>
<div class="outline-text-4" id="text-4.9.6">

<p>The following command is used to display a description of the sub-command. - subcommand
</p><table class="table-dl-connector"  border="0" cellspacing="0" cellpadding="6" rules="none" frame="box" >
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<tbody>
<tr><td>help</td><td>[Sub-command name]</td></tr>
</tbody>
</table>


<ul>
<li>
Description of each argument
<table class="table-dl-connector"  border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<thead>
<tr><th scope="col">Argument</th><th scope="col">Description</th></tr>
</thead>
<tbody>
<tr><td>Sub-command name</td><td>Specify the subcommand name to display the description Display a list of the subcommands if omitted.</td></tr>
</tbody>
</table>


</li>
<li>
Example:



<pre class="example">// display the description of the subcommand
gs> help exit
exit
The following command is used to terminate gs_sh.
</pre>




</li>
</ul>

<p><b>[Memo]</b>
</p><ul>
<li>
A description of gs_sh can be obtained with the command “gh_sh --help”.
</li>
</ul>

<p>　
</p>
</div>

</div>

<div id="outline-container-4.9.7" class="outline-4">
<h3 id="sec-4.9.7"> Version </h3>
<div class="outline-text-4" id="text-4.9.7">

<p>The following command is used to display the version of gs_sh.
</p>
<ul>
<li>
Sub-command
<table class="table-dl-connector"  border="0" cellspacing="0" cellpadding="6" rules="none" frame="box" >
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<tbody>
<tr><td>version</td><td></td></tr>
</tbody>
</table>


</li>
<li>
Example:



<pre class="example">// display of version
gs> version
gs_sh version 2.0.0
</pre>




</li>
</ul>

<p><b>[Memo]</b>
</p><ul>
<li>
The gs_sh version data can be obtained with the command “gh_sh --version” as well.
</li>
</ul>

<p>　
</p>
</div>
</div>

</div>

<div id="outline-container-4.10" class="outline-3">
<h3 id="sec-1.9">Options and Subcommand Specifications </h3>
<div class="outline-text-3" id="text-4.10">



</div>

<div id="outline-container-4.10.1" class="outline-4">
<h3 id="sec-4.10.1"> Options </h3>
<div class="outline-text-4" id="text-4.10.1">

<ul>
<li>
Command list

<table class="table-dl-connector"  border="0" cellspacing="0" cellpadding="6" rules="none" frame="box" >
<caption></caption>
<colgroup><col align="left" /><col align="left" />
</colgroup>
<tbody>
<tr><td>gs_sh</td><td>[Script file]</td></tr>
<tr><td>gs_sh</td><td>-v｜--version</td></tr>
<tr><td>gs_sh</td><td>-h｜--help</td></tr>
</tbody>
</table>


</li>
<li>
Optional specifications
<table class="table-dl-connector"  border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<caption></caption>
<colgroup><col align="left" /><col align="left" /><col align="left" />
</colgroup>
<thead>
<tr><th scope="col">Optional</th><th scope="col">Essential</th><th scope="col">Description</th></tr>
</thead>
<tbody>
<tr><td>-v｜--version</td><td></td><td>Display the version of the tool.</td></tr>
</tbody>
<tbody>
<tr><td>-h｜--help</td><td></td><td>Display the command list as a help message.</td></tr>
</tbody>
</table>


</li>
</ul>

<p><b>[Memo]</b>
</p><ul>
<li>
In order to batch process the gs_sh sub-command, a script file can be created. Extension of the script file is gsh.
</li>
<li>
During gs_sh startup, .gsshrc script files under the gsadm user home directory are imported automatically. The .gsshrc contents will also be imported to the destination from other script files. 


</li>
</ul>
</div>

</div>

<div id="outline-container-4.10.2" class="outline-4">
<h3 id="sec-4.10.2">Sub-command List </h3>
<div class="outline-text-4" id="text-4.10.2">


<ul>
<li>
GridDB cluster definition sub-command list
<table class="table-dl-connector"  border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<caption></caption>
<colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" />
</colgroup>
<thead>
<tr><th scope="col">Sub-command</th><th scope="col">Argument</th><th scope="col">Description</th><th scope="col">*1</th></tr>
</thead>
<tbody>
<tr><td>　　setnode</td><td>Node variables name IP address</td><td>Define the node variable.</td><td></td></tr>
<tr><td></td><td>　　Port no. [SSH port no.]</td><td></td><td></td></tr>
</tbody>
<tbody>
<tr><td>　　setcluster</td><td>Cluster variable name cluster name　</td><td>Define the cluster variable.</td><td></td></tr>
<tr><td></td><td>　　Multicast address port no.</td><td></td><td></td></tr>
<tr><td></td><td>　　[Node variable... ]</td><td></td><td></td></tr>
</tbody>
<tbody>
<tr><td>　　setclustersql</td><td>Cluster variable name cluster name</td><td>Define the SQL connection destination in the cluster configuration.</td><td></td></tr>
<tr><td></td><td>　　SQL address SQL port no.</td><td></td><td></td></tr>
</tbody>
<tbody>
<tr><td>　　modcluster 　</td><td>Cluster variable name</td><td>Add or delete a node variable to or from the cluster variable.</td><td></td></tr>
<tr><td></td><td>　　 add｜remove node variable...</td><td></td><td></td></tr>
</tbody>
<tbody>
<tr><td>　　setuser</td><td>User name  password　</td><td>Define the user and password to access the cluster.</td><td></td></tr>
<tr><td></td><td>　　[Password of OS user gsadm]</td><td></td><td></td></tr>
</tbody>
<tbody>
<tr><td>　　set</td><td>Variable name [value]</td><td>Define an arbitrary variable.</td><td></td></tr>
</tbody>
<tbody>
<tr><td>　　show</td><td>[Variable name]</td><td>Display the detailed definition of the variable.</td><td></td></tr>
</tbody>
<tbody>
<tr><td>　　save</td><td>[Script file name]</td><td>Save the variable definition in the script file.</td><td></td></tr>
</tbody>
<tbody>
<tr><td>　　load</td><td>[Script file name]</td><td>Execute a read script file.</td><td></td></tr>
</tbody>
</table>

</li>
</ul>

<p>　
</p>
<ul>
<li>
GridDB cluster operation sub-command list
<table class="table-dl-connector"  border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<caption></caption>
<colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" />
</colgroup>
<thead>
<tr><th scope="col">Sub-command</th><th scope="col">Argument</th><th scope="col">Description</th><th scope="col">*1</th></tr>
</thead>
<tbody>
<tr><td>　　startnode</td><td>Node｜cluster variable [Timeout time in sec.]</td><td>Explanation on how to start a node is shown below.</td><td>*</td></tr>
</tbody>
<tbody>
<tr><td>　　stopnode</td><td>Node｜cluster variable [Timeout time in sec.]</td><td>Explanation on how to stop a node is shown below.</td><td>*</td></tr>
</tbody>
<tbody>
<tr><td>　　stopnodeforce</td><td>Node｜cluster variable [Timeout time in sec.]</td><td>Stop the specified node by force.</td><td>*</td></tr>
</tbody>
<tbody>
<tr><td>　　startcluster</td><td>Cluster variable [Timeout time in sec.]</td><td>Attach the active node groups to a cluster, together at once.</td><td>*</td></tr>
</tbody>
<tbody>
<tr><td>　　stopcluster</td><td>Cluster variable [Timeout time in sec.]</td><td>Detach all of the currently attached nodes from a cluster, together at once.</td><td>*</td></tr>
</tbody>
<tbody>
<tr><td>　　joincluster</td><td>Cluster variable node variable [Timeout time in sec.]</td><td>Attach a node individually to a cluster.</td><td>*</td></tr>
</tbody>
<tbody>
<tr><td>　　leavecluster</td><td>Node variable [Timeout time in sec.]</td><td>Detach a node individually from a cluster.</td><td>*</td></tr>
</tbody>
<tbody>
<tr><td>　　leaveclusterforce</td><td>Node variable [Timeout time in sec.]</td><td>Force the specified node to leave/get detached from a cluster.</td><td>*</td></tr>
</tbody>
<tbody>
<tr><td>　　appendcluster</td><td>Cluster variable node variable [Timeout time in sec.]</td><td>Add an undefined node to a pre-defined cluster.</td><td>*</td></tr>
</tbody>
<tbody>
<tr><td>　　configcluster</td><td>Cluster variable</td><td>Display the cluster status data.</td><td>*</td></tr>
</tbody>
<tbody>
<tr><td>　　config</td><td>Node variable</td><td>Display the cluster configuration data.</td><td>*</td></tr>
</tbody>
<tbody>
<tr><td>　　stat</td><td>Node variable</td><td>Display the status of the specified node.</td><td>*</td></tr>
</tbody>
<tbody>
<tr><td>　　logs</td><td>Node variable</td><td>The following command displays the log of the specified node.</td><td>*</td></tr>
</tbody>
<tbody>
<tr><td>　　logconf</td><td>Node variable [category name [output level]]</td><td>Display and change the log settings.</td><td>*</td></tr>
</tbody>
</table>

</li>
</ul>

<p>　　　　*1: Commands marked with an * can be executed by an administrator user only.<br/>
</p>
<p>
　
</p><ul>
<li>
Data operation sub-command list in database
<table class="table-dl-connector"  border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<caption></caption>
<colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" />
</colgroup>
<thead>
<tr><th scope="col">Sub-command</th><th scope="col">Argument</th><th scope="col">Description</th><th scope="col">*1</th></tr>
</thead>
<tbody>
<tr><td>　　connect</td><td>Cluster variable [database name]</td><td>Connect to a GridDB cluster.</td><td></td></tr>
</tbody>
<tbody>
<tr><td>　　tql</td><td>Container name query;</td><td>The following command will execute a search and retain the search results.</td><td></td></tr>
</tbody>
<tbody>
<tr><td>　　get</td><td>[No. of cases acquired]</td><td>Get the search results and display them in a standard output.</td><td></td></tr>
</tbody>
<tbody>
<tr><td>　　getcsv</td><td>CSV file name [No. of search results found]</td><td>Get the search results and save them in a file in the CSV format.</td><td></td></tr>
</tbody>
<tbody>
<tr><td>　　getnoprint</td><td>[No. of cases acquired]</td><td>Get the query results but do not display them in a standard output.</td><td></td></tr>
</tbody>
<tbody>
<tr><td>　　tqlclose</td><td></td><td>Discard the search results retained.</td><td></td></tr>
</tbody>
<tbody>
<tr><td>　　tqlanalyze</td><td>Container name query;</td><td>The following command displays the execution plan of the specified TQL command.</td><td></td></tr>
</tbody>
<tbody>
<tr><td>　　tqlexplain</td><td>Container name query;</td><td>Execute the specified TQL command and display the execution plan and actual measurement values such as the number of cases processed etc.</td><td></td></tr>
</tbody>
<tbody>
<tr><td>　　sql</td><td>SQL command;</td><td>The following command executes an SQL command and retains the search result.</td><td></td></tr>
</tbody>
<tbody>
<tr><td>　　queryclose</td><td></td><td>Close SQL.</td><td></td></tr>
</tbody>
<tbody>
<tr><td>　　disconnect</td><td></td><td>The following command disconnect user from a GridDB cluster.</td><td></td></tr>
</tbody>
</table>

</li>
</ul>

<p>　　　　 *1: Commands marked with an * can be executed by an administrator user only.<br/>
</p>
<p>
　
</p><ul>
<li>
Database management sub-command list
<table class="table-dl-connector"  border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<caption></caption>
<colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" />
</colgroup>
<thead>
<tr><th scope="col">Sub-command</th><th scope="col">Argument</th><th scope="col">Description</th><th scope="col">*1</th></tr>
</thead>
<tbody>
<tr><td>　　createdatabase</td><td>Database name</td><td>Create a database.</td><td>*</td></tr>
</tbody>
<tbody>
<tr><td>　　dropdatabase</td><td>Database name</td><td>Delete a database.</td><td>*</td></tr>
</tbody>
<tbody>
<tr><td>　　getcurrentdatabase</td><td></td><td>Display the current database name.</td><td></td></tr>
</tbody>
<tbody>
<tr><td>　　showdatabase</td><td>[Database name]</td><td>The following command is used to display the database list and access rights data.</td><td></td></tr>
</tbody>
<tbody>
<tr><td>　　grant</td><td>Database name  user name</td><td>The following command is used to assign access rights to the database.</td><td>*</td></tr>
</tbody>
<tbody>
<tr><td>　　revoke</td><td>Database name  user name</td><td>The following command is used to revoke access rights to the database.</td><td>*</td></tr>
</tbody>
</table>

</li>
</ul>

<p>　　　　 *1: Commands marked with an * can be executed by an administrator user only.<br/>
</p>
<p>
　
</p><ul>
<li>
User management sub-command list
<table class="table-dl-connector"  border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<caption></caption>
<colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" />
</colgroup>
<thead>
<tr><th scope="col">Sub-command</th><th scope="col">Argument</th><th scope="col">Description</th><th scope="col">*1</th></tr>
</thead>
<tbody>
<tr><td>　　createuser</td><td>User name  password</td><td>Create a general user.</td><td>*</td></tr>
</tbody>
<tbody>
<tr><td>　　dropuser</td><td>User name</td><td>Delete a general user.</td><td>*</td></tr>
</tbody>
<tbody>
<tr><td>　　setpassword</td><td>Password</td><td>Change your own password.</td><td></td></tr>
</tbody>
<tbody>
<tr><td>　　setpassword</td><td>User name  password</td><td>Change the password of a general user.</td><td></td></tr>
</tbody>
<tbody>
<tr><td>　　showuser</td><td>[User name]</td><td>The following command displays the user data.</td><td></td></tr>
</tbody>
</table>

</li>
</ul>

<p>　　　　 *1: Commands marked with an * can be executed by an administrator user only.<br/>
</p>
<p>
　
</p><ul>
<li>
Container management sub-command list
<table class="table-dl-connector"  border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<caption></caption>
<colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" />
</colgroup>
<thead>
<tr><th scope="col">Sub-command</th><th scope="col">Argument</th><th scope="col">Description</th><th scope="col">*1</th></tr>
</thead>
<tbody>
<tr><td>　　createcollection</td><td>Container name  Column name  Type [Column name  Type …]</td><td>Create a container (collection),</td><td></td></tr>
</tbody>
<tbody>
<tr><td>　　createtimeseries</td><td>Container name   Compression method  Column name type [Column name  Type …]</td><td>Create a container (time series container).</td><td></td></tr>
</tbody>
<tbody>
<tr><td>　　createcontainer</td><td>Container data file [Container name]</td><td>Create a container from the container data file.</td><td></td></tr>
</tbody>
<tbody>
<tr><td>　　dropcontainer</td><td>Container name</td><td>The following command is used to delete a container.</td><td></td></tr>
</tbody>
<tbody>
<tr><td>　　showcontainer</td><td>[Container name]</td><td>The following command is used to display the container data.</td><td></td></tr>
</tbody>
<tbody>
<tr><td>　　showtable</td><td>[Table name]</td><td>The following command is used to display the table data.</td><td></td></tr>
</tbody>
<tbody>
<tr><td>　　createindex</td><td>Container name  Column name  Index type...</td><td>Create an index in the specified column.</td><td></td></tr>
</tbody>
<tbody>
<tr><td>　　dropindex</td><td>Container name  Column name  Index type...</td><td>Delete an index of the specified column.</td><td></td></tr>
</tbody>
<tbody>
<tr><td>　　droptrigger</td><td>Container name  Trigger name</td><td>Delete the trigger data.</td><td></td></tr>
</tbody>
<tbody>
<tr><td>　　showtrigger</td><td>Container name [trigger name]</td><td>Display the trigger data.</td><td></td></tr>
</tbody>
</table>

</li>
</ul>

<p>　　　　 *1: Commands marked with an * can be executed by an administrator user only.<br/>
</p>
<p>
　
</p><ul>
<li>
Other operation sub-command list
<table class="table-dl-connector"  border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<caption></caption>
<colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" />
</colgroup>
<thead>
<tr><th scope="col">Sub-command</th><th scope="col">Argument</th><th scope="col">Description</th><th scope="col">*1</th></tr>
</thead>
<tbody>
<tr><td>　　echo</td><td>boolean</td><td>Set whether to echo back.</td><td></td></tr>
</tbody>
<tbody>
<tr><td>　　print</td><td>Message</td><td>The following command is used to display the definition details of the specified character string or variable.</td><td></td></tr>
</tbody>
<tbody>
<tr><td>　　sleep</td><td>No. of sec</td><td>The following command can be used to set the time for the sleeping function.</td><td></td></tr>
</tbody>
<tbody>
<tr><td>　　exec</td><td>External command [External command argument]</td><td>The following command is used to execute an external command.</td><td></td></tr>
</tbody>
<tbody>
<tr><td>　　exit</td><td></td><td>The following command is used to terminate gs_sh.</td><td></td></tr>
</tbody>
<tbody>
<tr><td>　　quit</td><td></td><td>The following command is used to terminate gs_sh.</td><td></td></tr>
</tbody>
<tbody>
<tr><td>　　errexit</td><td>boolean</td><td>Set whether to terminate gs_sh when an error occurs.</td><td></td></tr>
</tbody>
<tbody>
<tr><td>　　help</td><td>[Subcommand name]</td><td>The following command is used to display a description of the sub-command.</td><td></td></tr>
</tbody>
<tbody>
<tr><td>　　version</td><td></td><td>Display the version data.</td><td></td></tr>
</tbody>
</table>

</li>
</ul>

<p>　　　　 *1: Commands marked with an * can be executed by an administrator user only.<br/>
</p>
</div>
</div>
</div>
</div>
</div>
<!-- / main -->

<?php get_footer(); ?>
