Use PTK to install MogDB 3.0 on Oracle Enterprise Linux 8.6

Which MogDB version and OS version was supported?

[root@localhost ~]# ptk candidate mogdb-server
  software   | version  
---------------+----------
MogDB-Server | 3.0.0    
              | 2.1.1    
              | 2.0.3    
              | 2.0.1    
              | 2.0.0    
[root@localhost ~]# ptk candidate os
software |           version              
-----------+---------------------------------
OS       | UOS 20 (arm64)                  
          | UOS 20 (x86_64)                
          | CentOS 8 (arm64)                
          | CentOS 7 (x86_64)              
          | CentOS 8 (x86_64)              
          | EulerOS 2 (arm64)              
          | EulerOS 2 (x86_64)                            
          | Kylin V10 (arm64)              
          | Kylin V10 (x86_64)              
          | Oracle Linux Server 7 (x86_64)  
          | Oracle Linux Server 8 (x86_64)  
          | openEuler 20 (arm64)            
          | openEuler 22 (arm64)            
          | openEuler 20 (x86_64)          
          | openEuler 22 (x86_64)          
          | RedHat 7 (x86_64)              
          | Rocky Linux 7 (x86_64)          
          | Rocky Linux 8 (x86_64)          
          | SLES 12 (arm64)                
          | Ubuntu 18 (x86_64)            

Which OS version is using?

[root@localhost ~]# cat /etc/os-release 
NAME="Oracle Linux Server"
VERSION="8.6"
ID="ol"
ID_LIKE="fedora"
VARIANT="Server"
VARIANT_ID="server"
VERSION_ID="8.6"
PLATFORM_ID="platform:el8"
PRETTY_NAME="Oracle Linux Server 8.6"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:oracle:linux:8:6:server"
HOME_URL="https://linux.oracle.com/"
BUG_REPORT_URL="https://bugzilla.oracle.com/"

ORACLE_BUGZILLA_PRODUCT="Oracle Linux 8"
ORACLE_BUGZILLA_PRODUCT_VERSION=8.6
ORACLE_SUPPORT_PRODUCT="Oracle Linux"
ORACLE_SUPPORT_PRODUCT_VERSION=8.6

Install PTK

[root@localhost ~]# curl --proto '=https' --tlsv1.2 -sSf https://cdn-mogdb.enmotech.com/ptk/install.sh | sh
info: downloading ptk package
Detected shell: bash
Shell profile: /root/.bash_profile
ptk has been added to PATH in /root/.bash_profile
open a new terminal or source /root/.bash_profile to active it
Installed path: /root/.ptk/bin/ptk
[root@localhost ~]# source /root/.bash_profile

Check OS

Make sure has no “Abnormal” items, all the “WARNING” items can be ignored in testing environment.

Check.

[root@localhost ~]# ptk checkos
INFO[2022-07-04T06:51:04.120] local ip: 192.168.122.21                    
[host 192.168.122.21]: not found package: numactl
Please installed the above missing packages first before do other operations
[PTK-4010] the system does not meet installation requirements

Install numactl.

[root@localhost ~]# dnf install numactl
Oracle Linux 8 BaseOS Latest (x86_64)                                                                                           22 MB/s | 47 MB     00:02    
Oracle Linux 8 Application Stream (x86_64)                                                                                       24 MB/s | 37 MB     00:01    
Latest Unbreakable Enterprise Kernel Release 6 for Oracle Linux 8 (x86_64)                                                       20 MB/s | 50 MB     00:02    
Last metadata expiration check: 0:00:09 ago on Mon 04 Jul 2022 06:52:47 AM EDT.
Dependencies resolved.
================================================================================================================================================================
Package                           Architecture                     Version                                   Repository                                   Size
================================================================================================================================================================
Installing:
numactl                           x86_64                           2.0.12-13.el8                             ol8_baseos_latest                           76 k

Transaction Summary
================================================================================================================================================================
Install 1 Package

