HomeMogDBMogDB StackUqbar
v3.0

Documentation:v3.0

Supported Versions:

Other Versions:

Simple Installation

Installation on a Single Node

This section takes openEuler system as an example to introduce how to install MogDB on a single node.

  1. Create directory, user, group, and authorize them.

    groupadd dbgrp -g 2000
    useradd omm -g 2000 -u 2000
    mkdir -p /opt/software/mogdb
    chown -R omm:dbgrp /opt/software/mogdb
  2. Decompress the MogDB package to the installation directory.

    su - omm
    cd /opt/software/mogdb/
    tar -jxf MogDB-x.x.x-openEuler-64bit.tar.gz -C /opt/software/mogdb/
  3. Go to the simpleInstall directory.

    cd /opt/software/mogdb/simpleInstall
  4. Run the install.sh -w command to install MogDB.

    sh install.sh  -w Enmo@123 &&source ~/.bashrc

    img NOTE:

    • -w: initializes the database password (specified by gs_initdb). This parameter is mandatory for security purposes.

    • -p: specifies the MogDB port number. If the port number is not specified, the default value 5432 is used.

    • -h|--help: displays usage instructions.

    • After the installation, the database name is sgnode (specified by gs_initdb).

    • During installation, if error "the maximum number of SEMMNI is not correct, the current SEMMNI is xxx. Please check it." occurs, run the following command with root user permissions.

      sysctl -w kernel.sem="250 85000 250 330"
    • The installation path of the database directory is /opt/software/mogdb/data/single_node, in which /opt/software/mogdb is the decompression path and data/single_node is the newly created database node directory.

    • After the installation, the database postgres is generated by default. It can be connected upon first connection.

  5. After the installation is complete, check whether the process is normal by using ps and gs_ctl.

    ps ux | grep mogdb
    gs_ctl query -D /opt/software/mogdb/data/single_node

    Run the ps command to display information similar to the following:

    omm      24209 11.9  1.0 1852000 355816 pts/0  Sl   01:54   0:33 /opt/software/mogdb/bin/mogdb -D /opt/software/mogdb/single_node
    omm      20377  0.0  0.0 119880  1216 pts/0    S+   15:37   0:00 grep --color=auto mogdb

    Run the gs_ctl command to display information similar to the following:

    gs_ctl query ,datadir is /opt/software/mogdb/data/single_node
    HA state:
        local_role                     : Normal
        static_connections             : 0
        db_state                       : Normal
        detail_information             : Normal
    
    Senders info:
        No information
    
     Receiver info:
    No information
  6. Use MogDB

    -- Configure PATH
    echo "PATH=/opt/software/mogdb/bin:\$PATH" >> /home/omm/.bash_profile
    source ~/.bash_profile
    -bash: ulimit: open files: cannot modify limit: Operation not permitted
    (The default setting fd available size exceeds the system setting, you can ignore the setting)
    
    -- Login to MogDB
    gsql -d postgres -p 5432 -r
    gsql ((MogDB x.x.x build 56189e20) compiled at 2022-01-07 18:47:53 commit 0 last mr  )
    Non-SSL connection (SSL connection is recommended when requiring high-security)
    Type "help" for help.
    
    mogdb=#

Installation on Primary/Standby Nodes

This section takes openEuler system as an example to introduce how to install MogDB on primary/standby nodes.

  1. Create directory, user, group, and authorize them.

    groupadd dbgrp -g 2000
    useradd omm -g 2000 -u 2000
    mkdir -p /opt/software/mogdb
    chown -R omm:dbgrp /opt/software/mogdb
  2. Decompress the MogDB package to the installation directory.

    su - omm
    cd /opt/software/mogdb/
    tar -jxf MogDB-x.x.x-openEuler-64bit.tar.gz -C /opt/software/mogdb/
  3. Go to the simpleInstall directory.

    cd /opt/software/mogdb/simpleInstall
  4. Run the install.sh -w command to install MogDB.

    sh install.sh  -w Enmo@123  --multinode

    img NOTE:

    • -w: initializes the database password (specified by gs_initdb). This parameter is mandatory for security purposes.
    • -p: specifies the port number of the primary MogDB node. The default value is 5432. The port number of the standby node is that of the primary node plus 200. The default port number is 5632.
    • --multinode: determines whether the installation is performed on a single node or on primary/standby nodes.
    • -h|--help: displays usage instructions.
    • After the installation, the primary database node name is nodename1 and the standby database node name is nodename2.
    • The installation path of the primary database node directory is /opt/software/mogdb/data/master, and that of the standby node directory is /opt/software/mogdb/data/slave, in which /opt/software/mogdb is the decompression path, and data/master(slave) is the newly created database node directory.
  5. After the installation is complete, check whether the process is normal by using ps and gs_ctl.

    ps ux | grep mogdb
    gs_ctl query -D /opt/software/mogdb/data/master

    Run the ps command to display information similar to the following:

    omm  4879 11.8 1.1 2082452 373832 pts/0  Sl   14:26   8:29 /opt/software/mogdb/bin/mogdb -D /opt/software/mogdb/data/master -M primary
    omm  5083  1.1  0.9 1819988 327200 pts/0  Sl   14:26   0:49 /opt/software/mogdb/bin/mogdb -D /opt/software/mogdb/data/slave -M standby
    omm      20377  0.0  0.0 119880  1216 pts/0    S+   15:37   0:00 grep --color=auto mogdb

    Run the gs_ctl command to display information similar to the following:

    gs_ctl query ,datadir is /opt/software/mogdb/data/master
    HA state:
        local_role                     : Primary
        static_connections             : 1
        db_state                       : Normal
        detail_information             : Normal
    
    Senders info:
        sender_pid                     : 5165
        local_role                     : Primary
        peer_role                      : Standby
        peer_state                     : Normal
        state                          : Streaming
        sender_sent_location           : 0/4005148
        sender_write_location          : 0/4005148
        sender_flush_location          : 0/4005148
        sender_replay_location         : 0/4005148
        receiver_received_location     : 0/4005148
        receiver_write_location        : 0/4005148
        receiver_flush_location        : 0/4005148
        receiver_replay_location       : 0/4005148
        sync_percent                   : 100%
        sync_state                     : Sync
        sync_priority                  : 1
        sync_most_available            : Off
        channel                        : 10.244.44.52:27001-->10.244.44.52:35912
    
     Receiver info:
    No information
  6. Use MogDB

    -- Configure PATH
    echo "PATH=/opt/software/mogdb/bin:\$PATH" >> /home/omm/.bash_profile
    source ~/.bash_profile
    -bash: ulimit: open files: cannot modify limit: Operation not permitted
    (The default setting fd available size exceeds the system setting, you can ignore the setting)
    
    -- Login to MogDB
    gsql -d postgres -p 5432 -r
    gsql ((MogDB x.x.x build 56189e20) compiled at 2022-01-07 18:47:53 commit 0 last mr  )
    Non-SSL connection (SSL connection is recommended when requiring high-security)
    Type "help" for help.
    
    mogdb=#
Copyright © 2011-2024 www.enmotech.com All rights reserved.