Skip to content

Altibase Docker Guide#

Overview#

This document describes how to create and service an Altibase container using the Docker images.

This document also describes how to create Altibase Docker images based on Docker version 19.03.2 and create a container for service.

  • Altibase 7.1.1 or later
  • Docker version 19.03.2 or later

Info

For errors and improvements related to this document, please contact the technical support portal or technical support center.

Info

This document is provided for informational purposes only and is subject to change without prior notice. It may contain errors, and Altibase makes no express or implied warranties of any kind, including but not limited to warranties of merchantability or fitness for a particular purpose.

The development, release, and timing of any features or functionality described for Altibase products in this document are at the sole discretion of Altibase.

Altibase may hold patents, trademarks, copyrights, or other intellectual property rights related to the contents of this document.

Overview of Docker#

Docker is a container-based open-source virtual platform provided by Docker, Inc.

Docker technology uses the functions of kernel, such as Cgroups and Namespace, along with the Linux kernel, to separate the processes so that they can run independently, and to facilitate container creation and deployment, image transfer, and image version management processes as well as to execute containers.

This is one of the virtualization technologies, but compared to the existing virtual machine, it does not require a guest OS and is isolated in a processing unit, so that only the necessary amount of CPU and memory is used. Therefore, there is barely any loss due to virtualization.

• Comparison of Docker and Virtual Machine Structure

Reference source: https://www.docker.com/resources/what-container/

The important concepts in Docker are images and containers.

  • Image: it does not change as it contains files and settings required for container execution
    • Base image: Only the basic files or the Linux distribution are installed
    • Docker image: After installing necessary programs, libraries, and sources for the base image, it is made into one file. In this document, an image refers to a Docker image created with one file after installing the Altibase database and necessary libraries on the base image
  • Container: All values added or changed while the image is executed are stored in the container. In other words, when multiple containers are created with the same image, access to the lower image is shared, but each container has its own data.

• Relationship between image and container

Reference source: https://docs.docker.com/

Docker Installation#

This document is based on how to install on Ubuntu Linux.

If it is not ubuntu or centos, install it by referring to the Docker installation page.

The kernel version to run Docker is 3.10.X or later.

Docker requires root privileges. If a non-root user wants to use it without using sudo, add that user to the docker group.

1 Docker installation#

Docker provides scripts that install a Docker package depending on the type of Linux distribution.

### sudo wget -qO- http://get.docker.com/ | sh
or
### curl -fsSL https://get.docker.com/ | sudo sh

2 Check Docker installation#

When the installation is complete, check it using the docker version command.

### docker versionClient: Docker Engine - Community
 Version:           19.03.2
 API version:       1.40
 Go version:        go1.12.8
 Git commit:        6a30dfc
 Built:             Thu Aug 29 05:29:11 2019
 OS/Arch:           linux/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          19.03.2
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.12.8
  Git commit:       6a30dfc
  Built:            Thu Aug 29 05:27:45 2019
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.2.6
  GitCommit:        894b81a4b802e4eb2a91d1ce216b8817763c29fb
 runc:
  Version:          1.0.0-rc8
  GitCommit:        425e105d5a03fabd737a126ad93d62a9eeede87f
 docker-init:
  Version:          0.18.0
  GitCommit:        fec3683

Altibase Docker Image#

Altibase Docker can use images provided by Altibase or can be created and used by users.

Altibase Docker Image Download#

Docker images provided by Altibase can be downloaded from Docker Hub or by using the docker pull command.

The following is how to download the Altibase docker image with the docker pull command.

### docker pull altibase/altibase
Using default tag: latest
latest: Pulling from altibase/altibase
aeb7866da422: Pull complete
749a3f8d8b66: Pull complete
...
f061f1a62f9a: Pull complete
Digest: sha256:089a461f2b033d2c63c04d75cba78fe8e2ca9a75352e195f0199a17532305d17
Status: Downloaded newer image for altibase/altibase:latest
docker.io/altibase/altibase:latest

### docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
ubuntu              18.04               cf0f3ca922e0        4 days ago          64.2MB
...
altibase/altibase   latest              3f217948f26d        10 months ago       1.06GB

Creating Altibase Docker Image#

Here's how the user can create an Altibase Docker Image.

1. Altibase installation#

To create an Altibase Docker image, Altibase has to be installed first.

For a guide on installing Altibase, refer to the Altibase Installation Manual.