Total download size: 76 k
Installed size: 161 k
Is this ok [y/N]: y
Downloading Packages:
numactl-2.0.12-13.el8.x86_64.rpm                                                                                               637 kB/s | 76 kB     00:00    
----------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                           624 kB/s | 76 kB     00:00    
Oracle Linux 8 BaseOS Latest (x86_64)                                                                                           3.0 MB/s | 3.1 kB     00:00    
Importing GPG key 0xAD986DA3:
Userid     : "Oracle OSS group (Open Source Software group) <build@oss.oracle.com>"
Fingerprint: 76FD 3DB1 3AB6 7410 B89D B10E 8256 2EA9 AD98 6DA3
From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
Is this ok [y/N]: y
Key imported successfully
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing       :                                                                                                                                       1/1
Installing       : numactl-2.0.12-13.el8.x86_64                                                                                                           1/1
Running scriptlet: numactl-2.0.12-13.el8.x86_64                                                                                                           1/1
Verifying       : numactl-2.0.12-13.el8.x86_64                                                                                                           1/1

Installed:
numactl-2.0.12-13.el8.x86_64                                                                                                                                  

Complete!

Check again.

[root@localhost ~]# ptk checkos
INFO[2022-07-04T06:53:27.021] local ip: 192.168.122.21                    
INFO[2022-07-04T06:53:36.264] platform: ol_8.6_64bit                       host=192.168.122.21
INFO[2022-07-04T06:53:36.268] kernel version: 5.4.17-2136.307.3.1.el8uek.x86_64 host=192.168.122.21
INFO[2022-07-04T06:53:36.359] locale: LANG=en_US.UTF-8                     host=192.168.122.21
INFO[2022-07-04T06:53:36.364] timezone: -0400                               host=192.168.122.21
INFO[2022-07-04T06:53:36.368] swap memory 2154492kB, total memory 1734880kB host=192.168.122.21
WARN[2022-07-04T06:53:36.382] net.ipv4.tcp_tw_reuse=2, expect 1             host=192.168.122.21
WARN[2022-07-04T06:53:36.389] net.ipv4.tcp_retries1=3, expect 5             host=192.168.122.21
WARN[2022-07-04T06:53:36.394] net.ipv4.tcp_max_syn_backlog=128, expect 65535 host=192.168.122.21
WARN[2022-07-04T06:53:36.398] net.ipv4.tcp_syn_retries=6, expect 5         host=192.168.122.21
WARN[2022-07-04T06:53:36.402] net.core.wmem_max=212992, expect 21299200     host=192.168.122.21
WARN[2022-07-04T06:53:36.406] net.core.wmem_default=212992, expect 21299200 host=192.168.122.21
WARN[2022-07-04T06:53:36.410] net.ipv4.tcp_max_tw_buckets=8192, expect 10000 host=192.168.122.21
WARN[2022-07-04T06:53:36.414] net.core.rmem_default=212992, expect 21299200 host=192.168.122.21
WARN[2022-07-04T06:53:36.418] kernel.sem=32000 1024000000 500 32000, expect 250 6400000 1000 25600 host=192.168.122.21
WARN[2022-07-04T06:53:36.435] net.core.netdev_max_backlog=1000, expect 65535 host=192.168.122.21
WARN[2022-07-04T06:53:36.438] net.core.rmem_max=212992, expect 21299200     host=192.168.122.21
WARN[2022-07-04T06:53:36.448] vm.min_free_kbytes=45056, expect 86744       host=192.168.122.21
WARN[2022-07-04T06:53:36.457] net.ipv4.tcp_keepalive_intvl=75, expect 30   host=192.168.122.21
WARN[2022-07-04T06:53:36.461] net.ipv4.tcp_rmem=4096 131072 6291456, expect 8192 250000 16777216 host=192.168.122.21
WARN[2022-07-04T06:53:36.473] net.core.somaxconn=4096, expect 65535         host=192.168.122.21
WARN[2022-07-04T06:53:36.478] net.ipv4.tcp_keepalive_time=7200, expect 30   host=192.168.122.21
WARN[2022-07-04T06:53:36.481] net.ipv4.tcp_retries2=15, expect 12           host=192.168.122.21
WARN[2022-07-04T06:53:36.490] net.ipv4.tcp_wmem=4096 16384 4194304, expect 8192 250000 16777216 host=192.168.122.21
WARN[2022-07-04T06:53:36.637] device(/dev/vda) readahead value=8192, expect 16384. host=192.168.122.21
WARN[2022-07-04T06:53:36.661] device(sr0) 'IO Request'=64, expect 512       host=192.168.122.21
WARN[2022-07-04T06:53:36.661] device(vda) 'IO Request'=256, expect 512     host=192.168.122.21
WARN[2022-07-04T06:53:36.661] device(dm-0) 'IO Request'=128, expect 512     host=192.168.122.21
WARN[2022-07-04T06:53:36.661] device(dm-1) 'IO Request'=128, expect 512     host=192.168.122.21
WARN[2022-07-04T06:53:36.669] device(vda) 'IO scheduler'='none', expect 'mq-deadline' host=192.168.122.21
WARN[2022-07-04T06:53:36.681] not found network conf file for enp1s0 in dir /etc/sysconfig/network, skip check bonding host=192.168.122.21
WARN[2022-07-04T06:53:36.710] network card(enp1s0): mtu=1500, expect 8192   host=192.168.122.21
ERRO[2022-07-04T06:53:36.721] transparent_hugepage status is 'always', expect 'never' host=192.168.122.21
INFO[2022-07-04T06:53:45.839] write fix os script to root_fix_os.sh successfully
INFO[2022-07-04T06:53:45.839] all checkers finished                        
# Check Results
              Item               | Level    
