Ansible自动化部署安装 单节点 openGauss 5.0.0

测试环境说明

环境信息

操作系统主机名IP备注
CentOS 7.6.1810centos7.6192.168.1.100管理主机
CentOS 7.6.1810testos101192.168.1.101被管理主机1
CentOS 7.6.1810testos102192.168.1.102被管理主机2
CentOS 7.6.1810testos103192.168.1.103被管理主机3
CentOS 7.6.1810testos104192.168.1.104被管理主机4

管理主机上批量创建单节点openGauss数据库

实施步骤

安装ansible

#在192.168.1.100上进行安装Ansible
yum install epel-release -y
yum install ansible –y

[root@centos7 ~]# ansible --version
ansible 2.9.27
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.5 (default, Oct 30 2018, 23:45:53) [GCC 4.8.5 20150623 (Red Hat 4.8.5-36)]
[root@centos7 ~]# 

#配置/etc/ansible/ansible.cfg
[root@centos7 ~]# cat /etc/ansible/ansible.cfg
[defaults]
host_key_checking = False
callback_whitelist = timer,profile_roles,log_plays
log_path = /var/log/ansible.log
strategy = free
bin_ansible_callbacks = True
inventory = /etc/ansible/hosts
[callback_log_plays]
log_folder=/tmp/ansible/hosts/
[root@centos7 ~]# 

配置主机清单

修改主机清单/etc/ansible/hosts,添加主机列表

#主机资源清单
[root@centos7 ansible]# cat /etc/ansible/hosts
192.168.1.101
192.168.1.102
192.168.1.103
192.168.1.104
[openGaussdb]
192.168.1.101
192.168.1.102
192.168.1.103
192.168.1.104
[all:vars]
ansible_ssh_user=root
ansible_ssh_pass=rootroot
[root@centos7 ansible]# 

测试主机连通性

[root@centos7 ~]# ansible all -m ping
Thursday 06 April 2023  03:04:42 +0800 (0:00:00.115)       0:00:00.115 ******** 
Thursday 06 April 2023  03:04:42 +0800 (0:00:00.010)       0:00:00.126 ******** 
Thursday 06 April 2023  03:04:42 +0800 (0:00:00.011)       0:00:00.138 ******** 
Thursday 06 April 2023  03:04:42 +0800 (0:00:00.009)       0:00:00.147 ******** 
192.168.1.101 | SUCCESS => {
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/bin/python"
    }, 
    "changed": false, 
    "ping": "pong"
}
192.168.1.103 | SUCCESS => {
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/bin/python"
    }, 
    "changed": false, 
    "ping": "pong"
}
192.168.1.102 | SUCCESS => {
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/bin/python"
    }, 
    "changed": false, 
    "ping": "pong"
}
192.168.1.104 | SUCCESS => {
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/bin/python"
    }, 
    "changed": false, 
    "ping": "pong"
}
Thursday 06 April 2023  03:04:44 +0800 (0:00:01.510)       0:00:01.658 ******** 
=============================================================================== 
ping -------------------------------------------------------------------- 1.54s
​~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
total ------------------------------------------------------------------- 1.54s
Playbook run took 0 days, 0 hours, 0 minutes, 1 seconds
[root@centos7 ~]# 

创建相关目录

[root@centos7 ~]# cd /etc/ansible/roles/
[root@centos7 roles]# mkdir -p openGauss_Install/{files,vars,tasks,templates}
[root@centos7 roles]# tree openGauss_Install
openGauss_Install
├── files
├── tasks
├── templates
└── vars

4 directories, 0 files
[root@centos7 roles]# 

上述目录主要作用如下:

  • files:存放需要同步到异地服务器的安装文件或者配置文件;
  • tasks:openGauss安装过程需要进行的执行的任务;
  • templates:用于执行openGauss安装的模板文件,一般为脚本;
  • vars:安装openGauss定义的变量;

下载openGauss软件包到files目录

[root@centos7 ~]# cd /etc/ansible/roles/openGauss_Install/files
[root@centos7 files]#  
[root@centos7 files]# wget https://opengauss.obs.cn-south-1.myhuaweicloud.com/5.0.0/x86/openGauss-5.0.0-CentOS-64bit-all.tar.gz
--2023-04-06 00:07:14--  https://opengauss.obs.cn-south-1.myhuaweicloud.com/5.0.0/x86/openGauss-5.0.0-CentOS-64bit-all.tar.gz
Resolving opengauss.obs.cn-south-1.myhuaweicloud.com (opengauss.obs.cn-south-1.myhuaweicloud.com)... 121.37.63.38, 139.159.208.67, 139.159.208.64, ...
Connecting to opengauss.obs.cn-south-1.myhuaweicloud.com (opengauss.obs.cn-south-1.myhuaweicloud.com)|121.37.63.38|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 133071038 (127M) [application/gzip]
Saving to: ‘openGauss-5.0.0-CentOS-64bit-all.tar.gz’

100%[==========================================================================================>] 133,071,038 56.8MB/s   in 2.2s   

2023-04-06 00:07:17 (56.8 MB/s) - ‘openGauss-5.0.0-CentOS-64bit-all.tar.gz’ saved [133071038/133071038]

[root@centos7 files]# 
[root@centos7 files]# ll
total 129956
-rw-r--r--. 1 root root 133071038 Mar 29 20:11 openGauss-5.0.0-CentOS-64bit-all.tar.gz
[root@centos7 files]# 

创建变量文件

[root@centos7 ~]# cat /etc/ansible/roles/openGauss_Install/vars/main.yml
#安装包名称
openGauss_software: openGauss-5.0.0-CentOS-64bit-all.tar.gz
#解压目录
install_dir: /openGauss/software
#omm用户密码
omm_password: openGauss@123
#数据库密码
db_password: openGauss@123
#数据库端口
db_port: 12345
[root@centos7 ~]# 

创建安装时需要的xml文件

[root@centos7 ~]# cat /etc/ansible/roles/openGauss_Install/templates/cluster_config.j2
<?xml version="1.0" encoding="UTF-8"?>
<ROOT>
    <!-- openGauss整体信息 -->
    <CLUSTER>
        <!-- 数据库名称 -->
        <PARAM name="clusterName" value="dbCluster" />
        <!-- 数据库节点名称(hostname) -->
        <PARAM name="nodeNames" value="{{ ansible_hostname }}" />
        <!-- 数据库安装目录-->
        <PARAM name="gaussdbAppPath" value="/openGauss/app" />
        <!-- 日志目录-->
        <PARAM name="gaussdbLogPath" value="/openGauss/log/omm" />
        <!-- 临时文件目录-->
        <PARAM name="tmpMppdbPath" value="/openGauss/tmp" />
        <!-- 数据库工具目录-->
        <PARAM name="gaussdbToolPath" value="/openGauss/om" />
        <!-- 数据库core文件目录-->
        <PARAM name="corePath" value="/openGauss/corefile" />
        <!-- 节点IP,与数据库节点名称列表一一对应 -->
        <PARAM name="backIp1s" value="{{ inventory_hostname }}"/>
    </CLUSTER>
    <!-- 每台服务器上的节点部署信息 -->
    <DEVICELIST>
        <!-- 节点1上的部署信息 -->
        <DEVICE sn="1000001">
            <!-- 节点1的主机名称 -->
            <PARAM name="name" value="{{ ansible_hostname }}"/>
            <!-- 节点1所在的AZ及AZ优先级 -->
            <PARAM name="azName" value="AZ1"/>
            <PARAM name="azPriority" value="1"/>
            <!-- 节点1的IP,如果服务器只有一个网卡可用,将backIP1和sshIP1配置成同一个IP -->
            <PARAM name="backIp1" value="{{ inventory_hostname }}"/>
            <PARAM name="sshIp1" value="{{ inventory_hostname }}"/>

            <!--dbnode-->
            <PARAM name="dataNum" value="1"/>
            <PARAM name="dataPortBase" value="{{ db_port }}"/>
            <PARAM name="dataNode1" value="/openGauss/data/dn1"/>
            <PARAM name="dataNode1_syncNum" value="0"/>
        </DEVICE>
    </DEVICELIST>
</ROOT>
[root@centos7 ~]# 

创建任务文件

[root@centos7 ~]# cat /etc/ansible/roles/openGauss_Install/tasks/main.yml
- name: 关闭防火墙
  service:
     name: firewalld
     state: stopped
     enabled: no
  ignore_errors: true
  tags: 01_os_syscfg
- name: 关闭selinux
  selinux:
     state=disabled
  ignore_errors: true
  tags: 01_os_syscfg
- name: 设置时区
  shell: timedatectl set-timezone Asia/Shanghai
  tags: 01_os_syscfg
- name: 设置字符集
  shell: echo 'export LANG=en_US.UTF8' >> /etc/profile && source /etc/profile
  tags: 01_os_syscfg
- name: 关闭RemoveIPC
  lineinfile:
    path:  /etc/systemd/logind.conf
    state: present
    line: "RemoveIPC=no"
  tags: 01_os_syscfg    
- name: 重启systemd-logind服务
  shell: systemctl daemon-reload && systemctl restart systemd-logind
  tags: 01_os_syscfg
- name: 创建组
  group: name=dbgrp gid=2000
  tags: 02_user_add
- name: 创建用户
  user:
    name=omm  uid=2000 group=dbgrp
  tags: 02_user_add
- name: 修改密码
  shell: echo "{{omm_password}}" | passwd --stdin omm
  tags: 02_user_add
- name: 新建目录
  file: path="{{item}}"  state=directory mode=0755 owner=omm group=dbgrp
  with_items:
      - /openGauss/software
  tags: 03_unzip_db
- name: 上传安装包
  copy: src={{openGauss_software}} dest={{install_dir}}  owner=omm group=dbgrp mode=0644
  tags: install
  tags: 03_unzip_db
- name: "解压软件包"
  shell: cd {{install_dir}} && tar -zxvf *all.tar.gz && tar -zxvf *om.tar.gz
  tags: 03_unzip_db
- name: "安装依赖包"
  yum: name="libaio-devel,flex,bison,ncurses-devel,glibc-devel,patch,redhat-lsb-core,python3,bzip2,readline-devel,net-tools,tar,gcc,gcc-c++" state=installed 
  tags: 04_os_yum