2. Docker file configuration#

Docker files are a set of commands that contain how to add packages or data to an image.

The name of the Docker file is Dockerfile, and the path of Dockerfile must be designated at the time of build.

FROM ubuntu:18.04
MAINTAINER ALTIBASE

RUN sed -e '56 i\root\t\t soft\t nofile\t\t 1048576 \nroot\t\t hard\t nofile\t\t 1048576 \nroot\t\t soft\t nproc\t\t unlimited \nroot\t\t hard\t nproc\t\t unlimited \n' -i /etc/security/limits.conf; \
echo "vm.swappiness = 1" >> /etc/sysctl.conf; \
echo "kernel.sem = 20000 32000 512 5029" >> /etc/sysctl.conf;

WORKDIR /home/altibase

COPY set_altibase.env /home/altibase
COPY docker-entrypoint.sh /home/altibase
COPY ./altibase_home /home/altibase/altibase_home

EXPOSE 20300 30300 30310
ENTRYPOINT ["/bin/bash", "/home/altibase/docker-entrypoint.sh"]

3. Writing the initialization script#

The ENTRYPOINT defined in the docker file is a script or command to be executed when the container is started.

The scripts used in the docker files in this document are set_altibase.env for configuration and docker-entrypoint.sh, which is an execution script.

  1. example of docker-entrypoint.sh

    #!/bin/bash. ./set_altibase.env
    #export ALTIBASE_MEM_MAX_DB_SIZE=${MEM_MAX_DB_SIZE}
    export FILE=${FILE}
    if [[ "${USER_ID}" == "" ]]
    then
       USER_ID=sys
       USER_PASSWD=manager
    fi
    function db_create()
    {
    ADMIN="${ALTIBASE_HOME}/bin/isql -u sys -p MANAGER -sysdba -noprompt"
            ${ADMIN} << EOF
    startup process;
    CREATE DATABASE mydb INITSIZE=${DB_SIZE}M NOARCHIVELOG CHARACTER SET ${DB_CHARSET} NATIONAL CHARACTER SET ${NATIONAL_CHARSET};
    shutdown abort;
    quit
    EOF
    }
    function db_start_daemon()
    {
    altibase -n
    }
    function set_replication_port_no()
    {
        if [[ "${MODE}" == "replication" ]]
        then
            cd $ALTIBASE_HOME/conf
            sed -e "s/REPLICATION_PORT_NO                   = 0/REPLICATION_PORT_NO                   = $SLAVE_REP_PORT/g" altibase.properties > temp.file
            mv temp.file altibase.properties
            cd $HOME
        else
            if [[ "${MASTER_REP_PORT}" != "" ]]
            then
                cd $ALTIBASE_HOME/conf
                sed -e "s/REPLICATION_PORT_NO                   = 0/REPLICATION_PORT_NO                   = $MASTER_REP_PORT/g" altibase.properties > temp.file
                mv temp.file altibase.properties
                cd $HOME
            fi
        fi
    }
    if [[ "${MODE}" == "daemon" ]]
    then
        if [[ ! -f "${ALTIBASE_HOME}/dbs/system001.dbf" ]]
        then
            set_replication_port_no
            echo "run altibase with db create"
            db_create
            if [[ ! -f "${FILE}" ]]
            then
                echo "run altibase without script"
            else
                echo "run altibase with create object"
                is -silent -u ${USER_ID} -p ${USER_PASSWD} -f ${FILE}
               server stop
            fi
            db_start_daemon
        else
            if [[ ! -f "${FILE}" ]]
            then
                echo "run altibase without script"
            else
                echo "run altibase with create object"
                is -silent -u ${USER_ID} -p ${USER_PASSWD} -f ${FILE}
                server stop
            fi
            echo "run altibase without db create"
            db_start_daemon
        fi
    elif [[ "${MODE}" == "isql" ]]
    then
        set_replication_port_no
        if [[ ! -f "${ALTIBASE_HOME}/dbs/system001.dbf" ]]
        then
            db_create
            server start
            isql -u ${USER_ID} -p ${USER_PASSWD} -s localhost
        else
            server start
            isql -u ${USER_ID} -p ${USER_PASSWD} -s localhost
        fi
    elif [[ "${MODE}" == "shell" ]]
    then
        set_replication_port_no
        if [[ ! -f "${ALTIBASE_HOME}/dbs/system001.dbf" ]]
        then
            db_create
            server start
            if [[ ! -f "${FILE}" ]]
            then
                /bin/bash
            else
                is -silent -f ${FILE}
                /bin/bash
            fi
        else
            server start
            if [[ ! -f "${FILE}" ]]
            then
                /bin/bash
            else
                isql -silent -u ${USER_ID} -p ${USER_PASSWD} -s localhost -f ${FILE}
                /bin/bash
            fi
        fi
    elif [[ "${MODE}" == "replication" ]]
    then
         set_replication_port_no
        if [[ ! -f "${ALTIBASE_HOME}/dbs/system001.dbf" ]]
        then
            db_create
            server start
            if [[ ! -f "${FILE}" ]]
            then
                /bin/bash
            else
                is -silent -f ${FILE}
                /bin/bash
            fi
        else
            server start
            if [[ ! -f "${FILE}" ]]
            then
                /bin/bash
            else
                isql -silent -u ${USER_ID} -p ${USER_PASSWD} -s localhost -f ${FILE}
                /bin/bash
            fi
        fi
    fi
    
  2. Example of set_altibase.env

    set +u    ## if unbound variable error occurs.export HOSTNAME=`hostname`
    export LOGNAME=$LOGNAME
    
    WHOAMI="who am i"
    export JAVA_HOME=
    
    #############
    $ BASE PATHs
    #############
    if [ "$BASE_PATH" == "" ]; then export BASE_PATH=$PATH; fi
    if [ "$BASE_LIB_PATH" == "" ]; then export BASE_LIB_PATH=$LD_LIBRARY_PATH; fi
    if [ "$BASE_CLASSPATH" == "" ]; then export BASE_CLASSPATH=$CLASSPATH; fi
    export PATH=$BASE_PATH
    export LD_LIBRARY_PATH=$BASE_LIB_PATH
    export CLASSPATH=$BASE_CLASSPATH
    
    #############
    $ BASIC
    #############
    export HOSTNAME=`hostname`
    export OS=`uname`
    #########################################################
    $ PROMPT
    #########################################################
    export PS1="\[\033[31m\]\u@\h:\w\$ \[\033[0m\]"
    umask 0000
    export LANG=C
    
    ################################
    $ OS: LINUX ES60+
    ################################
    export OS_NAME=linux
    export PATH=/usr/local/bin:/usr/bin:/bin:/sbin:$PATH
    export LD_LIBRARY_PATH=/usr/local/lib:/usr/lib:/lib:$LD_LIBRARY_PATH
    
    ## JAVA ##
    export PATH=${JAVA_HOME}/bin:${PATH}
    export CLASSPATH=${JAVA_HOME}/lib:${JAVA_HOME}/jre/lib:$CLASSPATH
    
    #############
    $ ALTIBASE
    #############
    
    export MALLOC_ARENA_MAX=4
    
    export ALTIBASE_HOME=/home/altibase/altibase_home
    export ALTIBASE_NLS_USE=MS949
    export ALTIBASE_PORT_NO=20300  #20300,41001
    export ALTIBASE_MSG=${HOME}/altimsg
    
    export ALTIBASE_LINKER_SQLLEN_SIZE=4 # SET 8 for rp5470
    
    export DB_SIZE=10 #init Memory DB Size (Mbyte)
    #export MEM_MAX_DB_SIZE=4G
    export DB_CHARSET=MS949
    export NATIONAL_CHARSET=UTF8
    
    #############
    $ PATHS
    #############
    #aPath=.:$HOME/app/scripts/bin
    aPath=.:$HOME/app/bin
    aPath=$aPath:${ALTIBASE_HOME}/bin
    export PATH=$aPath:$UNIXODBC_HOME/bin:${PATH}
    
    aLibPath=.
    aLibPath=$aLibPath:${ALTIBASE_HOME}/lib
    export LD_LIBRARY_PATH=$aLibPath:${LD_LIBRARY_PATH}
    export LD_LIBRARY_PATH_64=${LD_LIBRARY_PATH}
    export SHLIB_PATH=${LD_LIBRARY_PATH}
    export CLASSPATH=.:${ALTIBASE_HOME}/lib/Altibase.jar:${CLASSPATH}
    
    alias ls='ls -CF'
    alias ll='ls -l'
    alias lsd='ls -d */'
    alias plist='ps -ef | grep $LOGNAME'
    