------------------------------------+-----------
A1.Check_OS_Version               | OK        
A2.Check_Kernel_Version           | OK        
A3.Check_Unicode                 | OK        
A4.Check_TimeZone                 | OK        
A5.Check_Swap_Memory_Configure   | Warning  
A6.Check_SysCtl_Parameter         | Warning  
A7.Check_FileSystem_Configure     | OK        
A8.Check_Disk_Configure           | OK        
A9.Check_BlockDev_Configure       | Warning  
A9.Check_Logical_Block           | OK        
A10.Check_IO_Configure           | Warning  
A10.Check_IO_Request             | Warning  
A10.Check_Asynchronous_IO_Request | OK        
A11.Check_Network_Configure       | Warning  
A12.Check_Time_Consistency       | OK        
A13.Check_Firewall_Service       | OK        
A14.Check_THP_Service             | Abnormal  
A15.Check_Dependent_Package       | Warning  
A16.Check_CPU_Instruction_Set     | OK        
Total count 19, abnormal count 1, warning count 7

Failed to check os, can’t perform installation unless fix all the abnormal items
You can use 'ptk checkos -i ITEM --detail' to see detail message
Please check root_fix_os.sh for commands to resolve.

Disable TPH. the command can be find in root_fix_os.sh generated by PTK.

[root@localhost ~]# [ -f /sys/kernel/mm/transparent_hugepage/enabled ] && echo 'never' | sudo tee /sys/kernel/mm/transparent_hugepage/enabled
never

Check again.

