<?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.3</span> Installing </h1>
<div class="outline-text-3" id="text-1">

    <p> The following chapter will discuss how to install GridDB (Standard Edition). Instructions for installing on the cloud can be found <a href="#online"> below</a></p>

</div>
<div id="outline-container-1.1" class="outline-4">
<h3 id="sec-1.1"><span class="section-number-4"></span>6.3.1 On Premises </h3>
<div class="outline-text-4" id="text-1.1">
<p>
The following 3 RPM packages are needed when installing a GridDB node. Place these packages anywhere in the machine.
</p>
<table  border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides" class="table-dl-connector">
<caption></caption>
<thead>
<tr><th scope="col">Package name</th><th scope="col">File name</th><th scope="col">Description</th></tr>
</thead>
<tbody>
<tr><td>griddb-server</td><td>griddb-server-X.X.X-linux.x86_64.rpm</td><td>The start and other commands for the GridDB node module and server are included.</td></tr>
<tr><td>griddb-client</td><td>griddb-client-X.X.X-linux.x86_64.rpm</td><td>One set of operating commands except start node is included.</td></tr>
<tr><td>griddb-docs</td><td>griddb-docs-X.X.X-linux.x86_64.rpm</td><td>GridDB manual and program samples are included.</td></tr>
</tbody>
</table>

*: X.X.X is the GridDB version

<p>
Install using the rpm command as a root user.
</p>



<pre class="example">$ su
# rpm -Uvh griddb-server-X.X.X-linux.x86_64.rpm
Under preparation...           ########################################### [100%]
User gsadm and group gridstore have been registered.
GridStore uses new user and group.
1:griddb-server                 ########################################### [100%]
# rpm -Uvh griddb-client-X.X.X-linux.x86_64.rpm
Under preparation...           ########################################### [100%]
User and group has already been registered correctly.
GridStore uses existing user and group.
1:griddb-client                  ########################################### [100%]
# rpm -Uvh griddb-docs-X.X.X-linux.x86_64.rpm
Under preparation...           ########################################### [100%]
1:griddb-docs                   ########################################### [100%]
</pre>




<p>
When you install the package, the following group and user are created in the OS. This OS user is set as the operator of GridDB.
</p>
<table  border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides" class="table-dl-connector">
<caption></caption>
<thead>
<tr><th scope="col">Group</th><th scope="col">User</th><th scope="col">Home directory</th></tr>
</thead>
<tbody>
<tr><td>gridstore</td><td>gsadm</td><td>/var/lib/gridstore</td></tr>
</tbody>
</table>


<p>
The following environment variables are defined in this gsadm user.
</p>
<table  border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides" class="table-dl-connector">
<caption></caption>
<thead>
<tr><th scope="col">Environment variables</th><th scope="col">Value</th><th scope="col">Meaning</th></tr>
</thead>
<tbody>
<tr><td>GS_HOME</td><td>/var/lib/gridstore</td><td>gsadm/GridDB home directory</td></tr>
<tr><td>GS_LOG</td><td>/var/lib/gridstore/log</td><td>Event log file output directory</td></tr>
</tbody>
</table>


<p>
<b>[Points to note]</b>
</p><ul>
<li>
These environment variables are used in the operating commands described later.
</li>
<li>
<span style="text-decoration:underline;">The password of the gsadm user has not been set. </span>With the root user privilege, please set the password appropriately.
<ul>
<li>
Some of the functions of the operation tools may be necessary.

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

<p>In addition, when the GridDB node module is installed, services that are executed automatically upon startup of the OS will be registered.
</p>
<table  border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides" class="table-dl-connector">
<caption></caption>
<thead>
<tr><th scope="col">Service name</th><th scope="col">Run level</th></tr>
</thead>
<tbody>
<tr><td>gridstore</td><td>3,4,5</td></tr>
</tbody>
</table>


<p>
The service registration data can be checked with the following command.
</p>



<pre class="example"># /sbin/chkconfig --list | grep gridstore
gridstore 0:off 1:off 2:off 3:on 4:on 5:on 6:off
</pre>




<p>
The GridDB node will be started automatically by this service during OS startup.
</p>
<p>
<b>[Points to note]</b>
</p><ul>
<li>
Services will not start automatically immediately after installation.

</li>
</ul>

<p>To stop auto startup of a service, use the command below.
</p>



<pre class="example"># /sbin/chkconfig gridstore off
</pre>




<p>
See the chapter on services in “GridDB Operational Management Guide” (<a href="https://griddb.net/en/docs/manuals/v3.1/GridDB_OperationGuide.html">GridDB_OperationGuide.html</a>) for details of the services.
</p>
</div>

</div>

<div id="outline-container-2.2.3" class="outline-4">
<h4 id="sec-2.2.3">Post-installation checks </h4>
<div class="outline-text-4" id="text-2.2.3">


<p>
Check the directory configuration of the installed GridDB node.
</p>
<p>
First, check that the GridDB home directory, and related directory and files have been created.
</p>
<p>
<b>GridDB home directory</b>
</p>



<pre class="example">/var/lib/gridstore/                      # GridDB home directory
                admin/                # integrated operational management GUI home directory
                backup/               # backup directory
                conf/                 # definition file directory
                        gs_cluster.json  # cluster definition file
                        gs_node.json     # node definition file
                        password         # user definition file
                data/                 # database file directory
                log/                  # log directory
</pre>




<p>
Confirm with the following command.
</p>



<pre class="example">$ ls /var/lib/gridstore/
admin backup conf data log
</pre>




<p>
Next, check that the installation directory has been created
</p>
<p>
<b>Installation directory</b>
</p>



<pre class="example">/usr/gridstore-X.X.X/              # installation directory
                    Fixlist.pdf   # revision record
                    Readme.txt    # release instructions
                    bin/          # operation command, module directory
                    conf/         # definition file sample directory
                    docs/         # document directory
                    etc/
                    lib/          # library directory
                    license/      # license directory
                    prop/         # configuration file directory
                    web/          # integrated operational management GUI file directory
</pre>




<p>
Confirm with the following command.
</p>



<pre class="example">$ ls /usr/gridstore-X.X.X/
Fixlist.pdf Readme.txt bin conf etc lib license prop web
</pre>




<p>
All documents have been compressed into a single ZIP file. Decompress and refer to the documents where appropriate as shown below.
</p>



<pre class="example">$ cd /usr/gridstore-X.X.X/docs
$ unzip griddb-documents-X.X.X.zip
</pre>