- name: 配置xml文件
  template: src=cluster_config.j2 dest={{install_dir}}/clusterconfig.xml
  tags: 06_config_xml
- name: 执行预安装脚本
  shell: '{{install_dir}}/script/gs_preinstall -U omm -G dbgrp -X {{install_dir}}/clusterconfig.xml --sep-env-file=/home/omm/env --non-interactive'
  register: preinstall
  tags: 07_pre_install
- debug: var=preinstall.stdout_lines
  ignore_errors: true
  tags: 07_pre_install
- name: 检查预安装环境
  shell: '{{install_dir}}/script/gs_checkos -i A -h {{ ansible_hostname }} --detail'
  register: checkos
  tags: 08_check_os
- debug: var=checkos.stdout_lines
  ignore_errors: true
  tags: 08_check_os
- name: 更改权限
  file: path={{install_dir}}  state=directory mode=0755 owner=omm group=dbgrp
  tags: 09_gs_install
- name: 执行gs_install
  shell: su - omm -c "source /home/omm/env;gs_install -X {{install_dir}}/clusterconfig.xml --gsinit-parameter="--pwpasswd={{db_password}}""
  register: gsinstall
  tags: 09_gs_install
- debug: var=gsinstall.stdout_lines
  ignore_errors: true
  tags: 09_gs_install
- name: 启动数据库
  shell: ss -anpt|grep {{ db_port }} && su - omm -c "source /home/omm/env;gs_om -t start "
  tags: 10_db_start
- name: "登录数据库"
  shell: ss -anpt|grep {{ db_port }} && su - omm -c "source /home/omm/env;gsql -d postgres -p{{ db_port }} -r -l"
  tags: 10_db_start
[root@centos7 ~]# 

创建剧本调用文件

[root@centos7 ~]# mkdir -p /etc/ansible/playbook
[root@centos7 ~]# cat /etc/ansible/playbook/InstallopenGauss.yml
---
- name: install openGauss
  hosts: openGaussdb
  remote_user: root
  roles:
    - openGauss_Install
[root@centos7 ~]# 

执行自动化安装

校验语法

[root@centos7 ansible]# ll
total 8
-rw-r--r--. 1 root root 354 Apr  5 21:54 ansible.cfg
-rw-r--r--. 1 root root  76 Apr  5 21:55 hosts
drwxr-xr-x. 2 root root  34 Apr  5 22:04 playbook
drwxr-xr-x. 3 root root  31 Apr  5 21:56 roles
[root@centos7 ansible]# pwd
/etc/ansible
[root@centos7 ansible]# 
#校验playbook
[root@centos7 ansible]# ansible-playbook -C /etc/ansible/playbook/InstallopenGauss.yml
[WARNING]: While constructing a mapping from /etc/ansible/roles/openGauss_Install/tasks/main.yml, line 43, column 3, found a
duplicate dict key (tags). Using last defined value only.

PLAY [install openGauss] ***********************************************************************************************************
Thursday 06 April 2023  03:08:06 +0800 (0:00:00.050)       0:00:00.050 ******** 
Thursday 06 April 2023  03:08:06 +0800 (0:00:00.010)       0:00:00.060 ******** 
Thursday 06 April 2023  03:08:06 +0800 (0:00:00.009)       0:00:00.070 ******** 
Thursday 06 April 2023  03:08:06 +0800 (0:00:00.009)       0:00:00.079 ******** 

TASK [Gathering Facts] *************************************************************************************************************
ok: [192.168.1.103]
Thursday 06 April 2023  03:08:08 +0800 (0:00:01.908)       0:00:01.987 ******** 
ok: [192.168.1.101]
Thursday 06 April 2023  03:08:09 +0800 (0:00:00.213)       0:00:02.201 ******** 
ok: [192.168.1.104]
ok: [192.168.1.102]
Thursday 06 April 2023  03:08:09 +0800 (0:00:00.094)       0:00:02.295 ******** 
Thursday 06 April 2023  03:08:09 +0800 (0:00:00.021)       0:00:02.316 ******** 

TASK [openGauss_Install : 关闭防火墙] ***************************************************************************************************
changed: [192.168.1.101]
changed: [192.168.1.104]
changed: [192.168.1.103]
changed: [192.168.1.102]
Thursday 06 April 2023  03:08:10 +0800 (0:00:00.968)       0:00:03.285 ******** 
Thursday 06 April 2023  03:08:10 +0800 (0:00:00.021)       0:00:03.307 ******** 
Thursday 06 April 2023  03:08:10 +0800 (0:00:00.021)       0:00:03.328 ******** 
Thursday 06 April 2023  03:08:10 +0800 (0:00:00.022)       0:00:03.350 ******** 

TASK [openGauss_Install : 关闭selinux] ***********************************************************************************************
[WARNING]: SELinux state temporarily changed from 'enforcing' to 'permissive'. State change will take effect next reboot.
changed: [192.168.1.102]
Thursday 06 April 2023  03:08:11 +0800 (0:00:00.776)       0:00:04.127 ******** 
changed: [192.168.1.101]
changed: [192.168.1.104]
changed: [192.168.1.103]
Thursday 06 April 2023  03:08:11 +0800 (0:00:00.028)       0:00:04.155 ******** 
Thursday 06 April 2023  03:08:11 +0800 (0:00:00.022)       0:00:04.177 ******** 
Thursday 06 April 2023  03:08:11 +0800 (0:00:00.022)       0:00:04.199 ******** 

TASK [openGauss_Install : 设置时区] ****************************************************************************************************
skipping: [192.168.1.101]
skipping: [192.168.1.104]
skipping: [192.168.1.103]
skipping: [192.168.1.102]
Thursday 06 April 2023  03:08:11 +0800 (0:00:00.487)       0:00:04.687 ******** 
Thursday 06 April 2023  03:08:11 +0800 (0:00:00.021)       0:00:04.708 ******** 
Thursday 06 April 2023  03:08:11 +0800 (0:00:00.022)       0:00:04.730 ******** 
Thursday 06 April 2023  03:08:11 +0800 (0:00:00.022)       0:00:04.753 ******** 

TASK [openGauss_Install : 设置字符集] ***************************************************************************************************
skipping: [192.168.1.101]
Thursday 06 April 2023  03:08:12 +0800 (0:00:00.354)       0:00:05.108 ******** 
skipping: [192.168.1.102]
Thursday 06 April 2023  03:08:12 +0800 (0:00:00.038)       0:00:05.146 ******** 
skipping: [192.168.1.103]
Thursday 06 April 2023  03:08:12 +0800 (0:00:00.028)       0:00:05.174 ******** 
skipping: [192.168.1.104]
Thursday 06 April 2023  03:08:12 +0800 (0:00:00.026)       0:00:05.201 ******** 

TASK [openGauss_Install : 关闭RemoveIPC] *********************************************************************************************
changed: [192.168.1.102]
changed: [192.168.1.101]
changed: [192.168.1.104]
Thursday 06 April 2023  03:08:12 +0800 (0:00:00.472)       0:00:05.673 ******** 
Thursday 06 April 2023  03:08:12 +0800 (0:00:00.021)       0:00:05.695 ******** 
Thursday 06 April 2023  03:08:12 +0800 (0:00:00.022)       0:00:05.717 ******** 
changed: [192.168.1.103]
Thursday 06 April 2023  03:08:12 +0800 (0:00:00.027)       0:00:05.744 ******** 

TASK [openGauss_Install : 重启systemd-logind服务] **************************************************************************************
skipping: [192.168.1.101]
Thursday 06 April 2023  03:08:13 +0800 (0:00:00.353)       0:00:06.098 ******** 
skipping: [192.168.1.102]
Thursday 06 April 2023  03:08:13 +0800 (0:00:00.036)       0:00:06.135 ******** 
skipping: [192.168.1.104]
Thursday 06 April 2023  03:08:13 +0800 (0:00:00.028)       0:00:06.163 ******** 
skipping: [192.168.1.103]
Thursday 06 April 2023  03:08:13 +0800 (0:00:00.025)       0:00:06.189 ******** 

TASK [openGauss_Install : 创建组] *****************************************************************************************************
changed: [192.168.1.101]
Thursday 06 April 2023  03:08:13 +0800 (0:00:00.483)       0:00:06.672 ******** 
changed: [192.168.1.104]
changed: [192.168.1.103]
changed: [192.168.1.102]
Thursday 06 April 2023  03:08:13 +0800 (0:00:00.032)       0:00:06.704 ******** 
Thursday 06 April 2023  03:08:13 +0800 (0:00:00.022)       0:00:06.727 ******** 
Thursday 06 April 2023  03:08:13 +0800 (0:00:00.024)       0:00:06.752 ******** 

TASK [openGauss_Install : 创建用户] ****************************************************************************************************
changed: [192.168.1.101]
Thursday 06 April 2023  03:08:14 +0800 (0:00:00.630)       0:00:07.382 ******** 
changed: [192.168.1.104]
changed: [192.168.1.103]
changed: [192.168.1.102]
Thursday 06 April 2023  03:08:14 +0800 (0:00:00.030)       0:00:07.412 ******** 
Thursday 06 April 2023  03:08:14 +0800 (0:00:00.021)       0:00:07.433 ******** 
Thursday 06 April 2023  03:08:14 +0800 (0:00:00.022)       0:00:07.456 ******** 

TASK [openGauss_Install : 修改密码] ****************************************************************************************************
skipping: [192.168.1.101]
Thursday 06 April 2023  03:08:14 +0800 (0:00:00.386)       0:00:07.843 ******** 
skipping: [192.168.1.102]
Thursday 06 April 2023  03:08:14 +0800 (0:00:00.032)       0:00:07.876 ******** 
skipping: [192.168.1.103]
Thursday 06 April 2023  03:08:14 +0800 (0:00:00.028)       0:00:07.904 ******** 
skipping: [192.168.1.104]
Thursday 06 April 2023  03:08:14 +0800 (0:00:00.028)       0:00:07.933 ******** 