[root@localhost ~]# ptk checkos
INFO[2022-07-04T06:57:55.973] local ip: 192.168.122.21                    
INFO[2022-07-04T06:58:05.230] platform: ol_8.6_64bit                       host=192.168.122.21
INFO[2022-07-04T06:58:05.234] kernel version: 5.4.17-2136.307.3.1.el8uek.x86_64 host=192.168.122.21
INFO[2022-07-04T06:58:05.324] locale: LANG=en_US.UTF-8                     host=192.168.122.21
INFO[2022-07-04T06:58:05.329] timezone: -0400                               host=192.168.122.21
INFO[2022-07-04T06:58:05.333] swap memory 2154492kB, total memory 1734880kB host=192.168.122.21
WARN[2022-07-04T06:58:05.338] net.core.wmem_max=212992, expect 21299200     host=192.168.122.21
WARN[2022-07-04T06:58:05.342] net.ipv4.tcp_max_tw_buckets=8192, expect 10000 host=192.168.122.21
WARN[2022-07-04T06:58:05.355] net.core.netdev_max_backlog=1000, expect 65535 host=192.168.122.21
WARN[2022-07-04T06:58:05.359] net.ipv4.tcp_retries1=3, expect 5             host=192.168.122.21
WARN[2022-07-04T06:58:05.362] net.ipv4.tcp_wmem=4096 16384 4194304, expect 8192 250000 16777216 host=192.168.122.21
WARN[2022-07-04T06:58:05.366] net.core.wmem_default=212992, expect 21299200 host=192.168.122.21
WARN[2022-07-04T06:58:05.378] kernel.sem=32000 1024000000 500 32000, expect 250 6400000 1000 25600 host=192.168.122.21
WARN[2022-07-04T06:58:05.382] net.ipv4.tcp_max_syn_backlog=128, expect 65535 host=192.168.122.21
WARN[2022-07-04T06:58:05.392] net.core.somaxconn=4096, expect 65535         host=192.168.122.21
WARN[2022-07-04T06:58:05.396] net.core.rmem_max=212992, expect 21299200     host=192.168.122.21
WARN[2022-07-04T06:58:05.399] net.core.rmem_default=212992, expect 21299200 host=192.168.122.21
WARN[2022-07-04T06:58:05.408] net.ipv4.tcp_tw_reuse=2, expect 1             host=192.168.122.21
WARN[2022-07-04T06:58:05.412] net.ipv4.tcp_keepalive_time=7200, expect 30   host=192.168.122.21
WARN[2022-07-04T06:58:05.416] net.ipv4.tcp_rmem=4096 131072 6291456, expect 8192 250000 16777216 host=192.168.122.21
WARN[2022-07-04T06:58:05.420] net.ipv4.tcp_syn_retries=6, expect 5         host=192.168.122.21
WARN[2022-07-04T06:58:05.432] net.ipv4.tcp_keepalive_intvl=75, expect 30   host=192.168.122.21
WARN[2022-07-04T06:58:05.437] net.ipv4.tcp_retries2=15, expect 12           host=192.168.122.21
WARN[2022-07-04T06:58:05.452] vm.min_free_kbytes=45056, expect 86744       host=192.168.122.21
WARN[2022-07-04T06:58:05.586] device(/dev/vda) readahead value=8192, expect 16384. host=192.168.122.21
WARN[2022-07-04T06:58:05.609] device(dm-0) 'IO Request'=128, expect 512     host=192.168.122.21
WARN[2022-07-04T06:58:05.609] device(dm-1) 'IO Request'=128, expect 512     host=192.168.122.21
WARN[2022-07-04T06:58:05.609] device(sr0) 'IO Request'=64, expect 512       host=192.168.122.21
WARN[2022-07-04T06:58:05.609] device(vda) 'IO Request'=256, expect 512     host=192.168.122.21
WARN[2022-07-04T06:58:05.616] device(vda) 'IO scheduler'='none', expect 'mq-deadline' host=192.168.122.21
WARN[2022-07-04T06:58:05.627] not found network conf file for enp1s0 in dir /etc/sysconfig/network, skip check bonding host=192.168.122.21
WARN[2022-07-04T06:58:05.653] network card(enp1s0): mtu=1500, expect 8192   host=192.168.122.21
INFO[2022-07-04T06:58:14.838] write fix os script to root_fix_os.sh successfully
INFO[2022-07-04T06:58:14.839] all checkers finished                        
# Check Results
              Item               | Level  
------------------------------------+----------
A1.Check_OS_Version               | OK      
A2.Check_Kernel_Version           | OK      
A3.Check_Unicode                 | OK      
A4.Check_TimeZone                 | OK      
A5.Check_Swap_Memory_Configure   | Warning  
A6.Check_SysCtl_Parameter         | Warning  
A7.Check_FileSystem_Configure     | OK      
A8.Check_Disk_Configure           | OK      
A9.Check_BlockDev_Configure       | Warning  
A9.Check_Logical_Block           | OK      
A10.Check_Asynchronous_IO_Request | OK      
A10.Check_IO_Configure           | Warning  
A10.Check_IO_Request             | Warning  
A11.Check_Network_Configure       | Warning  
A12.Check_Time_Consistency       | OK      
A13.Check_Firewall_Service       | OK      
A14.Check_THP_Service             | OK      
A15.Check_Dependent_Package       | Warning  
A16.Check_CPU_Instruction_Set     | OK      
Total count 19, abnormal count 0, warning count 7

Generate config file

If this is the newly installation in a new OS, no need to modify anything, just keep all the default settings.

[root@localhost ~]# ptk template --local > config.yaml
[root@localhost ~]# cat config.yaml
global:
# # cluster name (required)
cluster_name: "cluster_xWsybr"
# # system user for running db
user: "omm"
# # system user group, same as username if not given
group: "omm"
# # base directory for install MogDB server,
# # if any of app_dir,data_dir,log_dir and tool_dir not config,
# # PTK will create corresponding directory under base_dir
base_dir: "/opt/mogdb"

db_servers:
- host: "127.0.0.1"
  # # database port
  db_port: 26000

Install MogDB 3.0

PTK will download MogDB for openEuler image in all the Fedora like OS from version 8. Please make sure you are using the latest ptk by using ptk self upgrade. PTK is being developed very actively, Upgrading PTK every few days is recommend.