4. Creating Docker image#

Docker image is created by using the Docker build.

docker build [OPTIONS] PATH | URL | -OPTIONS :
         --force-rm        Always remove intermediate containers
         --no-cache        Do not use cache when building the image
         --pull            Always attempt to pull a newer version of the image
         -q, --quiet       Suppress the build output and print image ID on success
         --rm              Remove intermediate containers after a successful build (default true)
         -t, --tag list    Name and optionally a tag in the 'name:tag' format

More information about OPTIONS can be found here.

### docker build -t altitest:0.0 ./Sending build context to Docker daemon  721.7MB
Step 1/12 : FROM  ubuntu:18.04
 ---> cf0f3ca922e0
Step 2/12 : MAINTAINER JEONG
 ---> Running in 20b8a511ef81
Removing intermediate container 20b8a511ef81
 ---> f7b43fc90f83
Step 3/12 : RUN useradd -d /home/altibase -s /bin/bash -m altibase; sed -e '56 i\altibase\t\t soft\t nofile\t\t 1048576 \naltibase\t\t hard\t nofile\t\t 1048576 \naltibase\t\t soft\t nproc\t\t unlimited \naltibase\t\t hard\t nproc\t\t unlimited \n' -i /etc/security/limits.conf; echo "vm.swappiness = 1" >> /etc/sysctl.conf; echo "kernel.sem = 20000        32000   512     5029" >> /etc/sysctl.conf;
 ---> Running in 88b3e8fa9508