<p>
In addition, the following symbolic links are created as shown below in a few directories under the installation directory for greater convenience.
</p>



<pre class="example">$ ls /usr/gridstore/
conf lib prop web
</pre>




<p>
Lastly, confirm the version of the server module installed with the following command.
</p>



<pre class="example">$ gsserver --version
GridDB version X.X.X build XXXXX
</pre>




<p>
<b>Points to note</b>
</p>
<p>
The following files are created when GridDB is operated according to the following procedure.
</p>
<p>
[Database file]
</p>


<pre class="example">/var/lib/gridstore/                     # GridDB home directory
                data/                # database file directory
                        gs_log_n_m.log  # log file to record the transaction logs (n, m are numbers)
                        gs_cp_n_p.dat   # checkpoint file to record data regularly (n, p are numbers)
</pre>




<p>
[Log file]
</p>


<pre class="example">/var/lib/gridstore/                            # GridDB home directory
                log/                        # log directory
                    gridstore-%Y%m%d-n.log  # event log file
                    gs_XXXX.log             # operation tool log file
</pre>




<p>
The directory where these files are created can be changed by the parameter settings in the node definition file.
</p>
<p>
*: gs_XXXX is an operation tool name. (Example: gs_startnode.log)
</p>
</div>

</div>

<div id="outline-container-2.2.4" class="outline-4">
<h4 id="sec-2.2.4"><a name="setup_admin" id="setup_admin"></a> Setting up an Administrator User </h4>
<div class="outline-text-4" id="text-2.2.4">


<p>
Administrator privilege is used for authentication related matter within the nodes and clusters. Creation date of administrator user is saved in the <b>user definition file</b>. The default file is as shown below.
</p><ul>
<li>
/var/lib/gridstore/conf/password

</li>
</ul>

<p>The default user below exists immediately after installation.
</p>
<table  border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides" class="table-dl-connector">
<caption></caption>
<thead>
<tr><th scope="col">User</th><th scope="col">Password</th><th scope="col">Example of proper use</th></tr>
</thead>
<tbody>
<tr><td>admin</td><td>admin</td><td>For authentication of operation administrator user, operation commands</td></tr>
<tr><td>system</td><td>manager</td><td>For authentication of application user, client execution</td></tr>
</tbody>
</table>


<p>
Administrator user information including the above-mentioned default users can be changed using the user administration command in the operating commands.
</p>
<table  border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides" class="table-dl-connector">
<caption></caption>
<thead>
<tr><th scope="col">Command</th><th scope="col">Function</th></tr>
</thead>
<tbody>
<tr><td>gs_adduser</td><td>Add an administrator user</td></tr>
<tr><td>gs_deluser</td><td>Delete an administrator user</td></tr>
<tr><td>gs_passwd</td><td>Change the password of administrator user</td></tr>
</tbody>
</table>


<p>
Change the password as shown below when using a default user. The password is encrypted during registration.
</p>



<pre class="example">$ gs_passwd admin
Password: (enter password)
Retype password: (re-enter password)
</pre>




<p>
<span style="text-decoration:underline;"> When adding a new administrator user except a default user, the user name has to start with gs#. </span>
</p>
<p>
One or more ASCII alphanumeric characters and the underscore sign “_” can be used after gs#.
</p>
<p>
An example on adding a new administrator user is shown below.
</p>



<pre class="example">$ gs_adduser gs#newuser
Password: (enter password)
Retype password: (re-enter password)
</pre>




<p>
<b>[Points to note]</b>
</p><ul>
<li>
A GridDB administrator user is different from the OS user gsadm created during installation.
</li>
<li>
<span style="text-decoration:underline;">A change in the administrator user information using a user administration command becomes valid when a node is restarted. </span>
</li>
<li>
In order to use it for authentication purposes in the client, the same user data needs to be registered in all the nodes. Copy the <b>user definition file</b> and make sure <span style="text-decoration:underline;">the same user data can be referred to in all the nodes. </span>
</li>
<li>
Execute the operating command as a gsadm user.

</li>
</ul>

<p><b>[Memo]</b>
</p><ul>
<li>
See “GridDB Operational Management Guide” (<a href="https://griddb.net/en/docs/manuals/v3.1/GridDB_OperationGuide.html">GridDB_OperationGuide.html</a>) for details of the user management commands.

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

<div id="outline-container-2.3" class="outline-3">
<h4 id="sec-2.3"><a name="setup_params" id="setup_params"></a> Setting the environment-dependent parameters </h4>
<div class="outline-text-3" id="text-2.3">


<p>
After installation, the following settings are necessary in order to operate GridDB.
</p>
<ol>
<li>
Network environment settings
</li>
<li>
Cluster name settings

</li>
</ol>

<p>GridDB settings are configured by editing 2 types of definition files.
</p>
<ul>
<li>
Cluster definition file (gs_cluster.json)
</li>
<li>
Node definition file (gs_node.json)

</li>
</ul>

<p>The cluster definition file defines the parameters that are common in the entire clusters.
</p>
<p>
The node definition files define the parameters for the different settings in each node.
</p>
<p>
These definition file samples are installed as follows.
</p>



<pre class="example">/usr/gridstore/                     # installation directory
            conf/                # definition file directory
                    gs_cluster.json # cluster definition file sample
                    gs_node.json    # node definition file sample
</pre>




<p>
In a new installation, the same files are also placed in the conf directory under the GridDB home directory.
</p>



<pre class="example">/var/lib/gridstore/                     # GridDB home directory
                conf/                # definition file directory
                        gs_cluster.json # (edited) cluster definition file
                        gs_node.json    # (edited) node definition file
</pre>




<p>
<span style="text-decoration:underline;">During operations, edit these definition files. </span>
</p>
<p>
<b>[Points to note]</b>
</p><ul>
<li>
When the GridDB version is upgraded, compare the newly installed sample with these definition files to adequately reflect the parameters added.
</li>
<li>
A cluster definition file defines the parameters that are common in the entire clusters. As a result, the settings must be the same <span style="text-decoration:underline;">in all of the nodes in the cluster. </span>Nodes with different settings will get an error upon joining the cluster and prevented from participating in the cluster. Further details will be explained in the later chapter.

</li>
</ul>

</div>

</div>
    
<div id="outline-container-2.3.1" class="outline-4">
<h4 id="sec-2.3.1"><a name="setup_networks" id="setup_networks"></a>Network environment settings (essential) </h4>
<div class="outline-text-4" id="text-2.3.1">