[root@localhost ~]# ptk self upgrade
INFO[2022-07-04T08:29:16.082] start download ptk_linux_x86_64.tar.gz      
> download ptk_linux_x86_64.t...: 3.93 MiB / 3.93 MiB [------------------------------------------------------------------------------] 100.00% 3.83 MiB p/s 1.2s
INFO[2022-07-04T08:29:22.006] download ptk_linux_x86_64.tar.gz successfully
INFO[2022-07-04T08:29:22.122] upgrade ptk successfully  

[root@localhost ~]# ptk -v
PTK Version: v0.2.2
Go Version: go1.17.1
Build Date: 2022-07-04T12:18:21Z
Git Hash: 5959dd0
[root@localhost ~]# ptk install -f config.yaml
Please enter db password (8~16 characters):
Retype db password:
=============================
global:
cluster_name: cluster_xWsybr
user: omm
group: omm
app_dir: /opt/mogdb/app
data_dir: /opt/mogdb/data
log_dir: /opt/mogdb/log
tool_dir: /opt/mogdb/tool
tmp_dir: /opt/mogdb/tmp
db_servers:
- host: 192.168.122.21
db_port: 26000
role: primary
az_name: AZ1
az_priority: 1

=============================
Is cluster topo correct?[Y|Yes](default=N) Y
INFO[2022-07-04T08:32:54.640] no package specified, use online package: https://cdn-mogdb.enmotech.com/mogdb-media/3.0.0/MogDB-3.0.0-openEuler-x86_64.tar.gz
INFO[2022-07-04T08:32:54.641] downloading package...                      
> download MogDB-3.0.0-openEu...: 134.20 MiB / 134.20 MiB [---------------------------------------------------------------------------] 100.00% 9.02 MiB p/s 15s
INFO[2022-07-04T08:33:13.597] download package successfully                
WARN[2022-07-04T08:33:14.463] vendor does not provide sha256 file for MogDB-3.0.0-openEuler-64bit-Libpq, skip validate
WARN[2022-07-04T08:33:14.529] vendor does not provide sha256 file for MogDB-3.0.0-openEuler-64bit-tools, skip validate
INFO[2022-07-04T08:33:14.871] the installation package files are safe      
INFO[2022-07-04T08:33:14.871] parse version.cfg from MogDB-3.0.0-openEuler-64bit.tar.gz
INFO[2022-07-04T08:33:17.386] detected db version: MogDB-3.0.0, number: 92.605, commit_id: 62408a0f
WARN[2022-07-04T08:33:17.394] the number of instances is less than 3, CM will not be installed
INFO[2022-07-04T08:33:17.394] start check operating system                
INFO[2022-07-04T08:33:17.394] local ip: 192.168.122.21                    
INFO[2022-07-04T08:33:26.605] platform: ol_8.6_64bit                       host=192.168.122.21
INFO[2022-07-04T08:33:26.610] kernel version: 5.4.17-2136.307.3.1.el8uek.x86_64 host=192.168.122.21
INFO[2022-07-04T08:33:26.702] locale: LANG=en_US.UTF-8                     host=192.168.122.21
INFO[2022-07-04T08:33:26.708] timezone: -0400                               host=192.168.122.21
INFO[2022-07-04T08:33:26.714] swap memory 2154492kB, total memory 1734880kB host=192.168.122.21
WARN[2022-07-04T08:33:26.724] net.ipv4.tcp_syn_retries=6, expect 5         host=192.168.122.21
WARN[2022-07-04T08:33:26.735] net.ipv4.tcp_rmem=4096 131072 6291456, expect 8192 250000 16777216 host=192.168.122.21
WARN[2022-07-04T08:33:26.744] net.ipv4.tcp_max_syn_backlog=128, expect 65535 host=192.168.122.21
WARN[2022-07-04T08:33:26.754] net.core.rmem_max=212992, expect 21299200     host=192.168.122.21
WARN[2022-07-04T08:33:26.759] net.core.wmem_default=212992, expect 21299200 host=192.168.122.21
WARN[2022-07-04T08:33:26.764] net.core.rmem_default=212992, expect 21299200 host=192.168.122.21
WARN[2022-07-04T08:33:26.776] vm.min_free_kbytes=45056, expect 86744       host=192.168.122.21
WARN[2022-07-04T08:33:26.790] net.ipv4.tcp_keepalive_intvl=75, expect 30   host=192.168.122.21
WARN[2022-07-04T08:33:26.800] net.ipv4.tcp_retries2=15, expect 12           host=192.168.122.21
WARN[2022-07-04T08:33:26.804] net.core.wmem_max=212992, expect 21299200     host=192.168.122.21
WARN[2022-07-04T08:33:26.809] net.ipv4.tcp_keepalive_time=7200, expect 30   host=192.168.122.21
WARN[2022-07-04T08:33:26.813] net.ipv4.tcp_retries1=3, expect 5             host=192.168.122.21
WARN[2022-07-04T08:33:26.818] net.ipv4.tcp_wmem=4096 16384 4194304, expect 8192 250000 16777216 host=192.168.122.21
WARN[2022-07-04T08:33:26.823] net.core.somaxconn=4096, expect 65535         host=192.168.122.21
WARN[2022-07-04T08:33:26.832] net.ipv4.tcp_max_tw_buckets=8192, expect 10000 host=192.168.122.21
WARN[2022-07-04T08:33:26.844] net.core.netdev_max_backlog=1000, expect 65535 host=192.168.122.21
WARN[2022-07-04T08:33:26.848] kernel.sem=32000 1024000000 500 32000, expect 250 6400000 1000 25600 host=192.168.122.21
WARN[2022-07-04T08:33:26.857] net.ipv4.tcp_tw_reuse=2, expect 1             host=192.168.122.21
WARN[2022-07-04T08:33:26.993] device(/dev/vda) readahead value=8192, expect 16384. host=192.168.122.21
WARN[2022-07-04T08:33:27.018] device(vda) 'IO Request'=256, expect 512     host=192.168.122.21
WARN[2022-07-04T08:33:27.018] device(dm-0) 'IO Request'=128, expect 512     host=192.168.122.21
WARN[2022-07-04T08:33:27.018] device(dm-1) 'IO Request'=128, expect 512     host=192.168.122.21
WARN[2022-07-04T08:33:27.018] device(sr0) 'IO Request'=64, expect 512       host=192.168.122.21
WARN[2022-07-04T08:33:27.026] device(vda) 'IO scheduler'='none', expect 'mq-deadline' host=192.168.122.21
WARN[2022-07-04T08:33:27.082] network card(enp1s0): mtu=1500, expect 8192   host=192.168.122.21
WARN[2022-07-04T08:33:27.102] the firewall service status='enabled', expect 'disabled'. host=192.168.122.21
INFO[2022-07-04T08:33:36.128] [stage=precheck]: start                       host=192.168.122.21
INFO[2022-07-04T08:33:36.128] check core pattern value                     host=192.168.122.21
INFO[2022-07-04T08:33:36.136] check RemoveIPC value                         host=192.168.122.21
INFO[2022-07-04T08:33:36.142] check user 'omm'                             host=192.168.122.21
INFO[2022-07-04T08:33:36.151] check port 26000                             host=192.168.122.21
INFO[2022-07-04T08:33:36.211] port 26000 is free                           host=192.168.122.21
INFO[2022-07-04T08:33:36.212] [stage=precheck]: successful                 host=192.168.122.21
INFO[2022-07-04T08:33:36.212] scp file from /root/.ptk/cache/MogDB-3.0.0-openEuler-x86_64.tar.gz to 192.168.122.21:/tmp/MogDB-3.0.0-openEuler-x86_64.tar.gz host=192.168.122.21
INFO[2022-07-04T08:33:36.316] [stage=initial]: start                       host=192.168.122.21
INFO[2022-07-04T08:33:36.323] total memory(1GB) is less then 4GB, use default guc config host=192.168.122.21
INFO[2022-07-04T08:33:36.323] create os user omm, group omm                 host=192.168.122.21
INFO[2022-07-04T08:33:37.440] set ulimits                                   host=192.168.122.21
INFO[2022-07-04T08:33:37.444] set user omm profiles                         host=192.168.122.21
INFO[2022-07-04T08:33:37.611] add c library /usr/local/lib to /etc/ld.so.conf.d/libc.conf host=192.168.122.21
INFO[2022-07-04T08:33:37.616] mkdir /opt/mogdb/tool                         host=192.168.122.21
INFO[2022-07-04T08:33:37.774] decompress MogDB-3.0.0-openEuler-x86_64.tar.gz to dir /opt/mogdb/tool host=192.168.122.21
INFO[2022-07-04T08:33:38.809] remove files /tmp/MogDB-3.0.0-openEuler-x86_64.tar.gz host=192.168.122.21
INFO[2022-07-04T08:33:38.826] decompress *-om.tar.gz to dir /opt/mogdb/tool host=192.168.122.21
INFO[2022-07-04T08:33:39.228] change /opt/mogdb/tool owner to omm           host=192.168.122.21
INFO[2022-07-04T08:33:39.239] mkdir /opt/mogdb/app                         host=192.168.122.21
INFO[2022-07-04T08:33:39.384] decompress MogDB-3.0.0-openEuler-64bit.tar.gz to dir /opt/mogdb/app host=192.168.122.21
INFO[2022-07-04T08:33:42.089] change /opt/mogdb/app owner to omm           host=192.168.122.21
INFO[2022-07-04T08:33:42.101] mkdir /opt/mogdb/log/gs_profile,/opt/mogdb/log/pg_log,/opt/mogdb/log/pg_audit,/opt/mogdb/log/bin,/opt/mogdb/log/pg_log/dn_6001,/opt/mogdb/log/pg_audit/dn_6001 host=192.168.122.21
INFO[2022-07-04T08:33:43.382] mkdir /opt/mogdb/tmp                         host=192.168.122.21
INFO[2022-07-04T08:33:43.523] save version to /opt/mogdb/app/bin/upgrade_version host=192.168.122.21
INFO[2022-07-04T08:33:43.595] create cluster_manual_start file             host=192.168.122.21
INFO[2022-07-04T08:33:43.660] generate static config to /opt/mogdb/app/bin/cluster_static_config host=192.168.122.21
INFO[2022-07-04T08:33:43.668] change /opt/mogdb/app/bin/cluster_static_config owner to omm host=192.168.122.21
INFO[2022-07-04T08:33:43.672] mkdir /opt/mogdb/data                         host=192.168.122.21
INFO[2022-07-04T08:33:43.812] change /opt/mogdb/data owner to omm           host=192.168.122.21
INFO[2022-07-04T08:33:43.816] initial database                             host=192.168.122.21
INFO[2022-07-04T08:33:59.488] set 192.168.122.21 postgresql.conf           host=192.168.122.21
INFO[2022-07-04T08:33:59.603] set 192.168.122.21 hba config                 host=192.168.122.21
INFO[2022-07-04T08:33:59.684] [stage=initial]: successful                   host=192.168.122.21
INFO[2022-07-04T08:33:59.684] [stage=launch]: start                         host=192.168.122.21
INFO[2022-07-04T08:33:59.684] start 192.168.122.21 database by gs_ctl       host=192.168.122.21
INFO[2022-07-04T08:34:00.805] alter initial user password                   host=192.168.122.21
INFO[2022-07-04T08:34:00.981] [stage=launch]: successful                   host=192.168.122.21
      host     | stage |   status     | message  