TASK [openGauss_Install : 新建目录] ****************************************************************************************************
changed: [192.168.1.104] => (item=/openGauss/software)
changed: [192.168.1.103] => (item=/openGauss/software)
changed: [192.168.1.102] => (item=/openGauss/software)
changed: [192.168.1.101] => (item=/openGauss/software)
Thursday 06 April 2023  03:08:15 +0800 (0:00:00.728)       0:00:08.661 ******** 
Thursday 06 April 2023  03:08:15 +0800 (0:00:00.022)       0:00:08.684 ******** 
Thursday 06 April 2023  03:08:15 +0800 (0:00:00.022)       0:00:08.707 ******** 
Thursday 06 April 2023  03:08:15 +0800 (0:00:00.024)       0:00:08.731 ******** 

TASK [openGauss_Install : 上传安装包] ***************************************************************************************************
changed: [192.168.1.104]
changed: [192.168.1.101]
changed: [192.168.1.103]
changed: [192.168.1.102]
Thursday 06 April 2023  03:08:16 +0800 (0:00:00.853)       0:00:09.585 ******** 
Thursday 06 April 2023  03:08:16 +0800 (0:00:00.021)       0:00:09.606 ******** 
Thursday 06 April 2023  03:08:16 +0800 (0:00:00.021)       0:00:09.628 ******** 
Thursday 06 April 2023  03:08:16 +0800 (0:00:00.022)       0:00:09.651 ******** 

TASK [openGauss_Install : 解压软件包] ***************************************************************************************************
skipping: [192.168.1.101]
Thursday 06 April 2023  03:08:16 +0800 (0:00:00.402)       0:00:10.053 ******** 
skipping: [192.168.1.102]
Thursday 06 April 2023  03:08:16 +0800 (0:00:00.028)       0:00:10.081 ******** 
skipping: [192.168.1.103]
Thursday 06 April 2023  03:08:17 +0800 (0:00:00.027)       0:00:10.108 ******** 
skipping: [192.168.1.104]
Thursday 06 April 2023  03:08:17 +0800 (0:00:00.026)       0:00:10.135 ******** 

TASK [openGauss_Install : 安装依赖包] ***************************************************************************************************
changed: [192.168.1.103]
Thursday 06 April 2023  03:08:20 +0800 (0:00:03.865)       0:00:14.001 ******** 

TASK [openGauss_Install : 配置xml文件] *************************************************************************************************
changed: [192.168.1.103]
Thursday 06 April 2023  03:08:21 +0800 (0:00:00.428)       0:00:14.429 ******** 

TASK [openGauss_Install : 执行预安装脚本] *************************************************************************************************
skipping: [192.168.1.103]
Thursday 06 April 2023  03:08:21 +0800 (0:00:00.418)       0:00:14.848 ******** 

TASK [openGauss_Install : debug] ***************************************************************************************************
ok: [192.168.1.103] => {
    "preinstall.stdout_lines": "VARIABLE IS NOT DEFINED!"
}
Thursday 06 April 2023  03:08:21 +0800 (0:00:00.078)       0:00:14.926 ******** 

TASK [openGauss_Install : 检查预安装环境] *************************************************************************************************
skipping: [192.168.1.103]
Thursday 06 April 2023  03:08:22 +0800 (0:00:00.416)       0:00:15.343 ******** 

TASK [openGauss_Install : debug] ***************************************************************************************************
ok: [192.168.1.103] => {
    "checkos.stdout_lines": "VARIABLE IS NOT DEFINED!"
}
Thursday 06 April 2023  03:08:22 +0800 (0:00:00.076)       0:00:15.420 ******** 

TASK [openGauss_Install : 更改权限] ****************************************************************************************************
changed: [192.168.1.103]
Thursday 06 April 2023  03:08:22 +0800 (0:00:00.454)       0:00:15.875 ******** 

TASK [openGauss_Install : 执行gs_install] ********************************************************************************************
skipping: [192.168.1.103]
Thursday 06 April 2023  03:08:23 +0800 (0:00:00.464)       0:00:16.339 ******** 

TASK [openGauss_Install : debug] ***************************************************************************************************
ok: [192.168.1.103] => {
    "gsinstall.stdout_lines": "VARIABLE IS NOT DEFINED!"
}
Thursday 06 April 2023  03:08:23 +0800 (0:00:00.075)       0:00:16.414 ******** 

TASK [openGauss_Install : 启动数据库] ***************************************************************************************************
skipping: [192.168.1.103]
Thursday 06 April 2023  03:08:23 +0800 (0:00:00.470)       0:00:16.884 ******** 

TASK [openGauss_Install : 登录数据库] ***************************************************************************************************
skipping: [192.168.1.103]

TASK [openGauss_Install : 安装依赖包] ***************************************************************************************************
changed: [192.168.1.101]
Thursday 06 April 2023  03:10:11 +0800 (0:01:47.230)       0:02:04.115 ******** 
changed: [192.168.1.102]
Thursday 06 April 2023  03:10:11 +0800 (0:00:00.113)       0:02:04.228 ******** 

TASK [openGauss_Install : 配置xml文件] *************************************************************************************************
changed: [192.168.1.101]
Thursday 06 April 2023  03:10:11 +0800 (0:00:00.368)       0:02:04.597 ******** 
changed: [192.168.1.102]
Thursday 06 April 2023  03:10:11 +0800 (0:00:00.116)       0:02:04.713 ******** 

TASK [openGauss_Install : 执行预安装脚本] *************************************************************************************************
skipping: [192.168.1.101]
Thursday 06 April 2023  03:10:11 +0800 (0:00:00.341)       0:02:05.055 ******** 

TASK [openGauss_Install : debug] ***************************************************************************************************
ok: [192.168.1.101] => {
    "preinstall.stdout_lines": "VARIABLE IS NOT DEFINED!"
}
Thursday 06 April 2023  03:10:12 +0800 (0:00:00.074)       0:02:05.130 ******** 

TASK [openGauss_Install : 执行预安装脚本] *************************************************************************************************
skipping: [192.168.1.102]
Thursday 06 April 2023  03:10:12 +0800 (0:00:00.043)       0:02:05.173 ******** 

TASK [openGauss_Install : debug] ***************************************************************************************************
ok: [192.168.1.102] => {
    "preinstall.stdout_lines": "VARIABLE IS NOT DEFINED!"
}
Thursday 06 April 2023  03:10:12 +0800 (0:00:00.075)       0:02:05.249 ******** 

TASK [openGauss_Install : 安装依赖包] ***************************************************************************************************
changed: [192.168.1.104]
Thursday 06 April 2023  03:10:12 +0800 (0:00:00.321)       0:02:05.570 ******** 

TASK [openGauss_Install : 检查预安装环境] *************************************************************************************************
skipping: [192.168.1.101]
Thursday 06 April 2023  03:10:12 +0800 (0:00:00.028)       0:02:05.599 ******** 

TASK [openGauss_Install : debug] ***************************************************************************************************
ok: [192.168.1.101] => {
    "checkos.stdout_lines": "VARIABLE IS NOT DEFINED!"
}
Thursday 06 April 2023  03:10:12 +0800 (0:00:00.076)       0:02:05.675 ******** 

TASK [openGauss_Install : 检查预安装环境] *************************************************************************************************
skipping: [192.168.1.102]
Thursday 06 April 2023  03:10:12 +0800 (0:00:00.048)       0:02:05.723 ******** 

TASK [openGauss_Install : debug] ***************************************************************************************************
ok: [192.168.1.102] => {
    "checkos.stdout_lines": "VARIABLE IS NOT DEFINED!"
}
Thursday 06 April 2023  03:10:12 +0800 (0:00:00.074)       0:02:05.798 ******** 

TASK [openGauss_Install : 配置xml文件] *************************************************************************************************
changed: [192.168.1.104]
Thursday 06 April 2023  03:10:12 +0800 (0:00:00.240)       0:02:06.039 ******** 

TASK [openGauss_Install : 更改权限] ****************************************************************************************************
changed: [192.168.1.101]
Thursday 06 April 2023  03:10:13 +0800 (0:00:00.093)       0:02:06.133 ******** 
changed: [192.168.1.102]
Thursday 06 April 2023  03:10:13 +0800 (0:00:00.115)       0:02:06.248 ******** 

TASK [openGauss_Install : 执行预安装脚本] *************************************************************************************************
skipping: [192.168.1.104]
Thursday 06 April 2023  03:10:13 +0800 (0:00:00.207)       0:02:06.456 ******** 

TASK [openGauss_Install : debug] ***************************************************************************************************
ok: [192.168.1.104] => {
    "preinstall.stdout_lines": "VARIABLE IS NOT DEFINED!"
}
Thursday 06 April 2023  03:10:13 +0800 (0:00:00.069)       0:02:06.526 ******** 

TASK [openGauss_Install : 执行gs_install] ********************************************************************************************
skipping: [192.168.1.101]
Thursday 06 April 2023  03:10:13 +0800 (0:00:00.023)       0:02:06.549 ******** 

TASK [openGauss_Install : debug] ***************************************************************************************************
ok: [192.168.1.101] => {
    "gsinstall.stdout_lines": "VARIABLE IS NOT DEFINED!"
}
Thursday 06 April 2023  03:10:13 +0800 (0:00:00.068)       0:02:06.618 ******** 

TASK [openGauss_Install : 执行gs_install] ********************************************************************************************
skipping: [192.168.1.102]
Thursday 06 April 2023  03:10:13 +0800 (0:00:00.048)       0:02:06.667 ******** 

TASK [openGauss_Install : debug] ***************************************************************************************************
ok: [192.168.1.102] => {
    "gsinstall.stdout_lines": "VARIABLE IS NOT DEFINED!"
}
Thursday 06 April 2023  03:10:13 +0800 (0:00:00.068)       0:02:06.735 ******** 

TASK [openGauss_Install : 检查预安装环境] *************************************************************************************************
skipping: [192.168.1.104]
Thursday 06 April 2023  03:10:13 +0800 (0:00:00.202)       0:02:06.938 ******** 

TASK [openGauss_Install : debug] ***************************************************************************************************
ok: [192.168.1.104] => {
    "checkos.stdout_lines": "VARIABLE IS NOT DEFINED!"
}
Thursday 06 April 2023  03:10:13 +0800 (0:00:00.069)       0:02:07.008 ******** 