Removing intermediate container 88b3e8fa9508
 ---> dc1994514a5f
Step 4/12 : COPY set_altibase.env /home/altibase
 ---> a039fabb1003
Step 5/12 : COPY docker-entrypoint.sh /home/altibase
 ---> 3ee3d3eda79b
Step 6/12 : COPY altibase_home /home/altibase/altibase_home
 ---> bafec9edb96b
Step 7/12 : RUN chown -R altibase:altibase /home/altibase/*
 ---> Running in f1913e2d7e32
Removing intermediate container f1913e2d7e32
 ---> e4d56135882f
Step 8/12 : USER altibase
 ---> Running in a1e4f2b96ee3
Removing intermediate container a1e4f2b96ee3
 ---> aad721f27620
Step 9/12 : WORKDIR /home/altibase
 ---> Running in 4081c1fcc20a
Removing intermediate container 4081c1fcc20a
 ---> b8f3497fc294
Step 10/12 : ENV MODE shell
 ---> Running in 9167fee80677
Removing intermediate container 9167fee80677
 ---> af201a060152
Step 11/12 : EXPOSE 20300 30300
 ---> Running in ff0db6b12515
Removing intermediate container ff0db6b12515
 ---> 7a1727561c45
Step 12/12 : ENTRYPOINT ["/bin/bash", "/home/altibase/docker-entrypoint.sh"]
 ---> Running in 1eeccd7174e9
Removing intermediate container 1eeccd7174e9
 ---> 275b96f6ba53
Successfully built 275b96f6ba53
Successfully tagged altitest:0.0

Creating Altibase Service Container#

Creating Container#

When creating a container with a docker image, use the docker run.

docker run [OPTIONS] IMAGE[:TAG|@DIGEST] [COMMAND] [ARG...]OPTIONS :
          -a, --attach list             Attach to STDIN, STDOUT or STDERR
          --cpus decimal                Number of CPUs
          -m, --memory bytes            Memory limit
          -d, --detach                  Run container in background and print container ID
          -e, --env list                Set environment variables
          --env-file list               Read in a file of environment variables
          -i, --interactive             Keep STDIN open even if not attached
          --privileged                  Give extended privileges to this container
          -t, --tty                     Allocate a pseudo-TTY
          -u, --user string             Username or UID (format: [:])
          -v, --volume list             Bind mount a volume
          -w, --workdir string          Working directory inside the container

More information about OPTION can be found here.

1. Creating Container#

To create a container, use it as follows.

### docker run -it -e MODE=shell --name altibase_test altitest:0.0 bash-----------------------------------------------------------------
     Altibase Client Query utility.
     Release Version 7.1.0.1.0
     Copyright 2000, ALTIBASE Corporation or its subsidiaries.
     All Rights Reserved.
-----------------------------------------------------------------
ISQL_CONNECTION = UNIX, SERVER = localhost
[ERR-910FB : Connected to idle instance]
Connecting to the DB server.... Connected.


TRANSITION TO PHASE : PROCESS
Command executed successfully.

DB Info (Page Size     = 32768)
        (Page Count    = 257)
        (Total DB Size = 8421376)
        (DB File Size  = 1073741824)

    Creating MMDB FILES     [SUCCESS]

    Creating Catalog Tables [SUCCESS]

    Creating DRDB FILES     [SUCCESS]

  [SM] Rebuilding Indices [Total Count:0]  [SUCCESS]
 ...

### ls
altibase_home  docker-entrypoint.sh  set_altibase.env
Required Options
-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 inside the container.
shell Run the Altibase database and keep the shell connected inside the container
replication 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 volume in which the host's file system is mounted on a container is used.

The characteristics of the data volume 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.

-v [host directory path]:[container directory path]
or
--mount type=[OPTIONS],source=[host directory path],target=[container directory path]
### docker run -it --name altibase_test \--privileged \
-v ~/work/ALTIBASE_DBS:/home/altibase/altibase_home/dbs \
-v ~/work/ALTIBASE_LOGS:/home/altibase/altibase_home/logs \
altitest:0.0 /bin/bash

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:

    1. Create a single Docker network for replication connection.
    2. Join the master node's container to the created Docker network.
    3. Join the container of the node to be added to the same Docker network as the master node.
  • Replication connection between containers

    1. 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.

      docker network create [OPTIONS] NETWORKOPTIONS :
              --attachable               Enable manual container attachment
              --config-from string       The network from which copying the configuration
              -d, --driver string        Driver to manage the Network (default "bridge")
              --ipv6                     Enable IPv6 networking
              --label list               Set metadata on a network
      
      docker inspect [OPTIONS] NAME|ID [NAME|ID...]
      OPTIONS :
              --format , -f       Format the output using the given Go template
              --size , -s         Display total file sizes if the type is container
              --type              Return JSON for specified type
      

      Create a Docker network with the name isolated_network.
      Check the created network with docker network ls.

      $ docker network create --driver bridge isolated_network2bb4d1dc2fc364ed45e69beb3a8b257f5d0e9cd95b5e4676d819386b32ba88d6
      
      $ docker network ls
      NETWORK ID          NAME                DRIVER              SCOPE
      09929baadcff        bridge              bridge              local
      1963af1259b9        host                host                local
      2bb4d1dc2fc3        isolated_network    bridge              local
      5f3deeb7fcba        none                null                local
      

      Check the details of the created network.

      $ docker inspect 2bb4d1dc2fc3[
          {
              "Name": "isolated_network",
              "Id": "2bb4d1dc2fc364ed45e69beb3a8b257f5d0e9cd95b5e4676d819386b32ba88d6",
              "Created": "2019-10-29T09:50:37.6130865+09:00",
              "Scope": "local",
              "Driver": "bridge",
              "EnableIPv6": false,
              "IPAM": {
                  "Driver": "default",
                  "Options": {},
                  "Config": [
                      {
                          "Subnet": "172.18.0.0/16",
                          "Gateway": "172.18.0.1"
                      }
                  ]
              },
              "Internal": false,
              "Attachable": false,
              "Ingress": false,
              "ConfigFrom": {
                  "Network": ""
              },
              "ConfigOnly": false,
              "Containers": {},
              "Options": {},
              "Labels": {}
          }
      ]
      
    2. Join the Docker network while creating the container of the master node.

      $ docker run -it \--net=isolated_network \
      --hostname=master  \
      -e MODE=shell \
      -e MASTER_REP_PORT=30300 \
      --name altitest_master altitest:0.0 /bin/bash
      
      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.

      $ docker run -it \--net=isolated_network \
      --hostname=slave \
      -e MODE=replication \
      -e MASTER_HOST_NAME=master -e MASTER_DB_PORT=20300 -e MASTER_REP_PORT=30300 \
      -e SLAVE_HOST_NAME=slave -e SLAVE_REP_PORT=30310 \
      --name altitest_slave altitest:0.0 /bin/bash altibase
      
      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 Hostname of the slave node
      -e SLAVE_REP_PORT Replication port number of the slave node
    4. Join the master node's Docker network while creating a container for the slave node.

      $ docker run -it \--net=isolated_network \
      --hostname=slave \
      -e MODE=replication \
      -e MASTER_HOST_NAME=master -e MASTER_DB_PORT=20300 -e MASTER_REP_PORT=30300 \
      -e SLAVE_HOST_NAME=slave -e SLAVE_REP_PORT=30310 \
      --name altitest_slave altitest:0.0 /bin/bash altibase
      
      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 Hostname of the slave node
      -e SLAVE_REP_PORT Replication port number of the slave node
    5. Check the network information.

      $ docker inspect 2bb4d1dc2fc3
      [
          {
              "Name": "isolated_network",
              "Id": "2bb4d1dc2fc364ed45e69beb3a8b257f5d0e9cd95b5e4676d819386b32ba88d6",
              "Created": "2019-10-29T09:50:37.6130865+09:00",
              "Scope": "local",
              "Driver": "bridge",
              "EnableIPv6": false,
              "IPAM": {
                  "Driver": "default",
                  "Options": {},
                  "Config": [
                      {
                          "Subnet": "172.18.0.0/16",
                          "Gateway": "172.18.0.1"
                      }
                  ]
              },
              "Internal": false,
              "Attachable": false,
              "Ingress": false,
              "ConfigFrom": {
                  "Network": ""
              },
              "ConfigOnly": false,
              "Containers": {
                  "0ac2165ddda455343ba2b374f18575bfc8e39f51c7fdfc80bfa49482c76e79fe": {
                      "Name": "altitest_slave",
                      "EndpointID": "db9c1241f322019764f7af4781c359647ec393bfd29a816433e1c3184546b546",
                      "MacAddress": "02:42:ac:12:00:03",
                      "IPv4Address": "172.18.0.3/16",
                      "IPv6Address": ""
                  },
                  "964cd5ff922470b9131a23a399029844525aba39eaa500b9f4f3453b902c8461": {
                      "Name": "altitest_master",
                      "EndpointID": "80390d64486a6eabedc5cbf7e3d2fe9886099cae7678da7a9a55ef64a1130bf4",
                      "MacAddress": "02:42:ac:12:00:02",
                      "IPv4Address": "172.18.0.2/16",
                      "IPv6Address": ""
                  }
              },
              "Options": {},
              "Labels": {}
          }
      ]
      

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#

When connecting to the Altibase server from inside the container, use the isql command

### isql -s localhost -u [user account] -p [user password]# isql -s localhost -u sys -p manager
-----------------------------------------------------------------
     Altibase Client Query utility.
     Release Version 7.1.0.1.0
     Copyright 2000, ALTIBASE Corporation or its subsidiaries.
     All Rights Reserved.
-----------------------------------------------------------------
ISQL_CONNECTION = TCP, SERVER = localhost, PORT_NO = 20300
iSQL>

2. Connect to Altibase server from outside the container#

To connect to the Altibase server outside 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.

### docker psCONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                    NAMES
dbab08cc5be8        altitest:0.0        "/bin/bash /home/alt…"   18 hours ago        Up 18 hours         20300/tcp, 30300/tcp     altibase_test
19d325fa6e26        registry            "/entrypoint.sh /etc…"   2 days ago          Up 2 days           0.0.0.0:5000->5000/tcp   local-registry

### docker inspect altibase_test
[
    {
        "Id": "dbab08cc5be8aac2c005d9f8d1dbc0f0d0569e8c30c59a49fe455cdb06963484",
...
        },
        "NetworkSettings": {
            "Bridge": "",
            "SandboxID": "2436fb93d9e66afe8649a482775c95c14870d09dbee367a5ebd59695f98a0854",
            "HairpinMode": false,
            "LinkLocalIPv6Address": "",
            "LinkLocalIPv6PrefixLen": 0,
            "Ports": {
                "20300/tcp": null,
                "30300/tcp": null
            },
            "SandboxKey": "/var/run/docker/netns/2436fb93d9e6",
            "SecondaryIPAddresses": null,
            "SecondaryIPv6Addresses": null,
            "EndpointID": "8c2c73671de5b3a55251313f8bc6b1c376685e59feb3ed55163ab9692f85983d",
            "Gateway": "172.17.0.1",
            "GlobalIPv6Address": "",
            "GlobalIPv6PrefixLen": 0,
            "IPAddress": "172.17.0.3",
            "IPPrefixLen": 16,
            "IPv6Gateway": "",
            "MacAddress": "02:42:ac:11:00:03",
            "Networks": {
                "bridge": {
                    "IPAMConfig": null,
                    "Links": null,
                    "Aliases": null,
                    "NetworkID": "3b3cdc53d9c0e6ad146b6c7bcc8cb60bcef01ba533fee3fd704e5959a1ef573f",
                    "EndpointID": "8c2c73671de5b3a55251313f8bc6b1c376685e59feb3ed55163ab9692f85983d",
                    "Gateway": "172.17.0.1",
                    "IPAddress": "172.17.0.3",
                    "IPPrefixLen": 16,
                    "IPv6Gateway": "",
                    "GlobalIPv6Address": "",
                    "GlobalIPv6PrefixLen": 0,
                    "MacAddress": "02:42:ac:11:00:03",
                    "DriverOpts": null
                }
            }
        }
    }
]
### isql -s [server IP] -u [user account] -p [user password]# isql -s 172.17.0.3 -u sys -p manager
-----------------------------------------------------------------
     Altibase Client Query utility.
     Release Version 7.1.0.1.0
     Copyright 2000, ALTIBASE Corporation or its subsidiaries.
     All Rights Reserved.
-----------------------------------------------------------------
ISQL_CONNECTION = TCP, SERVER = 172.17.0.3, PORT_NO = 20300
iSQL>

Stopping/Deleting Altibase Service Container#

Stopping Altibase Service Container#

To stop a running container, use the docker stop command. Stopped containers are not deleted and can be rerun with the docker start command.

docker stop [OPTIONS] CONTAINER [CONTAINER...]
Options:
         -t, --time int   Seconds to wait for stop before killing it (default 10)
### docker stop altibase_test
altibase_test

Deleting Altibase Service Container#

To delete a container, the container must be stopped.

When retrieving the container, use the docker ps command. Add the -a option when retrieving the stopped container.

To delete a stopped container, use the docker rm command.

docker ps [OPTIONS]OPTIONS :
          -a, --all             Show all containers (default shows just running)
          -f, --filter filter   Filter output based on conditions provided
          --format string       Pretty-print containers using a Go template
          -n, --last int        Show n last created containers (includes all states) (default -1)
          -l, --latest          Show the latest created container (includes all states)
          --no-trunc            Don't truncate output
          -q, --quiet           Only display numeric IDs
          -s, --size            Display total file sizes

docker rm [OPTIONS] CONTAINER [CONTAINER...]
OPTIONS :
          -f, --force     Force the removal of a running container (uses SIGKILL)
          -l, --link      Remove the specified link
          -v, --volumes   Remove the volumes associated with the container
### docker psCONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                    NAMES
19d325fa6e26        registry            "/entrypoint.sh /etc…"   3 days ago          Up 3 days           0.0.0.0:5000->5000/tcp   local-registry

### docker ps -a
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS                       PORTS                    NAMES
dbab08cc5be8        altitest:0.0        "/bin/bash /home/alt…"   19 hours ago        Exited (137) 2 minutes ago                            altibase_test
6074f9f6876a        305569b058db        "/bin/sh -c 'apt-get…"   19 hours ago        Exited (1) 19 hours ago                               agitated_dirac
7cd392776788        2c7e9ce62325        "/bin/sh -c 'apt-get…"   20 hours ago        Exited (1) 20 hours ago                               sleepy_shamir
2c835abffa8a        399a593362f0        "/bin/sh -c 'useradd…"   21 hours ago        Created                                               great_gould
9f1daafaaf3d        93d6a98de683        "/bin/bash 'useradd …"   2 days ago          Exited (127) 2 days ago                               strange_aryabhata
19d325fa6e26        registry            "/entrypoint.sh /etc…"   3 days ago          Up 3 days                    0.0.0.0:5000->5000/tcp   local-registry

### docker rm altibase_test
altibase_test

### docker ps -a
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS                    PORTS                    NAMES
6074f9f6876a        305569b058db        "/bin/sh -c 'apt-get…"   19 hours ago        Exited (1) 19 hours ago                            agitated_dirac
7cd392776788        2c7e9ce62325        "/bin/sh -c 'apt-get…"   20 hours ago        Exited (1) 20 hours ago                            sleepy_shamir
2c835abffa8a        399a593362f0        "/bin/sh -c 'useradd…"   21 hours ago        Created                                            great_gould
9f1daafaaf3d        93d6a98de683        "/bin/bash 'useradd …"   2 days ago          Exited (127) 2 days ago                            strange_aryabhata
19d325fa6e26        registry            "/entrypoint.sh /etc…"   3 days ago

Reference#

Docker Documentation: https://docs.docker.com/