<p>
First, set up the network environment.
</p>
<p>
An explanation of the recommended configuration method in an environment that allows a multicast to be used is given below. In an environment which does not allow a multicast to be used, or an environment in which communications between fellow nodes cannot be established in a multicast, a cluster configuration method other than the multicast method has to be used. See <a href="#other_mode">Other cluster configuration method settings</a> for the details.
</p>

<p>
The configuration items can be broadly divided as follows.
</p>
<ul>
<li>
(1) Address information serving as an interface with the client
</li>
<li>
(2) Address information for cluster administration and processing
</li>
<li>
(3) Address information serving as an interface with the JDBC client (GridDB Advanced Edition only)

</li>
</ul>

<p>Although these settings need to be set to match the environment, basically default settings will also work.
</p>
<p>
<span style="text-decoration:underline;">However, an IP address derived in reverse from the host name of the machine needs to be an address that allows it to be connected from the outside regardless of whether the GridDB cluster has a multiple node configuration or a single node configuration. </span>
</p>
<p>
Normally, this can be set by stating the host name and the corresponding IP address in the /etc/hosts file.
</p>
<p>
<b>/etc/hosts setting</b>
</p>
<p>
First, check with the following command to see whether the setting has been configured. If the IP address appears, it means that the setting has already been configured.
</p>



<pre class="example">$ hostname -i
192.168.11.10
</pre>




<p>
The setting has not been configured in the following cases.
</p>



<pre class="example">$ hostname -i
hostname: no address corresponding to name
</pre>




<p>
In addition, a loopback address that cannot be connected from the outside may appear.
</p>



<pre class="example">$ hostname -i
127.0.0.1
</pre>




<p>
If the setting has not been configured or if a loopback address appears, use the following example as a reference to configure /etc/hosts. The host name and IP address, and the appropriate network interface card (NIC) differ depending on the environment.
</p>
<ol>
<li>
Check the host name and IP address.




<pre class="example">$ hostname
GS_HOST
$ ip route | grep eth0 | cut -f 12 -d " " | tr -d "\n"
192.168.11.10
</pre>




</li>
<li>
Add the IP address and corresponding host name checked by the root user to the /etc/hosts file.




<pre class="example">192.168.11.10 GS_HOST
</pre>




</li>
<li>
Check that the settings have been configured correctly.




<pre class="example">$ hostname -i
192.168.11.10
</pre>




</li>
</ol>

<p>*If the displayed setting remains the same as before, it means that a setting higher in priority is given in the /etc/hosts file. Change the priority order appropriately.
</p>
<p>
Proceed to the next setting after you have confirmed that /etc/hosts has been configured correctly.
</p>

<p>
<b>(1) Address information serving as an interface with the client</b>
</p>
<p>
In the address data serving as an interface with the client, there are configuration items in the <b> node definition file</b> and <b> cluster definition file</b>.
</p>
<p>
<b>Node definition file</b>
</p><table  border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides" class="table-dl-connector">
<caption></caption>
<thead>
<tr><th scope="col">Parameters</th><th scope="col">Data type</th><th scope="col">Meaning</th></tr>
</thead>
<tbody>
<tr><td>/transaction/serviceAddress</td><td>string</td><td>Reception address of transaction process</td></tr>
<tr><td>/transaction/servicePort</td><td>string</td><td>Reception port of transaction process</td></tr>
<tr><td>/system/serviceAddress</td><td>string</td><td>Connection address of operation command</td></tr>
<tr><td>/system/servicePort</td><td>string</td><td>Connection port of operation command</td></tr>
</tbody>
</table>


<p>
The reception address and port of transaction processes are used to connect individual client to the nodes in the cluster, and to request for the transaction process from the cluster. This address is used when configuring a cluster with a single node, but in the case where multiple nodes are present through API, the address is not used explicitly.
</p>
<p>
The connection address and port of the operating command are used to specify the process request destination of the operation command, as well as the repository information of the integrated operation control GUI.
</p>
<p>
These reception/connection addresses need not be set so long as there is no need to use/separate the use of multiple interfaces.
</p>
<p>
<b>Cluster definition file</b>
</p>
<table  border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides" class="table-dl-connector">
<caption></caption>
<thead>
<tr><th scope="col">Parameters</th><th scope="col">Data type</th><th scope="col">Meaning</th></tr>
</thead>
<tbody>
<tr><td>/transaction/notificationAddress</td><td>string</td><td>Interface address between client and cluster</td></tr>
<tr><td>/transaction/notificationPort</td><td>string</td><td>Interface port between client and cluster</td></tr>
</tbody>
</table>


<p>
A multi-cast address and port are specified in the interface address between a client and cluster. This is used by a GridDB cluster to send cluster information to its clients and for the clients to send processing requests via the API to the cluster. See the description of GridStoreFactory class/method in “GridDB API reference” (<a href="http://www.griddb.org/griddb_nosql/manual/GridDB_API_Reference.html">GridDB_API_Reference.html</a>) for details.
</p>
<p>
It is also used as a connection destination address of the export/import tool, or as repository data of the integrated operation control GUI.
</p>

<p>
<b>(2) Address information for cluster administration and processing</b>
</p>
<p>
In the address data for a cluster to autonomously perform cluster administration and processing, there are configuration items in the <b> node definition file</b> and <b> cluster definition file</b>. These addresses are used internally by GridDB to exchange the heart beat (live check among clusters) and information among the clusters. These settings are not necessary so long as the address used is not duplicated with other systems on the same network or when using multiple network interface cards.
</p>
<p>
<b>Node definition file</b>
</p><table  border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides" class="table-dl-connector">
<caption></caption>
<thead>
<tr><th scope="col">Parameters</th><th scope="col">Data type</th><th scope="col">Meaning</th></tr>
</thead>
<tbody>
<tr><td>/cluster/serviceAddress</td><td>string</td><td>Reception address used for cluster administration</td></tr>
<tr><td>/cluster/servicePort</td><td>string</td><td>Reception port used for cluster administration</td></tr>
</tbody>
</table>


<p>
<b>Cluster definition file</b>
</p><table  border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides" class="table-dl-connector">
<caption></caption>
<thead>
<tr><th scope="col">Parameters</th><th scope="col">Data type</th><th scope="col">Meaning</th></tr>
</thead>
<tbody>
<tr><td>/cluster/notificationAddress</td><td>string</td><td>Multicast address for cluster administration</td></tr>
<tr><td>/cluster/notificationPort</td><td>string</td><td>Multicast port for cluster administration</td></tr>
</tbody>
</table>