TASK [openGauss_Install : 启动数据库] ***************************************************************************************************
skipping: [192.168.1.101]
Thursday 06 April 2023  03:10:13 +0800 (0:00:00.024)       0:02:07.033 ******** 
skipping: [192.168.1.102]
Thursday 06 April 2023  03:10:14 +0800 (0:00:00.113)       0:02:07.146 ******** 

TASK [openGauss_Install : 更改权限] ****************************************************************************************************
changed: [192.168.1.104]
Thursday 06 April 2023  03:10:14 +0800 (0:00:00.294)       0:02:07.441 ******** 

TASK [openGauss_Install : 登录数据库] ***************************************************************************************************
skipping: [192.168.1.101]
skipping: [192.168.1.102]

TASK [openGauss_Install : 执行gs_install] ********************************************************************************************
skipping: [192.168.1.104]
Thursday 06 April 2023  03:10:14 +0800 (0:00:00.405)       0:02:07.846 ******** 

TASK [openGauss_Install : debug] ***************************************************************************************************
ok: [192.168.1.104] => {
    "gsinstall.stdout_lines": "VARIABLE IS NOT DEFINED!"
}
Thursday 06 April 2023  03:10:14 +0800 (0:00:00.070)       0:02:07.917 ******** 

TASK [openGauss_Install : 启动数据库] ***************************************************************************************************
skipping: [192.168.1.104]
Thursday 06 April 2023  03:10:15 +0800 (0:00:00.420)       0:02:08.337 ******** 

TASK [openGauss_Install : 登录数据库] ***************************************************************************************************
skipping: [192.168.1.104]

PLAY RECAP *************************************************************************************************************************
192.168.1.101              : ok=14   changed=10   unreachable=0    failed=0    skipped=10   rescued=0    ignored=0   
192.168.1.102              : ok=14   changed=10   unreachable=0    failed=0    skipped=10   rescued=0    ignored=0   
192.168.1.103              : ok=14   changed=10   unreachable=0    failed=0    skipped=10   rescued=0    ignored=0   
192.168.1.104              : ok=14   changed=10   unreachable=0    failed=0    skipped=10   rescued=0    ignored=0   

Thursday 06 April 2023  03:10:15 +0800 (0:00:00.465)       0:02:08.803 ******** 
=============================================================================== 
openGauss_Install ----------------------------------------------------- 126.81s
gather_facts ------------------------------------------------------------ 1.94s
​~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
total ----------------------------------------------------------------- 128.75s
Playbook run took 0 days, 0 hours, 2 minutes, 8 seconds
[root@centos7 ansible]# 

执行安装

#执行安装
[root@centos7 ~]# ansible-playbook /etc/ansible/playbook/InstallopenGauss.yml
[WARNING]: While constructing a mapping from /etc/ansible/roles/openGauss_Install/tasks/main.yml, line 43, column 3, found a
duplicate dict key (tags). Using last defined value only.
PLAY [install openGauss] ***********************************************************************************************************
Thursday 06 April 2023  03:22:45 +0800 (0:00:00.061)       0:00:00.061 ******** 
Thursday 06 April 2023  03:22:45 +0800 (0:00:00.011)       0:00:00.072 ******** 
Thursday 06 April 2023  03:22:45 +0800 (0:00:00.009)       0:00:00.082 ******** 
Thursday 06 April 2023  03:22:45 +0800 (0:00:00.010)       0:00:00.092 ******** 

TASK [Gathering Facts] *************************************************************************************************************
ok: [192.168.1.103]
ok: [192.168.1.101]
ok: [192.168.1.102]
Thursday 06 April 2023  03:22:47 +0800 (0:00:02.380)       0:00:02.473 ******** 
Thursday 06 April 2023  03:22:47 +0800 (0:00:00.021)       0:00:02.495 ******** 
Thursday 06 April 2023  03:22:47 +0800 (0:00:00.020)       0:00:02.516 ******** 
ok: [192.168.1.104]
Thursday 06 April 2023  03:22:48 +0800 (0:00:00.239)       0:00:02.755 ******** 

TASK [openGauss_Install : 关闭防火墙] ***************************************************************************************************
changed: [192.168.1.102]
changed: [192.168.1.104]
Thursday 06 April 2023  03:22:49 +0800 (0:00:01.650)       0:00:04.406 ******** 
Thursday 06 April 2023  03:22:49 +0800 (0:00:00.021)       0:00:04.427 ******** 
changed: [192.168.1.101]
changed: [192.168.1.103]
Thursday 06 April 2023  03:22:49 +0800 (0:00:00.036)       0:00:04.464 ******** 
Thursday 06 April 2023  03:22:49 +0800 (0:00:00.021)       0:00:04.486 ******** 

TASK [openGauss_Install : 关闭selinux] ***********************************************************************************************
changed: [192.168.1.103]
changed: [192.168.1.104]
changed: [192.168.1.101]
Thursday 06 April 2023  03:22:50 +0800 (0:00:00.761)       0:00:05.247 ******** 
Thursday 06 April 2023  03:22:50 +0800 (0:00:00.022)       0:00:05.269 ******** 
Thursday 06 April 2023  03:22:50 +0800 (0:00:00.021)       0:00:05.291 ******** 
changed: [192.168.1.102]
Thursday 06 April 2023  03:22:50 +0800 (0:00:00.027)       0:00:05.319 ******** 

TASK [openGauss_Install : 设置时区] ****************************************************************************************************
changed: [192.168.1.103]
Thursday 06 April 2023  03:22:51 +0800 (0:00:00.543)       0:00:05.862 ******** 
changed: [192.168.1.102]
changed: [192.168.1.101]
changed: [192.168.1.104]
Thursday 06 April 2023  03:22:51 +0800 (0:00:00.028)       0:00:05.891 ******** 
Thursday 06 April 2023  03:22:51 +0800 (0:00:00.021)       0:00:05.913 ******** 
Thursday 06 April 2023  03:22:51 +0800 (0:00:00.021)       0:00:05.935 ******** 

TASK [openGauss_Install : 设置字符集] ***************************************************************************************************
changed: [192.168.1.103]
Thursday 06 April 2023  03:22:51 +0800 (0:00:00.381)       0:00:06.316 ******** 
changed: [192.168.1.101]
Thursday 06 April 2023  03:22:51 +0800 (0:00:00.036)       0:00:06.352 ******** 
changed: [192.168.1.102]
Thursday 06 April 2023  03:22:51 +0800 (0:00:00.030)       0:00:06.383 ******** 
changed: [192.168.1.104]
Thursday 06 April 2023  03:22:51 +0800 (0:00:00.026)       0:00:06.410 ******** 

TASK [openGauss_Install : 关闭RemoveIPC] *********************************************************************************************
changed: [192.168.1.104]
changed: [192.168.1.101]
changed: [192.168.1.103]
Thursday 06 April 2023  03:22:52 +0800 (0:00:00.485)       0:00:06.896 ******** 
Thursday 06 April 2023  03:22:52 +0800 (0:00:00.020)       0:00:06.917 ******** 
Thursday 06 April 2023  03:22:52 +0800 (0:00:00.021)       0:00:06.938 ******** 
changed: [192.168.1.102]
Thursday 06 April 2023  03:22:52 +0800 (0:00:00.026)       0:00:06.965 ******** 

TASK [openGauss_Install : 重启systemd-logind服务] **************************************************************************************
changed: [192.168.1.101]
Thursday 06 April 2023  03:22:52 +0800 (0:00:00.521)       0:00:07.487 ******** 
changed: [192.168.1.104]
changed: [192.168.1.103]
Thursday 06 April 2023  03:22:52 +0800 (0:00:00.043)       0:00:07.530 ******** 
Thursday 06 April 2023  03:22:52 +0800 (0:00:00.023)       0:00:07.554 ******** 
changed: [192.168.1.102]
Thursday 06 April 2023  03:22:53 +0800 (0:00:00.027)       0:00:07.581 ******** 

TASK [openGauss_Install : 创建组] *****************************************************************************************************
changed: [192.168.1.104]
Thursday 06 April 2023  03:22:53 +0800 (0:00:00.492)       0:00:08.074 ******** 
changed: [192.168.1.102]
changed: [192.168.1.101]
changed: [192.168.1.103]
Thursday 06 April 2023  03:22:53 +0800 (0:00:00.025)       0:00:08.099 ******** 
Thursday 06 April 2023  03:22:53 +0800 (0:00:00.020)       0:00:08.120 ******** 
Thursday 06 April 2023  03:22:53 +0800 (0:00:00.020)       0:00:08.141 ******** 

TASK [openGauss_Install : 创建用户] ****************************************************************************************************
changed: [192.168.1.102]
changed: [192.168.1.101]
changed: [192.168.1.103]
changed: [192.168.1.104]
Thursday 06 April 2023  03:22:54 +0800 (0:00:00.611)       0:00:08.753 ******** 
Thursday 06 April 2023  03:22:54 +0800 (0:00:00.019)       0:00:08.773 ******** 
Thursday 06 April 2023  03:22:54 +0800 (0:00:00.019)       0:00:08.792 ******** 
Thursday 06 April 2023  03:22:54 +0800 (0:00:00.021)       0:00:08.814 ******** 

TASK [openGauss_Install : 修改密码] ****************************************************************************************************
changed: [192.168.1.101]
Thursday 06 April 2023  03:22:54 +0800 (0:00:00.410)       0:00:09.224 ******** 
changed: [192.168.1.102]
Thursday 06 April 2023  03:22:54 +0800 (0:00:00.026)       0:00:09.251 ******** 
changed: [192.168.1.103]
Thursday 06 April 2023  03:22:54 +0800 (0:00:00.028)       0:00:09.279 ******** 
changed: [192.168.1.104]
Thursday 06 April 2023  03:22:54 +0800 (0:00:00.024)       0:00:09.303 ******** 