-----------------+--------+---------------+----------
192.168.122.21 | launch | start_success | success  
[root@localhost ~]# ptk ls
  cluster_name |     instances       | user |   data_dir     | db_version  
-----------------+----------------------+------+-----------------+--------------
cluster_xWsybr | 192.168.122.21:26000 | omm | /opt/mogdb/data | MogDB-3.0.0  
[root@localhost ~]# ptk cluster status -n cluster_xWsybr

[   Cluster State   ]

database_version : MogDB-3.0.0
cluster_name : cluster_xWsybr
cluster_state   : Normal
current_az     : AZ_ALL

[ Datanode State   ]

  id |       ip       | port | user | instance | db_role | state  
-------+----------------+-------+------+----------+---------+---------
6001 | 192.168.122.21 | 26000 | omm | dn_6001 | Normal | Normal  

Install and use mogila sample database

It maybe takes more than 1 minute to complete the entire data manipulation works depending on the system configuration.

[root@localhost ~]# su - omm
[omm@localhost ~]$ git clone https://gitee.com/enmotech/mogila.git
Cloning into 'mogila'...
remote: Enumerating objects: 145, done.
remote: Counting objects: 100% (3/3), done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 145 (delta 0), reused 0 (delta 0), pack-reused 142
Receiving objects: 100% (145/145), 4.25 MiB | 1.88 MiB/s, done.
Resolving deltas: 100% (73/73), done.
[omm@localhost ~]$ cd mogila/
[omm@localhost mogila]$ gsql -d postgres -p 26000 -c "create database mogila DBCOMPATIBILITY='PG'"
CREATE DATABASE
[omm@localhost mogila]$ gsql -d postgres -p 26000 -c "create user mogdb password 'Enmo@123'"
CREATE ROLE
[omm@localhost mogila]$ gsql -d postgres -p 26000 -c "alter user mogdb with sysadmin"
ALTER ROLE
[omm@localhost mogila]$ gsql -d mogila -p 26000 -f mogila-insert-data.sql
total time: 89570 ms
[omm@localhost mogila]$
[omm@localhost mogila]$ gsql -d mogila -p 26000 -U mogdb -W Enmo@123 -r
gsql ((MogDB 3.0.0 build 62408a0f) compiled at 2022-06-30 14:21:32 commit 0 last mr )
Non-SSL connection (SSL connection is recommended when requiring high-security)
Type "help" for help.

