virtualbox安装openGauss

一、安装环境

1)virtualbox
2)openEuler20.03 、openGauss5.0.0
3)关闭THP:

vim /etc/rc.d/rc.local

增加如下内容:

if test -f /sys/kernel/mm/transparent_hugepage/enabled; then
echo never > /sys/kernel/mm/transparent_hugepage/enabled
fi
if test -f /sys/kernel/mm/transparent_hugepage/defrag; then
echo never > /sys/kernel/mm/transparent_hugepage/defrag
fi

4)修改权限

chmod +x /etc/rc.d/rc.local

5)关闭防火墙

systemctl stop firewalld
systemctl disable firewalld

6)重启系统: reboot

7)上传clusterconfig.xml到虚拟机

8)修改clusterconfig.xml:将hostname和ip改成你自己虚拟机的主机名称和IP
9)执行install.sh:在执行过程中,需要输入4次密码

二、脚本附件

  1. install_x86.sh
    #!/bin/bash
    
    # 设置字符集参数
    cat >>/etc/profile<<EOF
    export LANG=en_US.UTF-8
    EOF
    
    # 使修改生效
    source /etc/profile
    
    # 修改python版本并安装libaio包
    mv /usr/bin/python /usr/bin/python.bak
    ln -s /usr/bin/python3 /usr/bin/python
    python -V
    yum install libaio* -y
    
    # 创建目录,用于存放openGauss软件包
    mkdir -p /opt/software/openGauss
    mv clusterconfig.xml /opt/software/openGauss/
    cd /opt/software/openGauss
    
    # 下载openGauss安装包并解压
    wget https://opengauss.obs.cn-south-1.myhuaweicloud.com/5.0.0/x86_openEuler/openGauss-5.0.0-openEuler-64bit-all.tar.gz
    tar -zvxf openGauss-5.0.0-openEuler-64bit-all.tar.gz
    tar -zvxf openGauss-5.0.0-openEuler-64bit-om.tar.gz
    
    # 预安装数据库
    chmod -R 755 /opt/software/openGauss
    cd /opt/software/openGauss/script
    ./gs_preinstall -U omm -G dbgrp -X /opt/software/openGauss/clusterconfig.xml
    
    chown omm:dbgrp -R /opt/software/
    
    # 安装数据库,注意:以下操作是在suben用户下执行
    su - omm -c 'gs_install -X /opt/software/openGauss/clusterconfig.xml --gsinit-parameter="--encoding=UTF8"  --dn-guc="max_process_memory=4GB"  --dn-guc="shared_buffers=256MB" --dn-guc="bulk_write_ring_size=256MB" --dn-guc="cstore_buffers=16MB";gs_om -t status --detail'
    
  2. clusterconfig.xml
    
    <ROOT>
        
        <CLUSTER>
            
            <PARAM name="clusterName" value="mycluster" />
            
            <PARAM name="nodeNames" value="openEuler01" />
            
            <PARAM name="gaussdbAppPath" value="/opt/install/app" />
            
            <PARAM name="gaussdbLogPath" value="/opt/install/log/omm" />
            
            <PARAM name="tmpMppdbPath" value="/opt/install/tmp" />
            
            <PARAM name="gaussdbToolPath" value="/opt/install/om" />
            
            <PARAM name="corePath" value="/opt/install/corefile" />
            
            <PARAM name="backIp1s" value="192.168.56.6"/> 
        CLUSTER>
        
        <DEVICELIST>
            
            <DEVICE sn="100001">
            
            <PARAM name="name" value="openEuler01"/>
            
            <PARAM name="azName" value="AZ1"/>
            <PARAM name="azPriority" value="1"/>
            
            <PARAM name="backIp1" value="192.168.56.6"/>
            <PARAM name="sshIp1" value="192.168.56.6"/>   
    	    
    	    <PARAM name="dataNum" value="1"/>
    	    <PARAM name="dataPortBase" value="15432"/>
    	    <PARAM name="dataNode1" value="/opt/install/data/dn"/>
            <PARAM name="dataNode1_syncNum" value="0"/>
            DEVICE>
        DEVICELIST>
    ROOT>
    

你可能感兴趣的:(linux,运维,服务器)