TASK [openGauss_Install : 新建目录] ****************************************************************************************************
changed: [192.168.1.103] => (item=/openGauss/software)
changed: [192.168.1.104] => (item=/openGauss/software)
changed: [192.168.1.102] => (item=/openGauss/software)
changed: [192.168.1.101] => (item=/openGauss/software)
Thursday 06 April 2023  03:22:55 +0800 (0:00:00.547)       0:00:09.851 ******** 
Thursday 06 April 2023  03:22:55 +0800 (0:00:00.019)       0:00:09.870 ******** 
Thursday 06 April 2023  03:22:55 +0800 (0:00:00.020)       0:00:09.891 ******** 
Thursday 06 April 2023  03:22:55 +0800 (0:00:00.020)       0:00:09.911 ******** 

TASK [openGauss_Install : 上传安装包] ***************************************************************************************************
changed: [192.168.1.102]
Thursday 06 April 2023  03:23:03 +0800 (0:00:08.409)       0:00:18.320 ******** 
changed: [192.168.1.103]
Thursday 06 April 2023  03:23:03 +0800 (0:00:00.107)       0:00:18.428 ******** 
changed: [192.168.1.104]
Thursday 06 April 2023  03:23:04 +0800 (0:00:00.684)       0:00:19.113 ******** 
changed: [192.168.1.101]
Thursday 06 April 2023  03:23:04 +0800 (0:00:00.135)       0:00:19.249 ******** 

TASK [openGauss_Install : 解压软件包] ***************************************************************************************************
changed: [192.168.1.102]
Thursday 06 April 2023  03:23:06 +0800 (0:00:01.690)       0:00:20.940 ******** 
changed: [192.168.1.103]
Thursday 06 April 2023  03:23:06 +0800 (0:00:00.104)       0:00:21.044 ******** 
changed: [192.168.1.104]
Thursday 06 April 2023  03:23:07 +0800 (0:00:00.665)       0:00:21.709 ******** 
changed: [192.168.1.101]
Thursday 06 April 2023  03:23:07 +0800 (0:00:00.169)       0:00:21.878 ******** 

TASK [openGauss_Install : 安装依赖包] ***************************************************************************************************
changed: [192.168.1.102]
Thursday 06 April 2023  03:25:19 +0800 (0:02:11.960)       0:02:33.839 ******** 
changed: [192.168.1.104]
Thursday 06 April 2023  03:25:19 +0800 (0:00:00.547)       0:02:34.386 ******** 

TASK [openGauss_Install : 配置xml文件] *************************************************************************************************
changed: [192.168.1.102]
Thursday 06 April 2023  03:25:20 +0800 (0:00:00.220)       0:02:34.606 ******** 

TASK [openGauss_Install : 安装依赖包] ***************************************************************************************************
changed: [192.168.1.101]
Thursday 06 April 2023  03:25:20 +0800 (0:00:00.084)       0:02:34.691 ******** 

TASK [openGauss_Install : 配置xml文件] *************************************************************************************************
changed: [192.168.1.104]
Thursday 06 April 2023  03:25:20 +0800 (0:00:00.452)       0:02:35.144 ******** 
changed: [192.168.1.101]
Thursday 06 April 2023  03:25:20 +0800 (0:00:00.305)       0:02:35.449 ******** 

TASK [openGauss_Install : 执行预安装脚本] *************************************************************************************************
changed: [192.168.1.104]
Thursday 06 April 2023  03:26:28 +0800 (0:01:08.086)       0:03:43.536 ******** 

TASK [openGauss_Install : debug] ***************************************************************************************************
ok: [192.168.1.104] => {
    "preinstall.stdout_lines": [
        "Parsing the configuration file.", 
        "Successfully parsed the configuration file.", 
        "Installing the tools on the local node.", 
        "Successfully installed the tools on the local node.", 
        "Setting host ip env", 
        "Successfully set host ip env.", 
        "Preparing SSH service.", 
        "Successfully prepared SSH service.", 
        "Checking OS software.", 
        "Successfully check os software.", 
        "Checking OS version.", 
        "Successfully checked OS version.", 
        "Creating cluster's path.", 
        "Successfully created cluster's path.", 
        "Set and check OS parameter.", 
        "Setting OS parameters.", 
        "Successfully set OS parameters.", 
        "Warning: Installation environment contains some warning messages.", 
        "Please get more details by \"/openGauss/software/script/gs_checkos -i A -h testos104 --detail\".", 
        "Set and check OS parameter completed.", 
        "Preparing CRON service.", 
        "Successfully prepared CRON service.", 
        "Setting user environmental variables.", 
        "Successfully set user environmental variables.", 
        "Setting the dynamic link library.", 
        "Successfully set the dynamic link library.", 
        "Setting Core file", 
        "Successfully set core path.", 
        "Setting pssh path", 
        "Successfully set pssh path.", 
        "Setting Cgroup.", 
        "Successfully set Cgroup.", 
        "Set ARM Optimization.", 
        "No need to set ARM Optimization.", 
        "Fixing server package owner.", 
        "Setting finish flag.", 
        "Successfully set finish flag.", 
        "Preinstallation succeeded."
    ]
}
Thursday 06 April 2023  03:26:29 +0800 (0:00:00.074)       0:03:43.611 ******** 

TASK [openGauss_Install : 执行预安装脚本] *************************************************************************************************
changed: [192.168.1.102]
Thursday 06 April 2023  03:26:29 +0800 (0:00:00.286)       0:03:43.897 ******** 

TASK [openGauss_Install : debug] ***************************************************************************************************
ok: [192.168.1.102] => {
    "preinstall.stdout_lines": [
        "Parsing the configuration file.", 
        "Successfully parsed the configuration file.", 
        "Installing the tools on the local node.", 
        "Successfully installed the tools on the local node.", 
        "Setting host ip env", 
        "Successfully set host ip env.", 
        "Preparing SSH service.", 
        "Successfully prepared SSH service.", 
        "Checking OS software.", 
        "Successfully check os software.", 
        "Checking OS version.", 
        "Successfully checked OS version.", 
        "Creating cluster's path.", 
        "Successfully created cluster's path.", 
        "Set and check OS parameter.", 
        "Setting OS parameters.", 
        "Successfully set OS parameters.", 
        "Warning: Installation environment contains some warning messages.", 
        "Please get more details by \"/openGauss/software/script/gs_checkos -i A -h testos102 --detail\".", 
        "Set and check OS parameter completed.", 
        "Preparing CRON service.", 
        "Successfully prepared CRON service.", 
        "Setting user environmental variables.", 
        "Successfully set user environmental variables.", 
        "Setting the dynamic link library.", 
        "Successfully set the dynamic link library.", 
        "Setting Core file", 
        "Successfully set core path.", 
        "Setting pssh path", 
        "Successfully set pssh path.", 
        "Setting Cgroup.", 
        "Successfully set Cgroup.", 
        "Set ARM Optimization.", 
        "No need to set ARM Optimization.", 
        "Fixing server package owner.", 
        "Setting finish flag.", 
        "Successfully set finish flag.", 
        "Preinstallation succeeded."
    ]
}
Thursday 06 April 2023  03:26:29 +0800 (0:00:00.071)       0:03:43.969 ******** 

TASK [openGauss_Install : 执行预安装脚本] *************************************************************************************************
changed: [192.168.1.101]
Thursday 06 April 2023  03:26:29 +0800 (0:00:00.499)       0:03:44.468 ******** 

TASK [openGauss_Install : debug] ***************************************************************************************************
ok: [192.168.1.101] => {
    "preinstall.stdout_lines": [
        "Parsing the configuration file.", 
        "Successfully parsed the configuration file.", 
        "Installing the tools on the local node.", 
        "Successfully installed the tools on the local node.", 
        "Setting host ip env", 
        "Successfully set host ip env.", 
        "Preparing SSH service.", 
        "Successfully prepared SSH service.", 
        "Checking OS software.", 
        "Successfully check os software.", 
        "Checking OS version.", 
        "Successfully checked OS version.", 
        "Creating cluster's path.", 
        "Successfully created cluster's path.", 
        "Set and check OS parameter.", 
        "Setting OS parameters.", 
        "Successfully set OS parameters.", 
        "Warning: Installation environment contains some warning messages.", 
        "Please get more details by \"/openGauss/software/script/gs_checkos -i A -h testos101 --detail\".", 
        "Set and check OS parameter completed.", 
        "Preparing CRON service.", 
        "Successfully prepared CRON service.", 
        "Setting user environmental variables.", 
        "Successfully set user environmental variables.", 
        "Setting the dynamic link library.", 
        "Successfully set the dynamic link library.", 
        "Setting Core file", 
        "Successfully set core path.", 
        "Setting pssh path", 
        "Successfully set pssh path.", 
        "Setting Cgroup.", 
        "Successfully set Cgroup.", 
        "Set ARM Optimization.", 
        "No need to set ARM Optimization.", 
        "Fixing server package owner.", 
        "Setting finish flag.", 
        "Successfully set finish flag.", 
        "Preinstallation succeeded."
    ]
}
Thursday 06 April 2023  03:26:29 +0800 (0:00:00.072)       0:03:44.541 ******** 

TASK [openGauss_Install : 检查预安装环境] *************************************************************************************************
changed: [192.168.1.104]
Thursday 06 April 2023  03:26:35 +0800 (0:00:05.032)       0:03:49.574 ******** 