<ul>
<li>
Although a synchronization process is carried out with a replica when the cluster configuration is changed, a timeout time can be set for the process.
<ul>
<li>
/sync/timeoutInterval

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

<p><b>[Points to note]</b>
</p><ul>
<li>
An address or port that is not in use except in GridDB has to be set.
</li>
<li>
The same address can be set for the node definition file gs_node.json /transaction/serviceAddress, /system/serviceAddress, and /cluster/serviceAddress for operations to be performed. If a machine has multiple network interfaces, the bandwidth can be increased by assigning a separate address to each respective interface.

</li>
</ul>

<p><span style="text-decoration:underline;">The following settings are applicable in the GridDB Advanced Edition only. </span>
</p>
<p>
<b>(3) Address information serving as an interface with the JDBC client</b>
</p>
<p>
In the address data serving as an interface with the JDBC/ODBC client, there are configuration items in the <b> node definition file</b> and <b> cluster definition file</b>.
</p>
<p>
<b>Node definition file</b>
</p><table  border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides" class="table-dl-connector">
<caption></caption>
<thead>
<tr><th scope="col">Parameters</th><th scope="col">Data type</th><th scope="col">Meaning</th></tr>
</thead>
<tbody>
<tr><td>/sql/serviceAddress</td><td>string</td><td>Reception address for JDBC/ODBC client connection</td></tr>
<tr><td>/sql/servicePort</td><td>int</td><td>Reception port for JDBC/ODBC client connection</td></tr>
</tbody>
</table>


<p>
The reception address and port of JDBC/ODBC client connection are used to connect JDBC/ODBC individual client to the nodes in the cluster, and to access the cluster data in SQL. This address is used when configuring a cluster with a single node, but in the case where multiple nodes are present through API, the address is not used explicitly.
</p>
<p>
<b>Cluster definition file</b>
</p>
<table  border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides" class="table-dl-connector">
<caption></caption>
<thead>
<tr><th scope="col">Parameters</th><th scope="col">Data type</th><th scope="col">Meaning</th></tr>
</thead>
<tbody>
<tr><td>/sql/notificationAddress</td><td>string</td><td>Address for multi-cast distribution to JDBC/ODBC client</td></tr>
<tr><td>/sql/notificationPort</td><td>int</td><td>Multicast port to JDBC/ODBC client</td></tr>
</tbody>
</table>


<p>
The address and port used for multicast distribution to a JDBC/ODBC client are used for the GridDB cluster to notify the JDBC/ODBC client of cluster data, and to access the cluster data in SQL with the JDBC/ODBC client.
</p>
<p>
Refer to Annex <a href="#param_list">Parameter List</a> for the other parameters and default values.
</p>
</div>

</div>

<div id="outline-container-2.3.2" class="outline-4">
<h4 id="sec-2.3.2"><a name="setup_clusterName" id="setup_clusterName"></a> Cluster name settings (essential) </h4>
<div class="outline-text-4" id="text-2.3.2">


<p>
Set the name of the cluster to be composed by the target nodes in advance. The name set will be checked to see if it matches the value specified in the command to compose the cluster. As a result, this prevents a different node and cluster from being composed when there is an error in specifying the command.
</p>
<p>
The cluster name is specified in the following configuration items of the <b> cluster definition file</b>.
</p>
<p>
<b>Cluster definition file</b>
</p><table  border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides" class="table-dl-connector">
<caption></caption>
<thead>
<tr><th scope="col">Parameters</th><th scope="col">Data type</th><th scope="col">Meaning</th></tr>
</thead>
<tbody>
<tr><td>/cluster/clusterName</td><td>string</td><td>Name of cluster to create</td></tr>
</tbody>
</table>


<p>
<b>[Points to note]</b>
</p><ul>
<li>
<span style="text-decoration:underline;">Node failed to start with default value (""). </span>
</li>
<li>
<span style="text-decoration:underline;">A unique name on the sub-network is recommended. </span>
</li>
<li>
A cluster name is a string composed of 1 or more ASCII alphanumeric characters and the underscore “_”. However, the first character cannot be a number. The name is also not case-sensitive. In addition, it has to be specified within 64&#160;characters. The following characters are also OK: hyphen '-', dot '.', slash '/', equal '='


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

</div>

<div id="outline-container-2.3.3" class="outline-4">
<h4 id="sec-2.3.3"><a name="other_mode" id="other_mode"></a> Settings of other cluster configuration methods </h4>
<div class="outline-text-4" id="text-2.3.3">


<p>
In an environment which does not allow the multicast method to be used, configure the cluster using the fixed list method or provider method. An explanation of the respective network settings in the fixed list method and provider method is given below.
</p>
<p>
When using the multicast method, proceed to <a href="#tune-up_params">Setting the tuning parameters</a>.
</p>
<p>
<b>(1) Fixed list method</b>
</p>
<p>
When a fixed address list is given to start a node, the list is used to compose the cluster.
</p>
<p>
When composing a cluster using the fixed list method, configure the parameters in the cluster definition file.
</p>
<p>
<b>Cluster definition file</b>
</p><table  border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides" class="table-dl-connector">
<caption></caption>
<thead>
<tr><th scope="col">Parameters</th><th scope="col">Data type</th><th scope="col">Meaning</th></tr>
</thead>
<tbody>
<tr><td>/cluster/notificationMember</td><td>string</td><td>Specify the address list when using the fixed list method as the cluster configuration method.</td></tr>
</tbody>
</table>


<p>
A configuration example of a cluster definition file is shown below.
</p>



<pre class="example">{
                            :
                            :
    "cluster":{
        "clusterName":"yourClusterName",
        "replicationNum":2,
        "heartbeatInterval":"5s",
        "loadbalanceCheckInterval":"180s",
        "notificationMember": [
            {
                "cluster": {"address":"172.17.0.44", "port":10010},
                "sync": {"address":"172.17.0.44", "port":10020},
                "system": {"address":"172.17.0.44", "port":10040},
                "transaction": {"address":"172.17.0.44", "port":10001},
                "sql": {"address":"172.17.0.44", "port":20001}
            },
            {
                "cluster": {"address":"172.17.0.45", "port":10010},
                "sync": {"address":"172.17.0.45", "port":10020},
                "system": {"address":"172.17.0.45", "port":10040},
                "transaction": {"address":"172.17.0.45", "port":10001},
                "sql": {"address":"172.17.0.45", "port":20001}
            },
            {
                "cluster": {"address":"172.17.0.46", "port":10010},
                "sync": {"address":"172.17.0.46", "port":10020},
                "system": {"address":"172.17.0.46", "port":10040},
                "transaction": {"address":"172.17.0.46", "port":10001},
                "sql": {"address":"172.17.0.46", "port":20001}
            }
        ]
    },
                            :
                            :
}
</pre>