mogila=> select version();
                                                                    version                                                                      
--------------------------------------------------------------------------------------------------------------------------------------------------
(MogDB 3.0.0 build 62408a0f) compiled at 2022-06-30 14:21:32 commit 0 last mr   on x86_64-unknown-linux-gnu, compiled by g++ (GCC) 7.3.0, 64-bit
(1 row)

Install compat-tools to get more Oracle database compatibilities

[omm@localhost ~]$ cd
[omm@localhost ~]$ git clone https://gitee.com/enmotech/compat-tools.git
Cloning into 'compat-tools'...
remote: Enumerating objects: 1100, done.
remote: Counting objects: 100% (208/208), done.
remote: Compressing objects: 100% (190/190), done.
remote: Total 1100 (delta 138), reused 35 (delta 18), pack-reused 892
Receiving objects: 100% (1100/1100), 1.45 MiB | 1.95 MiB/s, done.
Resolving deltas: 100% (698/698), done.

[omm@localhost ~]$ cd compat-tools/
[omm@localhost compat-tools]$ gsql -d mogila -p 26000 -f runMe.sql
gsql:runMe.sql:152: NOTICE:  
gsql:runMe.sql:152: NOTICE: -- =====================================================================
gsql:runMe.sql:152: NOTICE: -- Test Summary:
gsql:runMe.sql:152: NOTICE: -- =====================================================================
gsql:runMe.sql:152: NOTICE:     | result_type | case_count | start_time         | complete_time       |
gsql:runMe.sql:152: NOTICE:     |-------------|------------|---------------------|---------------------|
gsql:runMe.sql:152: NOTICE:     | PASSED     |       521 | 2022-07-04 13:10:49 | 2022-07-04 13:10:52 |
gsql:runMe.sql:152: NOTICE:  
gsql:runMe.sql:152: NOTICE: -- =====================================================================
gsql:runMe.sql:152: NOTICE: -- Test Detail (Failed or Null):
gsql:runMe.sql:152: NOTICE: -- =====================================================================
gsql:runMe.sql:152: NOTICE: -- <<< ALL SUCCEED >>>
ANONYMOUS BLOCK EXECUTE
total time: 4461 ms