TASK [openGauss_Install : debug] ***************************************************************************************************
ok: [192.168.1.104] => {
    "checkos.stdout_lines": [
        "Checking items:", 
        "    A1. [ OS version status ]                                   : Normal     ", 
        "        [testos104]", 
        "        centos_7.6.1810_64bit", 
        "         ", 
        "    A2. [ Kernel version status ]                               : Normal     ", 
        "        The names about all kernel versions are same. The value is \"3.10.0-957.el7.x86_64\".", 
        "    A3. [ Unicode status ]                                      : Normal     ", 
        "        The values of all unicode are same. The value is \"LANG=en_US.UTF-8\".", 
        "    A4. [ Time zone status ]                                    : Normal     ", 
        "        The informations about all timezones are same. The value is \"+0800\".", 
        "    A5. [ Swap memory status ]                                  : Warning    ", 
        "        [testos104]", 
        "SwapMemory 7999582208 TotalMemory 3954184192", 
        "", 
        "    A6. [ System control parameters status ]                    : Warning    ", 
        "        [testos104]", 
        "        Warning reason: variable 'net.ipv4.tcp_retries1' RealValue '3' ExpectedValue '5'.", 
        "        Warning reason: variable 'net.ipv4.tcp_syn_retries' RealValue '6' ExpectedValue '5'.", 
        "        Check_SysCtl_Parameter warning.", 
        "", 
        "    A7. [ File system configuration status ]                    : Warning    ", 
        "        [testos104]", 
        "        Warning reason: variable 'open files' RealValue '1024' ExpectedValue '1000000'", 
        "        Warning reason: variable 'max user processes' RealValue '14999' ExpectedValue 'unlimited'", 
        "", 
        "    A8. [ Disk configuration status ]                           : Normal     ", 
        "        The value about XFS mount parameters is correct.   ", 
        "    A9. [ Pre-read block size status ]                          : Normal     ", 
        "        The value about Logical block size is correct.     ", 
        "    A11.[ Network card configuration status ]                   : Warning    ", 
        "        [testos104]", 
        "BondMode Null", 
        "        Warning reason: network 'ens33' 'mtu' RealValue '1500' ExpectedValue '8192'", 
        "", 
        "    A12.[ Time consistency status ]                             : Warning    ", 
        "        [testos104]", 
        "        The NTPD not detected on machine and local time is \"2023-04-06 03:26:34\".", 
        "", 
        "    A13.[ Firewall service status ]                             : Normal     ", 
        "        The firewall service is stopped.                   ", 
        "    A14.[ THP service status ]                                  : Normal     ", 
        "        The THP service is stopped.                        ", 
        "Total numbers:13. Abnormal numbers:0. Warning numbers:5."
    ]
}
Thursday 06 April 2023  03:26:35 +0800 (0:00:00.069)       0:03:49.644 ******** 

TASK [openGauss_Install : 更改权限] ****************************************************************************************************
changed: [192.168.1.104]

TASK [openGauss_Install : 检查预安装环境] *************************************************************************************************
changed: [192.168.1.102]
Thursday 06 April 2023  03:26:35 +0800 (0:00:00.430)       0:03:50.074 ******** 
Thursday 06 April 2023  03:26:35 +0800 (0:00:00.028)       0:03:50.102 ******** 

TASK [openGauss_Install : debug] ***************************************************************************************************
ok: [192.168.1.102] => {
    "checkos.stdout_lines": [
        "Checking items:", 
        "    A1. [ OS version status ]                                   : Normal     ", 
        "        [testos102]", 
        "        centos_7.6.1810_64bit", 
        "         ", 
        "    A2. [ Kernel version status ]                               : Normal     ", 
        "        The names about all kernel versions are same. The value is \"3.10.0-957.el7.x86_64\".", 
        "    A3. [ Unicode status ]                                      : Normal     ", 
        "        The values of all unicode are same. The value is \"LANG=en_US.UTF-8\".", 
        "    A4. [ Time zone status ]                                    : Normal     ", 
        "        The informations about all timezones are same. The value is \"+0800\".", 
        "    A5. [ Swap memory status ]                                  : Warning    ", 
        "        [testos102]", 
        "SwapMemory 7999582208 TotalMemory 3954196480", 
        "", 
        "    A6. [ System control parameters status ]                    : Warning    ", 
        "        [testos102]", 
        "        Warning reason: variable 'net.ipv4.tcp_retries1' RealValue '3' ExpectedValue '5'.", 
        "        Warning reason: variable 'net.ipv4.tcp_syn_retries' RealValue '6' ExpectedValue '5'.", 
        "        Check_SysCtl_Parameter warning.", 
        "", 
        "    A7. [ File system configuration status ]                    : Warning    ", 
        "        [testos102]", 
        "        Warning reason: variable 'open files' RealValue '1024' ExpectedValue '1000000'", 
        "        Warning reason: variable 'max user processes' RealValue '14999' ExpectedValue 'unlimited'", 
        "", 
        "    A8. [ Disk configuration status ]                           : Normal     ", 
        "        The value about XFS mount parameters is correct.   ", 
        "    A9. [ Pre-read block size status ]                          : Normal     ", 
        "        The value about Logical block size is correct.     ", 
        "    A11.[ Network card configuration status ]                   : Warning    ", 
        "        [testos102]", 
        "BondMode Null", 
        "        Warning reason: network 'ens33' 'mtu' RealValue '1500' ExpectedValue '8192'", 
        "", 
        "    A12.[ Time consistency status ]                             : Warning    ", 
        "        [testos102]", 
        "        The NTPD not detected on machine and local time is \"2023-04-06 03:26:34\".", 
        "", 
        "    A13.[ Firewall service status ]                             : Normal     ", 
        "        The firewall service is stopped.                   ", 
        "    A14.[ THP service status ]                                  : Normal     ", 
        "        The THP service is stopped.                        ", 
        "Total numbers:13. Abnormal numbers:0. Warning numbers:5."
    ]
}
Thursday 06 April 2023  03:26:35 +0800 (0:00:00.085)       0:03:50.188 ******** 

TASK [openGauss_Install : 更改权限] ****************************************************************************************************
changed: [192.168.1.102]
Thursday 06 April 2023  03:26:36 +0800 (0:00:00.428)       0:03:50.617 ******** 

TASK [openGauss_Install : 检查预安装环境] *************************************************************************************************
changed: [192.168.1.101]
Thursday 06 April 2023  03:26:36 +0800 (0:00:00.058)       0:03:50.676 ******** 

TASK [openGauss_Install : debug] ***************************************************************************************************
ok: [192.168.1.101] => {
    "checkos.stdout_lines": [
        "Checking items:", 
        "    A1. [ OS version status ]                                   : Normal     ", 
        "        [testos101]", 
        "        centos_7.6.1810_64bit", 
        "         ", 
        "    A2. [ Kernel version status ]                               : Normal     ", 
        "        The names about all kernel versions are same. The value is \"3.10.0-957.el7.x86_64\".", 
        "    A3. [ Unicode status ]                                      : Normal     ", 
        "        The values of all unicode are same. The value is \"LANG=en_US.UTF-8\".", 
        "    A4. [ Time zone status ]                                    : Normal     ", 
        "        The informations about all timezones are same. The value is \"+0800\".", 
        "    A5. [ Swap memory status ]                                  : Warning    ", 
        "        [testos101]", 
        "SwapMemory 7999582208 TotalMemory 3954184192", 
        "", 
        "    A6. [ System control parameters status ]                    : Warning    ", 
        "        [testos101]", 
        "        Warning reason: variable 'net.ipv4.tcp_retries1' RealValue '3' ExpectedValue '5'.", 
        "        Warning reason: variable 'net.ipv4.tcp_syn_retries' RealValue '6' ExpectedValue '5'.", 
        "        Check_SysCtl_Parameter warning.", 
        "", 
        "    A7. [ File system configuration status ]                    : Warning    ", 
        "        [testos101]", 
        "        Warning reason: variable 'open files' RealValue '1024' ExpectedValue '1000000'", 
        "        Warning reason: variable 'max user processes' RealValue '14999' ExpectedValue 'unlimited'", 
        "", 
        "    A8. [ Disk configuration status ]                           : Normal     ", 
        "        The value about XFS mount parameters is correct.   ", 
        "    A9. [ Pre-read block size status ]                          : Normal     ", 
        "        The value about Logical block size is correct.     ", 
        "    A11.[ Network card configuration status ]                   : Warning    ", 
        "        [testos101]", 
        "BondMode Null", 
        "        Warning reason: network 'ens33' 'mtu' RealValue '1500' ExpectedValue '8192'", 
        "", 
        "    A12.[ Time consistency status ]                             : Warning    ", 
        "        [testos101]", 
        "        The NTPD not detected on machine and local time is \"2023-04-06 03:26:35\".", 
        "", 
        "    A13.[ Firewall service status ]                             : Normal     ", 
        "        The firewall service is stopped.                   ", 
        "    A14.[ THP service status ]                                  : Normal     ", 
        "        The THP service is stopped.                        ", 
        "Total numbers:13. Abnormal numbers:0. Warning numbers:5."
    ]
}
Thursday 06 April 2023  03:26:36 +0800 (0:00:00.069)       0:03:50.746 ******** 

TASK [openGauss_Install : 更改权限] ****************************************************************************************************
changed: [192.168.1.101]
Thursday 06 April 2023  03:26:36 +0800 (0:00:00.429)       0:03:51.175 ******** 

TASK [openGauss_Install : 安装依赖包] ***************************************************************************************************
changed: [192.168.1.103]
Thursday 06 April 2023  03:27:20 +0800 (0:00:43.469)       0:04:34.644 ******** 

TASK [openGauss_Install : 配置xml文件] *************************************************************************************************
changed: [192.168.1.103]
Thursday 06 April 2023  03:27:20 +0800 (0:00:00.798)       0:04:35.442 ******** 

TASK [openGauss_Install : 执行gs_install] ********************************************************************************************
changed: [192.168.1.104]
Thursday 06 April 2023  03:27:36 +0800 (0:00:15.259)       0:04:50.702 ******** 

TASK [openGauss_Install : debug] ***************************************************************************************************
ok: [192.168.1.104] => {
    "gsinstall.stdout_lines": [
        "Parsing the configuration file.", 
        "Check preinstall on every node.", 
        "Successfully checked preinstall on every node.", 
        "Creating the backup directory.", 
        "Successfully created the backup directory.", 
        "begin deploy..", 
        "Installing the cluster.", 
        "begin prepare Install Cluster..", 
        "Checking the installation environment on all nodes.", 
        "begin install Cluster..", 
        "Installing applications on all nodes.", 
        "Successfully installed APP.", 
        "begin init Instance..", 
        "encrypt cipher and rand files for database.", 
        "begin to create CA cert files", 
        "The sslcert will be generated in /openGauss/app/share/sslcert/om", 
        "NO cm_server instance, no need to create CA for CM.", 
        "Non-dss_ssl_enable, no need to create CA for DSS", 
        "Cluster installation is completed.", 
        "Configuring.", 
        "Deleting instances from all nodes.", 
        "Successfully deleted instances from all nodes.", 
        "Checking node configuration on all nodes.", 
        "Initializing instances on all nodes.", 
        "Updating instance configuration on all nodes.", 
        "Check consistence of memCheck and coresCheck on database nodes.", 
        "Configuring pg_hba on all nodes.", 
        "Configuration is completed.", 
        "The cluster status is Normal.", 
        "Successfully started cluster.", 
        "Successfully installed application.", 
        "end deploy.."
    ]
}
Thursday 06 April 2023  03:27:36 +0800 (0:00:00.073)       0:04:50.775 ******** 