<p>
<b>(2) Provider method</b>
</p>
<p>
Get the address list supplied by the address provider to perform cluster configuration.
</p>
<p>
When composing a cluster using the provider method, configure the parameters in the cluster definition file.
</p>
<p>
<b>Cluster definition file</b>
</p><table  border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides" class="table-dl-connector">
<caption></caption>
<thead>
<tr><th scope="col">Parameters</th><th scope="col">Data type</th><th scope="col">Meaning</th></tr>
</thead>
<tbody>
<tr><td>/cluster/notificationProvider/url</td><td>string</td><td>Specify the URL of the address provider when using the provider method as the cluster configuration method.</td></tr>
<tr><td>/cluster/notificationProvider/updateInterval</td><td>string</td><td>Specify the interval to get the list from the address provider. Specify a value that is 1s or higher and less than 2^31s.</td></tr>
</tbody>
</table>


<p>
A configuration example of a cluster definition file is shown below.
</p>



<pre class="example">{
                            :
                            :
    "cluster":{
        "clusterName":"yourClusterName",
        "replicationNum":2,
        "heartbeatInterval":"5s",
        "loadbalanceCheckInterval":"180s",
        "notificationProvider":{
            "url":"http://example.com/notification/provider",
            "updateInterval":"30s"
        }
    },
                            :
                            :
}
</pre>




<p>
The address provider can be configured as a Web service or as a static content. The specifications below need to be satisfied.
</p>
<ul>
<li>
Compatible with the GET method.
</li>
<li>
When accessing the URL, the node address list of the cluster containing the cluster definition file in which the URL is written is returned as a response.
<ul>
<li>
Response body: Same JSON as the contents of the node list specified in the fixed list method
</li>
<li>
Response header: Including Content-Type:application/json

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

<p>An example of a response sent from the address provider is as follows.
</p>


<pre class="example">$ curl http://example.com/notification/provider
[
    {
        "cluster": {"address":"172.17.0.44", "port":10010},
        "sync": {"address":"172.17.0.44", "port":10020},
        "system": {"address":"172.17.0.44", "port":10040},
        "transaction": {"address":"172.17.0.44", "port":10001},
        "sql": {"address":"172.17.0.44", "port":20001}
    },
    {
        "cluster": {"address":"172.17.0.45", "port":10010},
        "sync": {"address":"172.17.0.45", "port":10020},
        "system": {"address":"172.17.0.45", "port":10040},
        "transaction": {"address":"172.17.0.45", "port":10001},
        "sql": {"address":"172.17.0.45", "port":20001}
    },
    {
        "cluster": {"address":"172.17.0.46", "port":10010},
        "sync": {"address":"172.17.0.46", "port":10020},
        "system": {"address":"172.17.0.46", "port":10040},
        "transaction": {"address":"172.17.0.46", "port":10001},
        "sql": {"address":"172.17.0.46", "port":20001}
    }
]
</pre>





<p>
[Memo]
</p><ul>
<li>
Specify the serviceAddress and servicePort of the node definition file in each module (cluster,sync etc.) for each address and port.
</li>
<li>
sql items are required in the GridDB Advanced Edition only.
</li>
<li>
Set either the /cluster/notificationAddress, /cluster/notificationMember, /cluster/notificationProvider in the cluster definition file to match the cluster configuration method used.
</li>
<li>
See “GridDB technical reference” (<a href="https://griddb.net/en/docs/manuals/v3.1/GridDB_TechnicalReference.html">GridDB_TechnicalReference.html</a>) for details on the cluster configuration method.


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


<div id="outline-container-2.6" class="outline-3">
<h4 id="sec-2.6"><a name="setup_client" id="setup_client"></a>Installation and setup (client) </h4>
<div class="outline-text-3" id="text-2.6">


<p>
This chapter explains the installation procedure of the client library. There are 2 types of client library in GridDB, Java and C. Only the Java version supports the GridDB Advanced Edition NewSQL interface.
</p>




<p>
<b>[Points to note]</b>
</p><ul>
<li>
When choosing the OS package group during OS installation, please choose the minimum version or lower.
<ul>
<li>
Software Development WorkStation

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

<p>The following needs to be installed as a Java language development environment.
</p>
<ul>
<li>
Oracle Java 6/7/8
</li>
<li>
Only 64-bit Java is supported by the GridDB Advanced Edition NewSQL interface.


</li>
</ul>


<pre class="example">$ java -version
java version "1.7.0_79"
Java(TM) SE Runtime Environment (build 1.7.0_79-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.79-b02, mixed mode)
</pre>




</div>

</div>
<div id="outline-container-2.6.2" class="outline-4">
<h4 id="sec-2.6.2"> Installing the client library </h4>
<div class="outline-text-4" id="text-2.6.2">


<p>
The following 4 RPM packages are required for the installation of the GridDB client library. Place the packages anywhere in the machine.
</p>
<p>
The griddb-newsql package is only available in GridDB Advanced Edition.
</p>
<table  border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides" class="table-dl-connector">
<caption></caption>
<thead>
<tr><th scope="col">Package name</th><th scope="col">File name</th><th scope="col">Description</th></tr>
</thead>
<tbody>
<tr><td>griddb-java_lib</td><td>griddb-java_lib-X.X.X-linux.x86_64.rpm</td><td>Java library is included.</td></tr>
<tr><td></td><td></td><td>(/usr/share/java/gridstore.jar)</td></tr>
<tr><td>griddb-c_lib</td><td>griddb-c_lib-X.X.X-linux.x86_64.rpm</td><td>C header file and library are included.</td></tr>
<tr><td></td><td></td><td>(/usr/include/gridstore.h and /usr/lib64/libgridstore.so)</td></tr>
<tr><td>griddb-docs</td><td>griddb-docs-X.X.X-linux.x86_64.rpm</td><td>GridDB manual and program samples are included.    </td></tr>
<tr><td>griddb-newsql</td><td>griddb-newsql-X.X.X-linux.x86_64.rpm</td><td>NewSQL interface library is included.</td></tr>
</tbody>
</table>


<p>
Install using the rpm command as a root user.
</p>


