When creating a container with a docker image, use the docker run.
More information about OPTION can be found here.
1. Creating Container
To create a container, use it as follows.
|-e MODE||daemon||Run the Altibase database as a daemon and maintain a terminal.|
|isql||Run the Altibase database and maintain a connection to isql insider the container.|
|shell||Run the Altibase database and keep the shell connected inside the container|
Use when creating additional nodes for the replication connection. Do not select this option when creating a master node.
2. External volume connection
Docker stores the changed data in the container layer, and this data is also deleted when the container is deleted.
Therefore, in order to ensure data persistence, a data column in which the host's file system is mounted on a container is used.
The characteristics of the data column are as follows.
- Data volume can be reused and shared between containers.
- Data volume can be accessed directly from the host.
- Data volume is essentially independent of the container, so they persist even if the container is deleted.
The method to designate the data volume is as follows.
Replication connection between containers
- Altibase Replication
A function that provides a non-stop operating environment in which the service can be resumed using an alternate server when unexpected shutdown of the server occurs by keeping the same data in both databases by transferring the log of the operating database to another database and executing it again. The manual for replication can be found here.
- The order of replication connections between containers:
- Create a single Docker network for replication connection.
- Join the master node's container to the created Docker network.
- Join the container of the node to be added to the same Docker network as the master node.
- Replication connection between containers
Create Docker network
Docker network is created with the docker network create command
The created network can be checked with the docker network ls command, and details can be checked with the docker inspect command.
Create a Docker network with the name isolated_network.
Check the created network with docker network ls.
Check the details of the created work.
2. Join the Docker network while creating the container of the master node.
Required Options --net Network name on which container will be executed --hostname Hostname -e MASTER_REP_PORT Replication port number
3. Join the master node's Docker network while creating a container for the additional node.
Required options --net Network name on which container will be executed --hostname Hostname -e MASTER_HOST_NAME Hostname of the master node -e MASTER_DB_PORT Service port number of the master node -e MASTER_REP_PORT Replication port number of the master node -e SLAVE_HOST_NAME Hostnmae of the slave node -e SLAVE_REP_PORT Replication port number of the slave node
3. Join the master node's Docker network while creating a container for the slave node.
Required options --net Network name of which container will be executed --hostname Hostname -e MASTER_HOST_NAME Hostname of the master node -e MASTER_DB_PORT Service port number of the master node -e MASTER_REP_PORT Replication port number of the master node -e SLAVE_HOST_NAME Hostname of the slave node -e SLAVE_REP_PORT Replication port number of the slave node
4. Check the network information.
Altibase Database Configuration
- For description and configuration of properties for effectively using the Altibase database, refer to the Altibase Configuration Guide.
- Altibase database configuration and operation instructions and settings can be found in the Altibase Manual.
Altibase Server Connection
1. Connect to Altibase server from inside the container
2. Connect to Altibase server from outside the container
To connect to the Alibase server the container, allocated IP information must be checked and the IP in the -s option of the isql command must be specified.
IP can be checked with the docker inspect command.