TASK [openGauss_Install : 执行gs_install] ********************************************************************************************
changed: [192.168.1.101]
Thursday 06 April 2023  03:27:36 +0800 (0:00:00.144)       0:04:50.920 ******** 

TASK [openGauss_Install : debug] ***************************************************************************************************
ok: [192.168.1.101] => {
    "gsinstall.stdout_lines": [
        "Parsing the configuration file.", 
        "Check preinstall on every node.", 
        "Successfully checked preinstall on every node.", 
        "Creating the backup directory.", 
        "Successfully created the backup directory.", 
        "begin deploy..", 
        "Installing the cluster.", 
        "begin prepare Install Cluster..", 
        "Checking the installation environment on all nodes.", 
        "begin install Cluster..", 
        "Installing applications on all nodes.", 
        "Successfully installed APP.", 
        "begin init Instance..", 
        "encrypt cipher and rand files for database.", 
        "begin to create CA cert files", 
        "The sslcert will be generated in /openGauss/app/share/sslcert/om", 
        "NO cm_server instance, no need to create CA for CM.", 
        "Non-dss_ssl_enable, no need to create CA for DSS", 
        "Cluster installation is completed.", 
        "Configuring.", 
        "Deleting instances from all nodes.", 
        "Successfully deleted instances from all nodes.", 
        "Checking node configuration on all nodes.", 
        "Initializing instances on all nodes.", 
        "Updating instance configuration on all nodes.", 
        "Check consistence of memCheck and coresCheck on database nodes.", 
        "Configuring pg_hba on all nodes.", 
        "Configuration is completed.", 
        "The cluster status is Normal.", 
        "Successfully started cluster.", 
        "Successfully installed application.", 
        "end deploy.."
    ]
}
Thursday 06 April 2023  03:27:36 +0800 (0:00:00.074)       0:04:50.995 ******** 

TASK [openGauss_Install : 执行gs_install] ********************************************************************************************
changed: [192.168.1.102]
Thursday 06 April 2023  03:27:36 +0800 (0:00:00.220)       0:04:51.215 ******** 

TASK [openGauss_Install : debug] ***************************************************************************************************
ok: [192.168.1.102] => {
    "gsinstall.stdout_lines": [
        "Parsing the configuration file.", 
        "Check preinstall on every node.", 
        "Successfully checked preinstall on every node.", 
        "Creating the backup directory.", 
        "Successfully created the backup directory.", 
        "begin deploy..", 
        "Installing the cluster.", 
        "begin prepare Install Cluster..", 
        "Checking the installation environment on all nodes.", 
        "begin install Cluster..", 
        "Installing applications on all nodes.", 
        "Successfully installed APP.", 
        "begin init Instance..", 
        "encrypt cipher and rand files for database.", 
        "begin to create CA cert files", 
        "The sslcert will be generated in /openGauss/app/share/sslcert/om", 
        "NO cm_server instance, no need to create CA for CM.", 
        "Non-dss_ssl_enable, no need to create CA for DSS", 
        "Cluster installation is completed.", 
        "Configuring.", 
        "Deleting instances from all nodes.", 
        "Successfully deleted instances from all nodes.", 
        "Checking node configuration on all nodes.", 
        "Initializing instances on all nodes.", 
        "Updating instance configuration on all nodes.", 
        "Check consistence of memCheck and coresCheck on database nodes.", 
        "Configuring pg_hba on all nodes.", 
        "Configuration is completed.", 
        "The cluster status is Normal.", 
        "Successfully started cluster.", 
        "Successfully installed application.", 
        "end deploy.."
    ]
}
Thursday 06 April 2023  03:27:36 +0800 (0:00:00.072)       0:04:51.288 ******** 

TASK [openGauss_Install : 启动数据库] ***************************************************************************************************
changed: [192.168.1.104]
Thursday 06 April 2023  03:27:38 +0800 (0:00:01.473)       0:04:52.761 ******** 
changed: [192.168.1.101]
Thursday 06 April 2023  03:27:38 +0800 (0:00:00.234)       0:04:52.996 ******** 
changed: [192.168.1.102]
Thursday 06 April 2023  03:27:38 +0800 (0:00:00.306)       0:04:53.302 ******** 

TASK [openGauss_Install : 登录数据库] ***************************************************************************************************
changed: [192.168.1.104]
changed: [192.168.1.101]
changed: [192.168.1.102]

TASK [openGauss_Install : 执行预安装脚本] *************************************************************************************************
changed: [192.168.1.103]
Thursday 06 April 2023  03:28:37 +0800 (0:00:58.371)       0:05:51.673 ******** 

TASK [openGauss_Install : debug] ***************************************************************************************************
ok: [192.168.1.103] => {
    "preinstall.stdout_lines": [
        "Parsing the configuration file.", 
        "Successfully parsed the configuration file.", 
        "Installing the tools on the local node.", 
        "Successfully installed the tools on the local node.", 
        "Setting host ip env", 
        "Successfully set host ip env.", 
        "Preparing SSH service.", 
        "Successfully prepared SSH service.", 
        "Checking OS software.", 
        "Successfully check os software.", 
        "Checking OS version.", 
        "Successfully checked OS version.", 
        "Creating cluster's path.", 
        "Successfully created cluster's path.", 
        "Set and check OS parameter.", 
        "Setting OS parameters.", 
        "Successfully set OS parameters.", 
        "Warning: Installation environment contains some warning messages.", 
        "Please get more details by \"/openGauss/software/script/gs_checkos -i A -h testos103 --detail\".", 
        "Set and check OS parameter completed.", 
        "Preparing CRON service.", 
        "Successfully prepared CRON service.", 
        "Setting user environmental variables.", 
        "Successfully set user environmental variables.", 
        "Setting the dynamic link library.", 
        "Successfully set the dynamic link library.", 
        "Setting Core file", 
        "Successfully set core path.", 
        "Setting pssh path", 
        "Successfully set pssh path.", 
        "Setting Cgroup.", 
        "Successfully set Cgroup.", 
        "Set ARM Optimization.", 
        "No need to set ARM Optimization.", 
        "Fixing server package owner.", 
        "Setting finish flag.", 
        "Successfully set finish flag.", 
        "Preinstallation succeeded."
    ]
}
Thursday 06 April 2023  03:28:37 +0800 (0:00:00.086)       0:05:51.760 ******** 

TASK [openGauss_Install : 检查预安装环境] *************************************************************************************************
changed: [192.168.1.103]
Thursday 06 April 2023  03:28:43 +0800 (0:00:06.744)       0:05:58.504 ******** 

TASK [openGauss_Install : debug] ***************************************************************************************************
ok: [192.168.1.103] => {
    "checkos.stdout_lines": [
        "Checking items:", 
        "    A1. [ OS version status ]                                   : Normal     ", 
        "        [testos103]", 
        "        centos_7.6.1810_64bit", 
        "         ", 
        "    A2. [ Kernel version status ]                               : Normal     ", 
        "        The names about all kernel versions are same. The value is \"3.10.0-957.el7.x86_64\".", 
        "    A3. [ Unicode status ]                                      : Normal     ", 
        "        The values of all unicode are same. The value is \"LANG=en_US.UTF-8\".", 
        "    A4. [ Time zone status ]                                    : Normal     ", 
        "        The informations about all timezones are same. The value is \"+0800\".", 
        "    A5. [ Swap memory status ]                                  : Warning    ", 
        "        [testos103]", 
        "SwapMemory 7999582208 TotalMemory 3954196480", 
        "", 
        "    A6. [ System control parameters status ]                    : Warning    ", 
        "        [testos103]", 
        "        Warning reason: variable 'net.ipv4.tcp_retries1' RealValue '3' ExpectedValue '5'.", 
        "        Warning reason: variable 'net.ipv4.tcp_syn_retries' RealValue '6' ExpectedValue '5'.", 
        "        Check_SysCtl_Parameter warning.", 
        "", 
        "    A7. [ File system configuration status ]                    : Warning    ", 
        "        [testos103]", 
        "        Warning reason: variable 'open files' RealValue '1024' ExpectedValue '1000000'", 
        "        Warning reason: variable 'max user processes' RealValue '14999' ExpectedValue 'unlimited'", 
        "", 
        "    A8. [ Disk configuration status ]                           : Normal     ", 
        "        The value about XFS mount parameters is correct.   ", 
        "    A9. [ Pre-read block size status ]                          : Normal     ", 
        "        The value about Logical block size is correct.     ", 
        "    A11.[ Network card configuration status ]                   : Warning    ", 
        "        [testos103]", 
        "BondMode Null", 
        "        Warning reason: network 'ens33' 'mtu' RealValue '1500' ExpectedValue '8192'", 
        "", 
        "    A12.[ Time consistency status ]                             : Warning    ", 
        "        [testos103]", 
        "        The NTPD not detected on machine and local time is \"2023-04-06 03:28:43\".", 
        "", 
        "    A13.[ Firewall service status ]                             : Normal     ", 
        "        The firewall service is stopped.                   ", 
        "    A14.[ THP service status ]                                  : Normal     ", 
        "        The THP service is stopped.                        ", 
        "Total numbers:13. Abnormal numbers:0. Warning numbers:5."
    ]
}
Thursday 06 April 2023  03:28:44 +0800 (0:00:00.078)       0:05:58.583 ******** 

TASK [openGauss_Install : 更改权限] ****************************************************************************************************
changed: [192.168.1.103]
Thursday 06 April 2023  03:28:44 +0800 (0:00:00.498)       0:05:59.081 ******** 

TASK [openGauss_Install : 执行gs_install] ********************************************************************************************
changed: [192.168.1.103]
Thursday 06 April 2023  03:29:48 +0800 (0:01:04.243)       0:07:03.325 ******** 