<pre class="example">$ su
# rpm -ivh griddb-c_lib-X.X.X-linux.x86_64.rpm
Under preparation...           ########################################### [100%]
1:griddb-c_lib                  ########################################### [100%]
# rpm -ivh griddb-java_lib-X.X.X-linux.x86_64.rpm
Under preparation...           ########################################### [100%]
1:griddb-java_lib               ########################################### [100%]
# rpm -ivh griddb-docs-X.X.X-linux.x86_64.rpm
Under preparation...           ########################################### [100%]
1:griddb-docs                   ########################################### [100%]
# rpm -ivh griddb-newsql-X.X.X-linux.x86_64.rpm
Under preparation...           ########################################### [100%]
1:griddb-newsql                 ########################################### [100%]
</pre>




</div>

</div>


<div id="outline-container-2.6.4" class="outline-4">
<h4 id="sec-2.6.4"> Setting up a library </h4>
<div class="outline-text-4" id="text-2.6.4">


<p>
When the Java version of the client is used, add the client library to CLASSPATH.
</p>



<pre class="example">$ export CLASSPATH=${CLASSPATH}:/usr/share/java/gridstore.jar
</pre>




<p>
When the C version is used instead, add the client library to LD_LIBRARY_PATH.
</p>



<pre class="example">$ export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/lib64
</pre>

    
    
    
</div>

</div>

<div id="outline-container-1.2" class="outline-4">
<h3 id="online"><span class="section-number-4">6.3.2</span> On Cloud </h3>
<div class="outline-text-4" id="text-1.2">

<p>GridDB is available as an AMI on the AWS Marketplace and this section will describe how to install it.</p>
<p>
Please visit the <a href="https://aws.amazon.com/marketplace/search/results?searchTerms=griddb">GridDB Community Edition Marketplace</a> and follow the onscreen instructions to create GridDB instance in your VPC. We recommend that you create 3 or more instances when configuring a GridDB cluster.
</p>

<h4> Security Group</h4>
    
<p>
GridDB node requires the following inbound ports to be open:
</p>
<table  border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides" class="table-dl-connector">
<caption></caption>
<thead>
<tr><th scope="col">Protocol</th><th scope="col">Port range</th><th scope="col">Description</th></tr>
</thead>
<tbody>
<tr><td>TCP</td><td>22</td><td>For operation over SSH.</td></tr>
<tr><td>TCP</td><td>10001,10010,10020,10040</td><td>GridDB default ports, to communicate with clients and other nodes.</td></tr>
</tbody>
</table>
    
<h4> Connecting to an instance</h4>
    
<p>
You can connect to the EC2 instances via SSH as the <b>centos</b> default OS user once the instances have been deployed and the security group has been configured.
</p>
<pre class="example">$ ssh -i your_keypair.pem centos@172.17.xx.xx
</pre>

<h4> Default OS User</h4>
    
<p>
When you deploy the EC2 instance, the following group and user are created by default in the OS. This OS user is the default operator of GridDB.
</p>
<table  border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides" class="table-dl-connector">
<caption></caption>
<thead>
<tr><th scope="col">Group</th><th scope="col">User</th><th scope="col">Home directory</th></tr>
</thead>
<tbody>
<tr><td>gridstore</td><td>gsadm</td><td>/var/lib/gridstore</td></tr>
</tbody>
</table>
    
To log in as gsadm from centos user, please use the following command.
    
<pre class="example">$ sudo su - gsadm </pre>
    
<h4> Directory Structure</h4>
    
<p>
The following directories and files, as well as the necessary modules and commands are created in the GridDB instance.
</p>



<pre class="example">/var/lib/gridstore/        # GridDB home directory
    backup/               # Backup directory(unused)
    conf/                 # Directory storing definition files
        gs_cluster.json   # Cluster definition file
        gs_node.json      # Node definition file
        password          # User definition file
    data/                 # Directory storing database files
    log/                  # Directory storing event log files
</pre>