[omm@localhost compat-tools]$ gsql -d mogila -p 26000 -U mogdb -W Enmo@123 -r
gsql ((MogDB 3.0.0 build 62408a0f) compiled at 2022-06-30 14:21:32 commit 0 last mr )
Non-SSL connection (SSL connection is recommended when requiring high-security)
Type "help" for help.

mogila=> select * from v$version;
                    banner                      
-------------------------------------------------
MogDB 3.0.0 build 62408a0f
compiled at 2022-06-30 14:21:32
Platform architecture: x86_64-unknown-linux-gnu
(3 rows)

mogila=> select table_name,num_rows,partitioned from user_tables;
table_name   | num_rows | partitioned
---------------+----------+-------------
ACTOR         |     200 | NO
CATEGORY     |       16 | NO
CUSTOMER     |     599 | NO
CITY         |     600 | NO
COUNTRY       |     109 | NO
LANGUAGE     |       6 | NO
FILM_ACTOR   |     5462 | NO
FILM_CATEGORY |     1000 | NO
FILM         |     1000 | NO
PAYMENT       |   16049 | YES
INVENTORY     |     4581 | NO
RENTAL       |   16044 | NO
STAFF         |       2 | NO
ADDRESS       |     603 | NO
STORE         |       2 | NO
(15 rows)

mogila=> select dbms_random.value(100,1000) from dual;
    value      
------------------
891.160552715883
(1 row)

mogila-> \q
[omm@localhost compat-tools]$

Leave a Reply

Your email address will not be published. Required fields are marked *