TASK [openGauss_Install : debug] ***************************************************************************************************
ok: [192.168.1.103] => {
    "gsinstall.stdout_lines": [
        "Parsing the configuration file.", 
        "Check preinstall on every node.", 
        "Successfully checked preinstall on every node.", 
        "Creating the backup directory.", 
        "Successfully created the backup directory.", 
        "begin deploy..", 
        "Installing the cluster.", 
        "begin prepare Install Cluster..", 
        "Checking the installation environment on all nodes.", 
        "begin install Cluster..", 
        "Installing applications on all nodes.", 
        "Successfully installed APP.", 
        "begin init Instance..", 
        "encrypt cipher and rand files for database.", 
        "begin to create CA cert files", 
        "The sslcert will be generated in /openGauss/app/share/sslcert/om", 
        "NO cm_server instance, no need to create CA for CM.", 
        "Non-dss_ssl_enable, no need to create CA for DSS", 
        "Cluster installation is completed.", 
        "Configuring.", 
        "Deleting instances from all nodes.", 
        "Successfully deleted instances from all nodes.", 
        "Checking node configuration on all nodes.", 
        "Initializing instances on all nodes.", 
        "Updating instance configuration on all nodes.", 
        "Check consistence of memCheck and coresCheck on database nodes.", 
        "Configuring pg_hba on all nodes.", 
        "Configuration is completed.", 
        "The cluster status is Normal.", 
        "Successfully started cluster.", 
        "Successfully installed application.", 
        "end deploy.."
    ]
}
Thursday 06 April 2023  03:29:48 +0800 (0:00:00.075)       0:07:03.400 ******** 

TASK [openGauss_Install : 启动数据库] ***************************************************************************************************
changed: [192.168.1.103]
Thursday 06 April 2023  03:29:50 +0800 (0:00:02.146)       0:07:05.547 ******** 

TASK [openGauss_Install : 登录数据库] ***************************************************************************************************
changed: [192.168.1.103]

PLAY RECAP *************************************************************************************************************************
192.168.1.101              : ok=24   changed=20   unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   
192.168.1.102              : ok=24   changed=20   unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   
192.168.1.103              : ok=24   changed=20   unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   
192.168.1.104              : ok=24   changed=20   unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   

Thursday 06 April 2023  03:29:51 +0800 (0:00:00.632)       0:07:06.179 ******** 
=============================================================================== 
openGauss_Install ----------------------------------------------------- 423.70s
gather_facts ------------------------------------------------------------ 2.41s
​~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
total ----------------------------------------------------------------- 426.12s
Playbook run took 0 days, 0 hours, 7 minutes, 6 seconds
[root@centos7 ~]# 

安装后验证

方式1:命令检查

source /home/omm/env
gaussdb -V
gs_om -t status --detail|sed '/^$/d'
gsql -d postgres -p 12345 -c "select regexp_substr(version(),'.*[0-9]{2} ') as version"



[omm@testos101 ~]$ source /home/omm/env
[omm@testos101 ~]$ gaussdb -V
gaussdb (openGauss 5.0.0 build a07d57c3) compiled at 2023-03-29 03:07:56 commit 0 last mr  
[omm@testos101 ~]$ gs_om -t status --detail|sed '/^$/d'
[   Cluster State   ]
cluster_state   : Normal
redistributing  : No
current_az      : AZ_ALL
[  Datanode State   ]
    node     node_ip         port      instance                    state
----------------------------------------------------------------------------------------
1  testos101 192.168.1.101   12345      6001 /openGauss/data/dn1   P Primary Normal
[omm@testos101 ~]$ gsql -d postgres -p 12345 -c "select regexp_substr(version(),'.*[0-9]{2} ') as version"
                              version                              
-------------------------------------------------------------------
 (openGauss 5.0.0 build a07d57c3) compiled at 2023-03-29 03:07:56 
(1 row)

[omm@testos101 ~]$ 

方式2:创建playbook检查

#复制一份主机资源清单文件
[root@centos7 ~]# cp /etc/ansible/hosts /etc/ansible/hosts_omm
#修改内容如下,注意修改远程的用户
[root@centos7 ~]# cat /etc/ansible/hosts_omm
192.168.1.101
192.168.1.102
[openGaussdb]
192.168.1.101
192.168.1.102
[allhosts:children]
openGaussdb
[allhosts:vars]
ansible_ssh_user=omm
ansible_ssh_pass=openGauss@123
[root@centos7 ~]# 

#创建playbook
[root@centos7 ~]# cat check.yml
---
- name: check install info
  hosts: all
  gather_facts: false
  tasks:
   - name: check gaussdb info
     shell: source /home/omm/env && gaussdb -V
     register: var1
   - debug: var=var1.stdout_lines
   - name: check dbstatus info
     shell: source /home/omm/env && gs_om -t status --detail|sed '/^$/d'
     register: var2
   - debug: var=var2.stdout_lines
   - name: check database version
     shell: source /home/omm/env && gsql -d postgres -p 12345 -c "select regexp_substr(version(),'.*[0-9]{2} ') as version"
     register: var3
   - debug: var=var3.stdout_lines
[root@centos7 ~]# 


#执行playbook
[root@centos7 ~]# ansible-playbook -i /etc/ansible/hosts_omm check.yml 

PLAY [check install info] **********************************************************************************************************
Thursday 06 April 2023  11:59:33 +0800 (0:00:00.052)       0:00:00.052 ******** 
Thursday 06 April 2023  11:59:33 +0800 (0:00:00.009)       0:00:00.061 ******** 

TASK [check gaussdb info] **********************************************************************************************************
changed: [192.168.1.101]
Thursday 06 April 2023  11:59:35 +0800 (0:00:01.823)       0:00:01.885 ******** 
changed: [192.168.1.102]
Thursday 06 April 2023  11:59:35 +0800 (0:00:00.016)       0:00:01.901 ******** 

TASK [debug] ***********************************************************************************************************************
ok: [192.168.1.101] => {
    "var1.stdout_lines": [
        "gaussdb (openGauss 5.0.0 build a07d57c3) compiled at 2023-03-29 03:07:56 commit 0 last mr  "
    ]
}
Thursday 06 April 2023  11:59:35 +0800 (0:00:00.047)       0:00:01.948 ******** 
ok: [192.168.1.102] => {
    "var1.stdout_lines": [
        "gaussdb (openGauss 5.0.0 build a07d57c3) compiled at 2023-03-29 03:07:56 commit 0 last mr  "
    ]
}
Thursday 06 April 2023  11:59:35 +0800 (0:00:00.014)       0:00:01.963 ******** 

TASK [check dbstatus info] *********************************************************************************************************
changed: [192.168.1.101]
Thursday 06 April 2023  11:59:37 +0800 (0:00:01.539)       0:00:03.503 ******** 
changed: [192.168.1.102]
Thursday 06 April 2023  11:59:37 +0800 (0:00:00.014)       0:00:03.517 ******** 

TASK [debug] ***********************************************************************************************************************
ok: [192.168.1.101] => {
    "var2.stdout_lines": [
        "[   Cluster State   ]", 
        "cluster_state   : Normal", 
        "redistributing  : No", 
        "current_az      : AZ_ALL", 
        "[  Datanode State   ]", 
        "    node     node_ip         port      instance                    state", 
        "----------------------------------------------------------------------------------------", 
        "1  testos101 192.168.1.101   12345      6001 /openGauss/data/dn1   P Primary Normal"
    ]
}
ok: [192.168.1.102] => {
    "var2.stdout_lines": [
        "[   Cluster State   ]", 
        "cluster_state   : Normal", 
        "redistributing  : No", 
        "current_az      : AZ_ALL", 
        "[  Datanode State   ]", 
        "    node     node_ip         port      instance                    state", 
        "----------------------------------------------------------------------------------------", 
        "1  testos102 192.168.1.102   12345      6001 /openGauss/data/dn1   P Primary Normal"
    ]
}
Thursday 06 April 2023  11:59:37 +0800 (0:00:00.096)       0:00:03.614 ******** 
Thursday 06 April 2023  11:59:37 +0800 (0:00:00.009)       0:00:03.623 ******** 

TASK [check database version] ******************************************************************************************************
changed: [192.168.1.102]
changed: [192.168.1.101]
Thursday 06 April 2023  11:59:38 +0800 (0:00:01.029)       0:00:04.653 ******** 
Thursday 06 April 2023  11:59:38 +0800 (0:00:00.009)       0:00:04.662 ******** 

TASK [debug] ***********************************************************************************************************************
ok: [192.168.1.101] => {
    "var3.stdout_lines": [
        "                              version                              ", 
        "-------------------------------------------------------------------", 
        " (openGauss 5.0.0 build a07d57c3) compiled at 2023-03-29 03:07:56 ", 
        "(1 row)"
    ]
}
ok: [192.168.1.102] => {
    "var3.stdout_lines": [
        "                              version                              ", 
        "-------------------------------------------------------------------", 
        " (openGauss 5.0.0 build a07d57c3) compiled at 2023-03-29 03:07:56 ", 
        "(1 row)"
    ]
}

PLAY RECAP *************************************************************************************************************************
192.168.1.101              : ok=6    changed=3    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   
192.168.1.102              : ok=6    changed=3    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   

Thursday 06 April 2023  11:59:38 +0800 (0:00:00.072)       0:00:04.735 ******** 
=============================================================================== 
shell ------------------------------------------------------------------- 4.43s
debug ------------------------------------------------------------------- 0.26s
​~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
total ------------------------------------------------------------------- 4.68s
Playbook run took 0 days, 0 hours, 0 minutes, 4 seconds
[root@centos7 ~]# 

参考资料

https://mp.weixin.qq.com/s/bSyvMa04qO41PjYZV4bEzg
https://blog.csdn.net/GaussDB/article/details/128147295
https://docs.opengauss.org/zh/docs/3.1.0/docs/installation/%E5%87%86%E5%A4%87%E8%BD%AF%E7%A1%AC%E4%BB%B6%E5%AE%89%E8%A3%85%E7%8E%AF%E5%A2%83.html

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值