<pre class="example">$ ls /usr/griddb-X.X.X/*
/usr/griddb-X.X.X/RPM-README.md

/usr/griddb-X.X.X/3rd_party:
3rd_party.md            apr              json-simple      picojson  slf4j
activemq-cpp-library    BSD_License.txt  MessagePack      purewell  yield
Apache_License-2.0.txt  ebb              MIT_License.txt  sha2

/usr/griddb-X.X.X/bin:
gridstore-X.X.X.jar       gs_joincluster   gs_startnode    log.py
gridstore-conf-X.X.X.jar  gs_leavecluster  gs_stat         util.py
gs_adduser                gs_passwd        gs_stopcluster
gs_deluser                gsserver         gs_stopnode

/usr/griddb-X.X.X/conf:
gs_cluster.json  gs_node.json  password

/usr/griddb-X.X.X/doc:
manual  sample
</pre>




<p>
When you access and run a GridDB node, the following files are created in the directories to store database files and event log files.
</p>
<p>
<b>[Database file]</b>
</p>



<pre class="example">/var/lib/gridstore/        # GridDB home directory
    data/                 # Directory storing database files
        gs_log_n_m.log    # File recording transaction logs (n, m: positive number)
        gs_cp_n_p.dat     # Checkpoint file recording data regularly (n, p: positive number)
</pre>




<p>
<b>[Event log file]</b>
</p>



<pre class="example">/var/lib/gridstore/              # GridDB home directory
    log/                        # Directory storing event logs
        gridstore-%Y%m%d-n.log  # Event log file
</pre>




<p>
You can change the directories used to store files by editing the relevant parameters in the node definition file.
</p>
<p>
Please refer to the document below for more information.
</p><ul>
<li>
<a href="https://griddb.github.io/griddb_nosql/manual/GridDB_RPM_InstallGuide.html">RPM Install Guide</a>

</li>
</ul>

<p>Other documents below are available on our <a href="https://github.com/griddb/griddb_nosql/tree/master/docs">GitHub page</a>.
</p><ul>
<li>
<a href="https://github.com/griddb/griddb_nosql/blob/master/docs/GridDB-3.0.0-CE-RELEASE_NOTES.md">Release notes</a>
</li>
<li>
<a href="https://griddb.github.io/griddb_nosql/manual/GridDBTechnicalDesignDocument.pdf">GridDB Technical Design Document</a>
</li>
<li>
<a href="https://griddb.github.io/griddb_nosql/manual/GridDB_QuickStartGuide.html">Quick Start Guide</a>
</li>
<li>
<a href="https://griddb.github.io/griddb_nosql/manual/GridDB_API_Reference.html">API Reference</a>

</li>
</ul>
    
<p>
<h3> Administrator Setup</h3>
</p>
<p>
An administrator user is needed for authentication purposes in nodes and clusters. Administrator user information is stored in the <b>User definition file</b>. The default file is shown below.
</p>
<ul>
<li>
/var/lib/gridstore/conf/password

</li>
</ul>

<p>The following user is created by default.
</p>
<table  border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides" class="table-dl-connector">
<caption></caption>
<thead>
<tr><th scope="col">User</th><th scope="col">Password</th></tr>
</thead>
<tbody>
<tr><td>admin</td><td>No settings</td></tr>
</tbody>
</table>


<p>
Administrator user information including the default admin user can be changed using the following user administration command in the operating commands.
</p>
<table  border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides"class="table-dl-connector">
<caption></caption>
<thead>
<tr><th scope="col">Command</th><th scope="col">Function</th></tr>
</thead>
<tbody>
<tr><td>gs_adduser</td><td>Add an administrator user</td></tr>
<tr><td>gs_deluser</td><td>Delete an administrator user</td></tr>
<tr><td>gs_passwd</td><td>Change the password of an administrator user</td></tr>
</tbody>
</table>


<p>
Change the default admin password using the gs_passwd command shown below. The password is encrypted during registration.
</p>
<p>
<b>[Note]</b>
</p>
<ul>
<li>
<span style="text-decoration:underline;">The default admin password is not set by default. Please make sure to change the password as the server will not start if the administrator user password is not set.</span>



<pre class="example">$ gs_passwd admin
Password:(Input password)
Retype password:(Input password again)
</pre>




</li>
</ul>

<p>When adding a new administrator user (not including the default user), the user name has to start with gs#. One or more ASCII alphanumeric characters and the underscore sign "_" can be used after gs#.
</p>
<p>
An example on adding a new administrator user is shown below.
</p>



<pre class="example">$ gs_adduser gs#newuser
Password:(Input password)
Retype password:(Input password again)
</pre>




<p>
<b>[Note]</b>
</p>
<ul>
<li>
<span style="text-decoration:underline;">Changes to the administrator user information take effect after the node is restarted.</span>
</li>
<li>
User information is used for client authentication, <span style="text-decoration:underline;">so the common user information must be registered in all nodes.</span> Please ensure that these information are available in all nodes by copying the user definition file.

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

</div>


<h3 id="sec-3.4"><span class="section-number-3"></span> AWS Cluster configuration setup </h3>
<div class="outline-text-3" id="text-3.4">



</div>

<div id="outline-container-3.4.1" class="outline-4">
<h4 id="sec-3.4.1"><span class="section-number-4"></span> Editing definition files </h4>
<div class="outline-text-4" id="text-3.4.1">



<p>
There are two types of definition files in GridDB:
</p>
<ul>
<li>
Cluster definition file
</li>
<li>
Node definition file

</li>
</ul>

<p>The cluster definition file is a file which defines the setting values commonly used in the entire cluster. The node definition file is a file which defines different setting values in each node.
</p>
<p>
Templates for these definition files are shown below. You can create definition files for GridDB by copying and editing these templates.
</p>



<pre class="example">/usr/griddb-3.0.0/        # Installation directory
    conf/                # Directory storing definition files
        gs_cluster.json  # Template for cluster definition file
        gs_node.json     # Template for node definition file
</pre>




<p>
Save an edited file with the predetermined name in the predetermined directory shown below.
</p>



<pre class="example">/var/lib/gridstore/       # GridDB home directory
    conf/                # Directory storing definition files
        gs_cluster.json  # (Edited) Cluster definition file
        gs_node.json     # (Edited) Node definition file
</pre>




<p>
For details on definition files, please refer to "2.3 Configure environment-dependent parameters." of the <a href="https://griddb.github.io/griddb_nosql/manual/GridDB_QuickStartGuide.html#sec-2-3">Quick Start Guide</a>.
</p>
</div>

</div>

<div id="outline-container-3.4.2" class="outline-4">
<h4 id="sec-3.4.2"><span class="section-number-4"></span> Setting the cluster name </h4>
<div class="outline-text-4" id="text-3.4.2">



<p>
Please set the cluster name in advance. The name set will be checked to see if it matches the value specified in the cluster composition command. This verification is used to prevent unintentional composition of the wrong node to a certain cluster in the case of an error in specifying the command.
</p>
<p>
The following settings in the Cluster definition file are specified in the cluster name.
</p>
<p>
<b>Cluster definition file</b>
</p>
<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides" class="table-dl-connector">
<caption></caption>
<thead>
<tr><th scope="col">Parameter</th><th scope="col">Data type</th><th scope="col">Meaning</th></tr>
</thead>
<tbody>
<tr><td>/cluster/clusterName</td><td>string</td><td>Name of cluster to create</td></tr>
</tbody>
</table>


<p>
<b>[Note]</b>
</p>
<ul>
<li>
<span style="text-decoration:underline;">The nodes will fail to start when the default value ("") is used.</span>
</li>
<li>
<span style="text-decoration:underline;">We recommend that a unique name on the sub-network is used.</span>
</li>
<li>
A cluster name is a string composed of 1 or more case-insensitive ASCII alphanumeric characters and the underscore "_", with a limitation of 64 characters. However, the first character cannot be a number.


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

</div>

<div id="outline-container-3.4.3" class="outline-4">
<h4 id="sec-3.4.3"><span class="section-number-4"></span> Single node configuration </h4>
<div class="outline-text-4" id="text-3.4.3">


<p>
Please refer to "2.3 Configure environment-dependent parameters." of the <a href="https://griddb.github.io/griddb_nosql/manual/GridDB_QuickStartGuide.html#sec-2-3">Quick Start Guide</a>.
</p>
</div>

</div>

<div id="outline-container-3.4.4" class="outline-4">
<h4 id="sec-3.4.4"><span class="section-number-4"></span> Multiple node configuration </h4>
<div class="outline-text-4" id="text-3.4.4">


<p>
GridDB usually uses multicast to configure a multiple node cluster. However, Amazon VPC does not support multicast out of the instance (as of October 2016). Therefore, GridDB uses fixed list method instead to configure a multiple node cluster.
</p>
<p>
For details on the other cluster configuration methods, please refer to <a href="https://github.com/griddb/griddb_nosql/blob/master/docs/GridDB-3.0.0-CE-RELEASE_NOTES.md">GridDB CE 3.0.0 RELEASE NOTES</a>.
</p>


<p>
<b>Cluster definition file</b>
</p>
<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides" class="table-dl-connector">
<caption></caption>
<thead>
<tr><th scope="col">Parameter</th><th scope="col">Data type</th><th scope="col">Meaning</th></tr>
</thead>
<tbody>
<tr><td>/cluster/notificationMember</td><td>string</td><td>The address list when using the fixed list method as the cluster configuration method.</td></tr>
</tbody>
</table>


<p>
A configuration example of the cluster definition file is shown below. The cluster is composed of 3 nodes.
</p>



<pre class="example">{
                            :
                            :
"cluster":{
    "clusterName":"yourClusterName",
    "replicationNum":2,
    "heartbeatInterval":"5s",
    "loadbalanceCheckInterval":"180s",
    "notificationMember": [
    {
        "cluster": {"address":"172.17.xx.xx", "port":10010},
        "sync": {"address":"172.17.xx.xx", "port":10020},
        "system": {"address":"172.17.xx.xx", "port":10040},
        "transaction": {"address":"172.17.xx.xx", "port":10001}
    },
    {
        "cluster": {"address":"172.17.yy.yy", "port":10010},
        "sync": {"address":"172.17.yy.yy", "port":10020},
        "system": {"address":"172.17.yy.yy", "port":10040},
        "transaction": {"address":"172.17.yy.yy", "port":10001}
    },
    {
        "cluster": {"address":"172.17.zz.zz", "port":10010},
        "sync": {"address":"172.17.zz.zz", "port":10020},
        "system": {"address":"172.17.zz.zz", "port":10040},
        "transaction": {"address":"172.17.zz.zz", "port":10001}
    }
    ]
},
                            :
                            :
}
</pre>




<p>
<b>[Note]</b>
</p>
<ul>
<li>
Please specify the serviceAddress and servicePort of the node definition file in each module (cluster,sync etc.) for each address and port.
</li>
<li>
Please set either the /cluster/notificationAddress or /cluster/notificationMember in the cluster definition file to match the cluster configuration method used.

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

<div id="outline-container-4" class="outline-2">
<h2 id="sec-4"><span class="section-number-2"></span> Client instance setup </h2>
<div class="outline-text-2" id="text-4">


<p>
This section shows how to set up client instance.
</p>

</div>
</div>
<div id="outline-container-4.1" class="outline-3">
<h3 id="sec-4.1"><span class="section-number-3"></span> Installing client library </h3>
<div class="outline-text-3" id="text-4.1">


<p>
If you use a Java-based client, please copy the client libraries in the GridDB instance to client instance.
</p>
<p>
The installed GridDB client libraries are shown below.
</p>



<pre class="example">/usr/griddb-3.0.0/bin:
gridstore-3.0.0.jar     gridstore-conf-3.0.0.jar
</pre>




</div>

</div>

<div id="outline-container-4.2" class="outline-3">
<h3 id="sec-4.2"><span class="section-number-3"></span> Setting up a library </h3>
<div class="outline-text-3" id="text-4.2">


<p>
Add the client library paths to CLASSPATH.
</p>



<pre class="example">$ export CLASSPATH=${CLASSPATH}:/usr/share/java/gridstore-3.0.0.jar:/usr/share/java/gridstore-conf-3.0.0.jar
</pre>




</div>

</div>

<div id="outline-container-4.3" class="outline-3">
<h3 id="sec-4.3"><span class="section-number-3"></span> Writing a client program </h3>
<div class="outline-text-3" id="text-4.3">


<p>
To connect GridDB instance to the client program on client instance, please specify the connection point and user/password in the client program or <b>Client Properties File</b>.
</p>
<p>
When using the client for a single node cluster, please specify the "host" and "port" instead of "notificationAddress" and "notificationPort". On the other hand, when using the client for a multiple node cluster, please specify the "notificationMember" instead of "notificationAddress" and "notificationPort".
</p>
<p>
For details on the NoSQL specifications, please refer to "Class GridStoreFactory" of the <a href="http://griddb.github.io/griddb_nosql/manual/GridDB_API_Reference.html#GridStoreFactory.html__">GridDB API Reference</a> and "Connection method of client" of the  <a href="https://github.com/griddb/griddb_nosql/blob/master/docs/GridDB-3.0.0-CE-RELEASE_NOTES.md">GridDB CE 3.0.0 RELEASE NOTES</a>.
</p>
</div>

</div>

<div id="outline-container-4.4" class="outline-3">
<h3 id="sec-4.4"><span class="section-number-3"></span> Running a sample program </h3>
<div class="outline-text-3" id="text-4.4">


<p>
The installed GridDB sample program is shown below.
</p>



<pre class="example">/usr/griddb-3.0.0/docs/sample/program:
Sample1.java
</pre>




<p>
This sample program is written for multicast connection method. In order to use a unicast or fixed list connection method, we recommend that you use <b>Client Properties File</b> and comment out connection settings in the program.
</p>
<p>
The following lines are needed to comment out of Sample1.java:
</p>



<pre class="example">props.setProperty("notificationAddress", args[0]);
props.setProperty("notificationPort", args[1]);
props.setProperty("clusterName", args[2]);
props.setProperty("user", args[3]);
props.setProperty("password", args[4]);
</pre>




<p>
By including both directories which contain the properties file "gs_client.properties" and the configuration library "gridstore-conf-3.0.0.jar" in the classpath, properties of the file are automatically applied to GridStoreFactory. Connection properties can be changed without editing application codes by using the properties file.
</p>
<p>
<b>Example of gs_client.properties for unicast connection method</b>
</p>



<pre class="example">store.host=172.17.xx.xx
store.port=10001
store.clusterName=yourClusterName
store.user=admin
store.password=yourpassword
</pre>




<p>
<b>Example of gs_client.properties for fixed list connection method</b>
</p>



<pre class="example">store.notificationMember=172.17.xx.xx:10001,172.17.yy.yy:10001,172.17.zz.zz:10001
store.clusterName=yourClusterName
store.user=admin
store.password=yourpassword
</pre>




<p>
Add the directory path including the client properties file to CLASSPATH.
</p>



<pre class="example">$ ls /var/lib/gridstore/client
gs_client.properties
$ export CLASSPATH=${CLASSPATH}:/var/lib/gridstore/client
</pre>




<p>
Compile the program and execute it with the following command.
</p>



<pre class="example">$ javac -d . Sample1.java
$ java gsSample/Sample1
</pre>





</div>
</div>
</div>
</div>
</div>
<!-- / main -->

<?php get_footer(); ?>
