主頁 > 資料庫 > Centos 7 部署 openGauss 3.1.0 級聯備庫集群及集群縮容洗掉節點-運維指南

Centos 7 部署 openGauss 3.1.0 級聯備庫集群及集群縮容洗掉節點-運維指南

2022-11-19 07:29:05 資料庫

一、安裝環境設定

1.1 硬體環境

名稱 最低配置 建議配置 測驗配置
服務器數量 3
硬碟 * 至少1GB用于安裝openGauss的應用程式,
* 每個主機需大約300MB用于元資料存盤,
* 預留70%以上的磁盤剩余空間用于資料存盤,
記憶體 >=2G
CPU 功能除錯最小1×8核,2.0GHz
網路 300兆以上以太網,生產建議采用bond

1.2 軟體環境

軟體型別 資訊描述
作業系統 Centos 7.6
Linux檔案系統 剩余inode個數 > 15億(推薦)
工具 bzip2
Python * oepnEuler:支持Python 3.7.x
* Centos 7.6: 支持Python 3.6.x
資料庫版本 opengauss 3.1.0 企業版
資料庫軟體包名稱 openGauss-3.1.0-CentOS-64bit-all.tar.gz
1.2.1 安裝python
-- root用戶【所有節點】
# 本次選擇安裝python 3.6.5版本
mkdir /usr/local/python3
cd /usr/local/python3
wget https://www.python.org/ftp/python/3.6.5/Python-3.6.5.tgz
tar -zxf Python-3.6.5.tgz
cd /usr/local/python3/Python-3.6.5
./configure --prefix=/usr/local/python3 --enable-shared CFLAGS=-fPIC  
make && make install
ln -s /usr/local/python3/bin/python3 /usr/bin/python3
ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3

-- 設定環境變數
cat >>/etc/profile<<EOF
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/python3/bin
EOF
source /etc/profile
echo "/usr/local/python3/lib/" >> /etc/ld.so.conf
ldconfig

-- 如遇如下報錯
python3: error while loading shared libraries: libpython3.6m.so.1.0: cannot open shared object file: No such file or directory
可執行 cp /usr/local/python3/Python-3.6.5/libpython3.6m.so.1.0 /usr/lib64/
1.2.2 安裝軟體依賴包
1.2.2.1 軟體依賴要求
所需軟體 建議版本
libaio-devel 建議版本:0.3.109-13
flex 要求版本:2.5.31 以上
bison 建議版本:2.7-4
ncurses-devel 建議版本:5.9-13.20130511
glibc-devel 建議版本:2.17-111
patch 建議版本:2.7.1-10
redhat-lsb-core 建議版本:4.1
readline-devel 建議版本 :7.0-13
libnsl(openeuler+x86環境中) 建議版本 :2.28-36
1.2.2.2 安裝軟體依賴包
-- root用戶 【所有節點】
-- 安裝依賴包
yum install -y libaio-devel flex bison ncurses-devel glibc-devel patch redhat-lsb-core readline-devel zlib readline gcc perl-ExtUtils-Embed readline-devel zlib-devel expect

-- 檢查是否已安裝
rpm -qa --queryformat "%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n" | grep -E "libaio-devel|flex|bison|ncurses-devel|glibc-devel|patch|redhat-lsb-core|readline-devel|zlib|readline|gcc|python|python-devel|perl-ExtUtils-Embed|readline-devel|zlib-devel|expect"
1.2.3 作業系統配置
1.2.3.1 修改作業系統引數
-- root用戶 【所有節點】
-- 添加如下引數:
cat>>/etc/sysctl.conf <<EOF
net.ipv4.tcp_fin_timeout=60
net.ipv4.tcp_retries1=5
net.ipv4.tcp_syn_retries=5
net.sctp.path_max_retrans=10
net.sctp.max_init_retransmits=10
EOF

-- 生效引數
sysctl -p

## 執行sysctl -p 時有如下報錯,此處選擇忽略
sysctl: cannot stat /proc/sys/net/sctp/path_max_retrans: No such file or directory
sysctl: cannot stat /proc/sys/net/sctp/max_init_retransmits: No such file or directory

# 預安裝程序根據系統引數配置會有相應提示,請按照提示對應系統引數
1.2.3.2 修改資源系統限制
-- root用戶 【所有節點】
echo "* soft stack 3072" >> /etc/security/limits.conf
echo "* hard stack 3072" >> /etc/security/limits.conf
echo "* soft nofile 1000000" >> /etc/security/limits.conf
echo "* hard nofile 1000000" >> /etc/security/limits.conf
echo "* soft nproc unlimited" >> /etc/security/limits.d/90-nproc.conf
tail -n 4 /etc/security/limits.conf
tail -n 1 /etc/security/limits.d/90-nproc.conf
1.2.3.3 關閉透明大頁
-- root用戶 【所有節點】
-- openGauss默認關閉使用transparent_hugepage服務,并將關閉命令寫入作業系統啟動檔案

cat >> /etc/rc.d/rc.local<<EOF
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
EOF

-- 查看是否關閉:
cat /sys/kernel/mm/transparent_hugepage/enabled
cat /sys/kernel/mm/transparent_hugepage/defrag
1.2.3.4 關閉防火墻
-- root用戶 【所有節點】
systemctl disable firewalld.service
systemctl stop firewalld.service
1.2.3.5 關閉selinux
-- root用戶 【所有節點】
sed -i  "s/SELINUX=enforcing/SELINUX=disabled/"  /etc/selinux/config
-- 檢查
cat /etc/selinux/config | grep disabled
1.2.3.6 修改字符集
-- root用戶 【所有節點】
cat>> /etc/profile<<EOF
export LANG=en_US.UTF-8
EOF
source /etc/profile
# 檢查
cat /etc/profile | grep LANG
env |grep -i lang
1.2.3.7 修改時區
-- root用戶 【所有節點】
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
-- 查看
date 
1.2.3.8 關閉SWAP
-- root用戶 【所有節點】
-- 臨時關閉
swapoff -a

-- 永久關閉
注釋 swap 行
vim /etc/fstab

-- 查看
free -h 查看 swap一行全是 0 表示swap關閉
1.2.3.9 設定網卡MTU
-- root用戶 【所有節點】
-- 設定網卡為1500
ifconfig 網卡名 mtu 1500

-- 查看
ifconfig -a |grep -i mtu
1.2.3.10 設定root用戶遠程登陸
-- root用戶 【所有節點】
cat >>/etc/ssh/sshd_config<<EOF
PermitRootLogin yes
EOF
-- 檢查
cat /etc/ssh/sshd_config |grep PermitRootLogin
1.2.3.11 配置SSH
-- root用戶 【所有節點】
sed -i '/Banner/s/^/#/' /etc/ssh/sshd_config
sed -i '/PermitRootLogin/s/^/#/' /etc/ssh/sshd_config
echo -e "\n" >> /etc/ssh/sshd_config
echo "Banner none " >> /etc/ssh/sshd_config
# 修改Banner配置,去掉連接到系統時,系統提示的歡迎資訊,歡迎資訊會干擾安裝時遠程操作的回傳結果,影響安裝正常執行
echo "PermitRootLogin yes" >> /etc/ssh/sshd_config
cat /etc/ssh/sshd_config |grep -v ^#|grep -E 'PermitRootLogin|Banner'

-- 重啟生效
systemctl restart sshd.service
1.2.3.12 修改DNS配置
-- root用戶 【所有節點】
-- 節點一
cat >>/etc/resolv.conf<<EOF
nameserver 192.168.17.112
EOF

-- 節點二
cat >>/etc/resolv.conf<<EOF
nameserver 192.168.17.113
EOF

-- 節點三
cat >>/etc/resolv.conf<<EOF
nameserver 192.168.17.139
EOF

-- 節點四
cat >>/etc/resolv.conf<<EOF
nameserver 192.168.17.159
EOF
1.2.3.13 添加hosts決議
-- root用戶 【所有節點】
cat >> /etc/hosts<<EOF
192.168.17.112  opengauss-db1
192.168.17.113  opengauss-db2
192.168.17.139  opengauss-db3
192.168.17.159  opengauss-db4
EOF

二、集群規劃

2.1 主機名-IP地址-埠號規劃

專案名稱 描述說明 備注
主機名 opengauss-db1、opengauss-db2、opengauss-db3、opengauss-db4 主備主機名
IP地址 192.168.17.112、192.168.17.113、192.168.17.139、192.168.17.159 主備主機名及IP
埠號 5000、26000 cm監聽埠、DBnode監聽埠

2.2 用戶名規劃

專案名稱 名稱 所屬型別 規劃建議
用戶名 omm 作業系統 參照官網
組名 dbgrp 作業系統 參照官網

2.3 軟體目錄規劃

目錄名稱 對應名稱 目錄作用
/opt/software/openGauss software 安裝軟體存放目錄
/opt/gaussdb/install/app gaussdbAppPath 資料庫安裝目錄
/opt/gaussdb/log gaussdbLogPath 日志目錄
/opt/gaussdb/install/data/db1 dataNode1 主備節點資料存放目錄
/opt/gaussdb/tmp tmpMppdbPath 臨時檔案目錄
/opt/gaussdb/gausstools/om gaussdbToolPath 資料庫工具目錄
/opt/gaussdb/corefile corePath 資料庫core檔案目錄
/opt/gaussdb/install/data/cm cmDir CM資料目錄

三、軟體安裝

3.1 下載軟體包

打開瀏覽器登陸 https://www.opengauss.org/zh/download/ 下載頁面下載 openGauss_3.1.0 Centos_x86_64 對應企業版

3.2 上傳及解壓軟體包

-- 節點一 root 用戶
-- 創建存放安裝包目錄
mkdir -p /opt/software/openGauss
chmod 755 -R /opt/software

-- 上傳軟體包
# 上傳openGauss-3.1.0-CentOS-64bit-all.tar.gz軟體至/opt/software/openGauss目錄
# 解壓軟體包,解壓openGauss-3.1.0-CentOS-64bit-all.tar.gz后需保留 .sha256檔案,否則執行預檢查時會報[GAUSS-50201] : The /opt/software/openGauss/openGauss-2.0.0-RedHat-64bit.sha256 does not exist.

tar -zxf openGauss-3.1.0-CentOS-64bit-all.tar.gz

tar -zxf openGauss-3.1.0-CentOS-64bit-om.tar.gz

3.3 創建XML組態檔

3.3.1 配置XML檔案
-- 節點一 root 用戶
-- 在/opt/software/openGauss 目錄下創建 clusterconfig.xml組態檔
-- 執行操作如下
cat > clusterconfig.xml<<EOF
<?xml version="1.0" encoding="UTF-8"?>
<ROOT>
    <!-- openGauss整體資訊 -->
    <CLUSTER>
    <!-- 資料庫名稱 -->
        <PARAM name="clusterName" value="https://www.cnblogs.com/dbajacky/p/gsCluster" />
    <!-- 資料庫節點名稱(hostname) -->
        <PARAM name="nodeNames" value="https://www.cnblogs.com/dbajacky/p/opengauss-db1,opengauss-db2,opengauss-db3,opengauss-db4" />
    <!-- 資料庫安裝目錄-->
        <PARAM name="gaussdbAppPath" value="https://www.cnblogs.com/opt/gaussdb/install/app" />
    <!-- 日志目錄-->
        <PARAM name="gaussdbLogPath" value="https://www.cnblogs.com/opt/gaussdb/log" />
    <!-- 臨時檔案目錄-->
        <PARAM name="tmpMppdbPath" value="https://www.cnblogs.com/opt/gaussdb/tmp"/>
    <!--資料庫工具目錄-->
        <PARAM name="gaussdbToolPath" value="https://www.cnblogs.com/opt/gaussdb/gausstools/om" />
    <!--資料庫core檔案目錄-->
        <PARAM name="corePath" value="https://www.cnblogs.com/opt/gaussdb/corefile"/>
	<!-- 節點IP,與nodeNames一一對應 -->
        <PARAM name="backIp1s" value="https://www.cnblogs.com/dbajacky/p/192.168.17.112,192.168.17.113,192.168.17.139,192.168.17.159"/>
    </CLUSTER>
    <!-- 每臺服務器上的節點部署資訊 -->
    <DEVICELIST>
        <!-- opengauss-db1上的節點部署資訊 -->
        <DEVICE sn="opengauss-db1">
        <!-- opengauss-db1的hostname -->
            <PARAM name="name" value="https://www.cnblogs.com/dbajacky/p/opengauss-db1"/>
        <!-- opengauss-db1所在的AZ及AZ優先級 -->
            <PARAM name="azName" value="https://www.cnblogs.com/dbajacky/p/AZ1"/>
            <PARAM name="azPriority" value="https://www.cnblogs.com/dbajacky/p/1"/>
        <!-- 如果服務器只有一個網卡可用,將backIP1和sshIP1配置成同一個IP -->
            <PARAM name="backIp1" value="https://www.cnblogs.com/dbajacky/p/192.168.17.112"/>
            <PARAM name="sshIp1" value="https://www.cnblogs.com/dbajacky/p/192.168.17.112"/>
            
        <!--CM-->
     <!--CM資料目錄-->
            <PARAM name="cmDir" value="https://www.cnblogs.com/opt/gaussdb/install/data/cm" />
            <PARAM name="cmsNum" value="https://www.cnblogs.com/dbajacky/p/1" />
      <!--CM監聽埠-->
            <PARAM name="cmServerPortBase" value="https://www.cnblogs.com/dbajacky/p/5000" />
            <PARAM name="cmServerlevel" value="https://www.cnblogs.com/dbajacky/p/1" />
      <!-- CM所有實體所在節點名及監聽ip -->
      <!-- 添加新增節點IP -->
            <PARAM name="cmServerListenIp1" value="https://www.cnblogs.com/dbajacky/p/192.168.17.112,192.168.17.113,192.168.17.139,192.168.17.159" />
      <!-- 節點主機名 -->      
            <PARAM name="cmServerRelation" value="https://www.cnblogs.com/dbajacky/p/opengauss-db1,opengauss-db2,opengauss-db3,opengauss-db4" />
            
      <!-- dbnode -->
        <PARAM name="dataNum" value="https://www.cnblogs.com/dbajacky/p/1"/>
      <!--DBnode埠號-->
        <PARAM name="dataPortBase" value="https://www.cnblogs.com/dbajacky/p/26000"/>
      <!-- DBnode主節點上資料目錄,及備機資料目錄 -->
      <!-- 添加新增節點主機名及資料目錄 -->
        <PARAM name="dataNode1" value="https://www.cnblogs.com/opt/gaussdb/install/data/db1,opengauss-db2,/opt/gaussdb/install/data/db1,opengauss-db3,/opt/gaussdb/install/data/db1,opengauss-db4,/opt/gaussdb/install/data/db1"/>
      <!-- DBnode節點上設定同步模式的節點數 -->
        <PARAM name="dataNode1_syncNum" value="https://www.cnblogs.com/dbajacky/p/0"/>
        </DEVICE>

        <!-- opengauss-db2上的節點部署資訊,其中"name"的值配置為主機名稱(hostname) -->
        <DEVICE sn="opengauss-db2">
            <PARAM name="name" value="https://www.cnblogs.com/dbajacky/p/opengauss-db2"/>
            <PARAM name="azName" value="https://www.cnblogs.com/dbajacky/p/AZ1"/>
            <PARAM name="azPriority" value="https://www.cnblogs.com/dbajacky/p/1"/>
            <!-- 如果服務器只有一個網卡可用,將backIP1和sshIP1配置成同一個IP -->
            <PARAM name="backIp1" value="https://www.cnblogs.com/dbajacky/p/192.168.17.113"/>
            <PARAM name="sshIp1" value="https://www.cnblogs.com/dbajacky/p/192.168.17.113"/>
            <PARAM name="cmDir" value="https://www.cnblogs.com/opt/gaussdb/install/data/cm" />
        </DEVICE>

        <!-- opengauss-db3上的節點部署資訊,其中"name"的值配置為主機名稱(hostname) -->
        <DEVICE sn="opengauss-db3">
            <PARAM name="name" value="https://www.cnblogs.com/dbajacky/p/opengauss-db3"/>
            <PARAM name="azName" value="https://www.cnblogs.com/dbajacky/p/AZ1"/>
            <PARAM name="azPriority" value="https://www.cnblogs.com/dbajacky/p/1"/>
            <!-- 如果服務器只有一個網卡可用,將backIP1和sshIP1配置成同一個IP -->
            <PARAM name="backIp1" value="https://www.cnblogs.com/dbajacky/p/192.168.17.139"/>
            <PARAM name="sshIp1" value="https://www.cnblogs.com/dbajacky/p/192.168.17.139"/>
            <PARAM name="cmDir" value="https://www.cnblogs.com/opt/gaussdb/install/data/cm" />
        </DEVICE>
        
        <!-- 級聯備庫節點資訊 -->
		<!-- opengauss-db4上的節點部署資訊,其中"name"的值配置為主機名稱(hostname) -->
        <DEVICE sn="opengauss-db4">
            <PARAM name="name" value="https://www.cnblogs.com/dbajacky/p/opengauss-db4"/>
            <PARAM name="azName" value="https://www.cnblogs.com/dbajacky/p/AZ1"/>
            <PARAM name="azPriority" value="https://www.cnblogs.com/dbajacky/p/1"/>
            <!-- 如果服務器只有一個網卡可用,將backIP1和sshIP1配置成同一個IP -->
            <PARAM name="backIp1" value="https://www.cnblogs.com/dbajacky/p/192.168.17.159"/>
            <PARAM name="sshIp1" value="https://www.cnblogs.com/dbajacky/p/192.168.17.159"/>
            <PARAM name="cmDir" value="https://www.cnblogs.com/opt/gaussdb/install/data/cm" />
			<!-- opengauss-db4 增加了cascadeRole標識,on 標識該實體為級聯備庫 -->
			<PARAM name="cascadeRole" value="https://www.cnblogs.com/dbajacky/p/on"/>
        </DEVICE>
    </DEVICELIST>
</ROOT>
EOF
3.3.2 引數簡介
實體型別 引數 說明
整體資訊 name 主機名稱
azName 指定azName(Available Zone Name),字串(不能含有特殊字符),例如AZ1、AZ2、AZ3,
azPriority 指定azPriority的優先級,
backIp1 主機在后端存盤網路中的IP地址(內網IP),所有openGauss主機使用后端存盤網路通訊,
sshIp1 設定SSH可信通道IP地址(外網IP),若無外網,則可以不設定該選項或者同backIp1設定相同IP,

3.4 初始化安裝環境

# root 用戶 節點一主節點操作

-- 設定lib庫
[root@opengauss-db1 ~]# export LD_LIBRARY_PATH=/opt/software/openGauss/script/gspylib/clib:$LD_LIBRARY_PATH

-- 執行預執行
[root@opengauss-db1 ~]# python3 /opt/software/openGauss/script/gs_preinstall -U omm -G dbgrp -X /opt/software/openGauss/clusterconfig.xml

## 執行結果如下
Parsing the configuration file.
Successfully parsed the configuration file.
Installing the tools on the local node.
Successfully installed the tools on the local node.
Are you sure you want to create trust for root (yes/no)?yes  -- 輸入yes
Please enter password for root
Password:     -- 設定 root 口令
Successfully created SSH trust for the root permission user.
Setting host ip env
Successfully set host ip env.
Distributing package.
Begin to distribute package to tool path.
Successfully distribute package to tool path.
Begin to distribute package to package path.
Successfully distribute package to package path.
Successfully distributed package.
Are you sure you want to create the user[omm] and create trust for it (yes/no)? yes -- 輸入yes
Please enter password for cluster user.
Password:    -- 設定 omm 用戶口令
Please enter password for cluster user again.
Password:    -- 重復輸入 omm 用戶口令
Generate cluster user password files successfully.

Successfully created [omm] user on all nodes.
Preparing SSH service.
Successfully prepared SSH service.
Installing the tools in the cluster.
Successfully installed the tools in the cluster.
Checking hostname mapping.
Successfully checked hostname mapping.
Creating SSH trust for [omm] user.
Please enter password for current user[omm].
Password:   -- 輸入 omm 用戶口令
Checking network information.
All nodes in the network are Normal.
Successfully checked network information.
Creating SSH trust.
Creating the local key file.
Successfully created the local key files.
Appending local ID to authorized_keys.
Successfully appended local ID to authorized_keys.
Updating the known_hosts file.
Successfully updated the known_hosts file.
Appending authorized_key on the remote node.
Successfully appended authorized_key on all remote node.
Checking common authentication file content.
Successfully checked common authentication content.
Distributing SSH trust file to all node.
Distributing trust keys file to all node successfully.
Successfully distributed SSH trust file to all node.
Verifying SSH trust on all hosts.
Successfully verified SSH trust on all hosts.
Successfully created SSH trust.
Successfully created SSH trust for [omm] user.
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 "/opt/software/openGauss/script/gs_checkos -i A -h opengauss-db1,opengauss-db2,opengauss-db3,opengauss-db4 --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.

-- 查看預安裝結果資訊,并根據預檢查調整引數
-- root 用戶
[root@opengauss-db1 ~]# /opt/software/openGauss/script/gs_checkos -i A -h opengauss-db1,opengauss-db2,opengauss-db3,opengauss-db4 --detail
## 執行結果如下
Checking items:
    A1. [ OS version status ]                                   : Normal     
        [opengauss-db2]
        centos_7.9.2009_64bit
        [opengauss-db1]
        centos_7.9.2009_64bit
        [opengauss-db3]
        centos_7.9.2009_64bit
        [opengauss-db4]
        centos_7.9.2009_64bit

    A2. [ Kernel version status ]                               : Normal     
        The names about all kernel versions are same. The value is "3.10.0-693.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 ]                                  : Normal     
        The value about swap memory is correct.            
    A6. [ System control parameters status ]                    : Normal     
        All values about system control  parameters are correct.
    A7. [ File system configuration status ]                    : Normal     
        Both soft nofile and hard nofile are correct.      
    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.     
    A10.[ IO scheduler status ]                                 : Normal     
        The value of IO scheduler is correct.              
    A11.[ Network card configuration status ]                   : Warning    
        [opengauss-db1]
BondMode Null
        Warning reason: network 'ens33' 'mtu' RealValue '1500' ExpectedValue '8192' -- 可忽略

        [opengauss-db2]
BondMode Null
        Warning reason: network 'ens33' 'mtu' RealValue '1500' ExpectedValue '8192' -- 可忽略

        [opengauss-db3]
BondMode Null
        Warning reason: network 'ens33' 'mtu' RealValue '1500' ExpectedValue '8192' -- 可忽略

        [opengauss-db4]
BondMode Null
        Warning reason: network 'ens33' 'mtu' RealValue '1500' ExpectedValue '8192' -- 可忽略


    A12.[ Time consistency status ]                             : Warning    
        [opengauss-db2]
        The NTPD not detected on machine and local time is "2022-11-14 17:08:56".
        [opengauss-db1]
        The NTPD not detected on machine and local time is "2022-11-14 17:08:56".
        [opengauss-db3]
        The NTPD not detected on machine and local time is "2022-11-14 17:08:56".
        [opengauss-db4]
        The NTPD not detected on machine and local time is "2022-11-14 17:08:56".

    A13.[ Firewall service status ]                             : Normal     
        The firewall service is stopped.                   
    A14.[ THP service status ]                                  : Normal     
        The THP service is stopped.                        
Total numbers:14. Abnormal numbers:0. Warning numbers:2.
-- 根據執行detail命令結果對預檢查告警進行調整

3.5 執行集群安裝

3.5.1 修改屬主
-- 務必確保已在節點一執行預檢查
-- root 用戶 節點一操作
[root@opengauss-db1 ~]# chmod -R 755 /opt/software/openGauss/script/
[root@opengauss-db1 ~]# chown -R omm:dbgrp /opt/software/openGauss/script/
3.5.2 執行集群安裝
-- 節點一切換到omm用戶執行
[root@opengauss-db1 ~]# su - omm
-- 執行如下命令
[omm@opengauss-db1 ~]$ gs_install -X /opt/software/openGauss/clusterconfig.xml
## 執行結果如下
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.
Please enter password for database:    -- 設定資料庫 口令 如 Passw0rd@1234
Please repeat for database:            -- 再次輸入相同口令
begin to create CA cert files
The sslcert will be generated in /opt/gaussdb/install/app/share/sslcert/om
Create CA files for cm beginning.
Create CA files on directory [/opt/gaussdb/install/app_4e931f9a/share/sslcert/cm]. file list: ['client.key.rand', 'server.crt', 'cacert.pem', 'client.crt', 'server.key.rand', 'client.key', 'client.key.cipher', 'server.key', 'server.key.cipher']
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.
Successful check consistence of memCheck and coresCheck on all nodes.
Configuring pg_hba on all nodes.
Configuration is completed.
Starting cluster.
======================================================================
Successfully started primary instance. Wait for standby instance.
======================================================================
.
Successfully started cluster.
======================================================================
cluster_state      : Normal
redistributing     : No
node_count         : 4
Datanode State
    primary           : 1
    standby           : 2
    secondary         : 0
    cascade_standby   : 1
    building          : 0
    abnormal          : 0
    down              : 0

Successfully installed application.
end deploy..
3.5.3 資料庫狀態檢查
-- omm 用戶
[omm@opengauss-db1 ~]$ gs_om -t status --detail
[  CMServer State   ]

node             node_ip         instance                                    state
------------------------------------------------------------------------------------
1  opengauss-db1 192.168.17.112  1    /opt/gaussdb/install/data/cm/cm_server Primary
2  opengauss-db2 192.168.17.113  2    /opt/gaussdb/install/data/cm/cm_server Standby
3  opengauss-db3 192.168.17.139  3    /opt/gaussdb/install/data/cm/cm_server Standby
4  opengauss-db4 192.168.17.159  4    /opt/gaussdb/install/data/cm/cm_server Standby

[   Cluster State   ]

cluster_state   : Normal
redistributing  : No
balanced        : Yes
current_az      : AZ_ALL

[  Datanode State   ]

node             node_ip         instance                           state            
-------------------------------------------------------------------------------------
1  opengauss-db1 192.168.17.112  6001 /opt/gaussdb/install/data/db1 P Primary Normal
2  opengauss-db2 192.168.17.113  6002 /opt/gaussdb/install/data/db1 S Standby Normal
3  opengauss-db3 192.168.17.139  6003 /opt/gaussdb/install/data/db1 S Standby Normal
4  opengauss-db4 192.168.17.159  6004 /opt/gaussdb/install/data/db1 C Cascade Standby Normal
3.5.4 集群狀態檢查
-- omm 用戶
[omm@opengauss-db1 ~]$ cm_ctl query -v -C -i -d
[  CMServer State   ]

node             node_ip         instance                                    state
------------------------------------------------------------------------------------
1  opengauss-db1 192.168.17.112  1    /opt/gaussdb/install/data/cm/cm_server Primary
2  opengauss-db2 192.168.17.113  2    /opt/gaussdb/install/data/cm/cm_server Standby
3  opengauss-db3 192.168.17.139  3    /opt/gaussdb/install/data/cm/cm_server Standby
4  opengauss-db4 192.168.17.159  4    /opt/gaussdb/install/data/cm/cm_server Standby

[   Cluster State   ]

cluster_state   : Normal
redistributing  : No
balanced        : Yes
current_az      : AZ_ALL

[  Datanode State   ]

node             node_ip         instance                           state            
-------------------------------------------------------------------------------------
1  opengauss-db1 192.168.17.112  6001 /opt/gaussdb/install/data/db1 P Primary Normal 
2  opengauss-db2 192.168.17.113  6002 /opt/gaussdb/install/data/db1 S Standby Normal
3  opengauss-db3 192.168.17.139  6003 /opt/gaussdb/install/data/db1 S Standby Normal      
4  opengauss-db4 192.168.17.159  6004 /opt/gaussdb/install/data/db1 C Cascade Standby Normal

3.6 查詢級聯備庫日志接收狀態

-- omm 用戶 級聯備庫操作
[root@opengauss-db4 ~]# su - omm
Last login: Mon Nov 14 17:05:30 CST 2022
[omm@opengauss-db4 ~]$ gsql -d postgres -p 26000
gsql ((openGauss 3.1.0 build 4e931f9a) compiled at 2022-09-29 14:19:24 commit 0 last mr  )
Non-SSL connection (SSL connection is recommended when requiring high-security)
Type "help" for help.
openGauss=# \x
Expanded display is on.
openGauss=# select * from pg_stat_get_wal_receiver();

四、集群縮容

4.1 查詢集群狀態

-- omm 用戶
[omm@opengauss-db1 ~]$ gs_om -t status --detail
[  CMServer State   ]

node             node_ip         instance                                    state
------------------------------------------------------------------------------------
1  opengauss-db1 192.168.17.112  1    /opt/gaussdb/install/data/cm/cm_server Primary
2  opengauss-db2 192.168.17.113  2    /opt/gaussdb/install/data/cm/cm_server Standby
3  opengauss-db3 192.168.17.139  3    /opt/gaussdb/install/data/cm/cm_server Standby
4  opengauss-db4 192.168.17.159  4    /opt/gaussdb/install/data/cm/cm_server Standby

[   Cluster State   ]

cluster_state   : Normal
redistributing  : No
balanced        : Yes
current_az      : AZ_ALL

[  Datanode State   ]

node             node_ip         instance                           state            
-------------------------------------------------------------------------------------
1  opengauss-db1 192.168.17.112  6001 /opt/gaussdb/install/data/db1 P Primary Normal
2  opengauss-db2 192.168.17.113  6002 /opt/gaussdb/install/data/db1 S Standby Normal
3  opengauss-db3 192.168.17.139  6003 /opt/gaussdb/install/data/db1 S Standby Normal
4  opengauss-db4 192.168.17.159  6004 /opt/gaussdb/install/data/db1 C Cascade Standby Normal

4.2 縮容節點

-- omm 用戶 主節點操作
[omm@opengauss-db1 ~]$ gs_dropnode -U omm -G dbgrp -h 192.168.17.159
-- 執行結果如下
The target node to be dropped is (['opengauss-db4']) 
Do you want to continue to drop the target node (yes/no)?yes   -- 輸入 yes
Drop node start with CM node.
Drop node with CM node is running.
[gs_dropnode]Start to drop nodes of the cluster.
[gs_dropnode]Start to stop the target node opengauss-db4.
[gs_dropnode]End of stop the target node opengauss-db4.
[gs_dropnode]Start to backup parameter config file on opengauss-db1.
[gs_dropnode]End to backup parameter config file on opengauss-db1.
[gs_dropnode]The backup file of opengauss-db1 is /opt/gaussdb/tmp/gs_dropnode_backup20221114182028/parameter_opengauss-db1.tar
[gs_dropnode]Start to parse parameter config file on opengauss-db1.
[gs_dropnode]End to parse parameter config file on opengauss-db1.
[gs_dropnode]Start to parse backup parameter config file on opengauss-db1.
[gs_dropnode]End to parse backup parameter config file opengauss-db1.
[gs_dropnode]Start to set openGauss config file on opengauss-db1.
[gs_dropnode]End of set openGauss config file on opengauss-db1.
[gs_dropnode]Start to backup parameter config file on opengauss-db2.
[gs_dropnode]End to backup parameter config file on opengauss-db2.
[gs_dropnode]The backup file of opengauss-db2 is /opt/gaussdb/tmp/gs_dropnode_backup20221114182030/parameter_opengauss-db2.tar
[gs_dropnode]Start to parse parameter config file on opengauss-db2.
[gs_dropnode]End to parse parameter config file on opengauss-db2.
[gs_dropnode]Start to parse backup parameter config file on opengauss-db2.
[gs_dropnode]End to parse backup parameter config file opengauss-db2.
[gs_dropnode]Start to set openGauss config file on opengauss-db2.
[gs_dropnode]End of set openGauss config file on opengauss-db2.
[gs_dropnode]Start to backup parameter config file on opengauss-db3.
[gs_dropnode]End to backup parameter config file on opengauss-db3.
[gs_dropnode]The backup file of opengauss-db3 is /opt/gaussdb/tmp/gs_dropnode_backup20221114182036/parameter_opengauss-db3.tar
[gs_dropnode]Start to parse parameter config file on opengauss-db3.
[gs_dropnode]End to parse parameter config file on opengauss-db3.
[gs_dropnode]Start to parse backup parameter config file on opengauss-db3.
[gs_dropnode]End to parse backup parameter config file opengauss-db3.
[gs_dropnode]Start to set openGauss config file on opengauss-db3.
[gs_dropnode]End of set openGauss config file on opengauss-db3.
[gs_dropnode]Start of set pg_hba config file on opengauss-db1.
[gs_dropnode]End of set pg_hba config file on opengauss-db1.
[gs_dropnode]Start of set pg_hba config file on opengauss-db2.
[gs_dropnode]End of set pg_hba config file on opengauss-db2.
[gs_dropnode]Start of set pg_hba config file on opengauss-db3.
[gs_dropnode]End of set pg_hba config file on opengauss-db3.
[gs_dropnode]Start to set repl slot on opengauss-db1.
[gs_dropnode]Start to get repl slot on opengauss-db1.
[gs_dropnode]End of set repl slot on opengauss-db1.
Stopping node.
=========================================
Successfully stopped node.
=========================================
End stop node.
Generate drop flag file on drop node opengauss-db4 successfully.
[gs_dropnode]Start to modify the cluster static conf.
[gs_dropnode]End of modify the cluster static conf.
Restart cluster ...
Stopping cluster.
=========================================
Successfully stopped cluster.
=========================================
End stop cluster.
Remove dynamic_config_file and CM metadata directory on all nodes.
Starting cluster.
======================================================================
Successfully started primary instance. Wait for standby instance.
======================================================================
.
Successfully started cluster.
======================================================================
cluster_state      : Normal
redistributing     : No
node_count         : 3
Datanode State
    primary           : 1
    standby           : 2
    secondary         : 0
    cascade_standby   : 0
    building          : 0
    abnormal          : 0
    down              : 0

Failed to reset switchover the cluster. Command: "source /home/omm/.bashrc ; cm_ctl switchover -a -t 0".
Output: "cm_ctl: create ssl connection failed.
cm_ctl: socket is [4], 462 : create ssl failed: 
cm_ctl: send switchover msg to cm_server, connect fail node_id:0, data_path:.".
[gs_dropnode] Success to drop the target nodes.

4.3 再次查詢集群狀態

-- omm 用戶
[omm@opengauss-db1 ~]$ gs_om -t status --detail
[  CMServer State   ]

node             node_ip         instance                                    state
------------------------------------------------------------------------------------
1  opengauss-db1 192.168.17.112  1    /opt/gaussdb/install/data/cm/cm_server Primary
2  opengauss-db2 192.168.17.113  2    /opt/gaussdb/install/data/cm/cm_server Standby
3  opengauss-db3 192.168.17.139  3    /opt/gaussdb/install/data/cm/cm_server Standby

[   Cluster State   ]

cluster_state   : Normal
redistributing  : No
balanced        : Yes
current_az      : AZ_ALL

[  Datanode State   ]

node             node_ip         instance                           state            
-------------------------------------------------------------------------------------
1  opengauss-db1 192.168.17.112  6001 /opt/gaussdb/install/data/db1 P Primary Normal
2  opengauss-db2 192.168.17.113  6002 /opt/gaussdb/install/data/db1 S Standby Normal
3  opengauss-db3 192.168.17.139  6003 /opt/gaussdb/install/data/db1 S Standby Normal

4.4 洗掉SSH互信

-- omm 用戶,被縮容節點操作
[root@opengauss-db4 ~]# mv .ssh .ssh_back
[root@opengauss-db4 ~]# su - omm
Last login: Mon Nov 14 17:33:17 CST 2022 on pts/0
[omm@opengauss-db4 ~]$ mv .ssh .ssh_back

4.5 清理備庫資料

-- omm 用戶 在被清理備庫服務器操作
[root@opengauss-db4 ~]# su - omm
Last login: Mon Nov 14 18:28:56 CST 2022 on pts/3
[omm@opengauss-db4 ~]$ gs_uninstall --delete-data -L
This is a node where the gs_dropnode command has been executed. Uninstall a single node instead of the gs_dropnode command.
Checking uninstallation.
Successfully checked uninstallation.
Stopping the cluster.
Successfully stopped local node.
Successfully deleted instances.
Uninstalling application.
Successfully uninstalled application.
Uninstallation succeeded.

4.6 清理備庫軟體

-- 拷貝主庫 /opt/software/openGauss/script 目錄至被清理備庫
[root@opengauss-db1 ~]# cd /opt/software/openGauss/script/
[root@opengauss-db1 script]# scp * root@opengauss-db4:/opt/software/openGauss/script/

-- root 用戶 在被清理備庫操作執行清理備庫軟體及目錄
[root@opengauss-db4 ~]# cd /opt/software/openGauss/script/
[root@opengauss-db4 script]# ./gs_postuninstall -U omm -X /opt/software/openGauss/clusterconfig.xml --delete-user --delete-group -L
Parsing the configuration file.
Successfully parsed the configuration file.
Check log file path.
Successfully checked log file path.
Checking unpreinstallation.
Successfully checked unpreinstallation.
Deleting the instance's directory.
Successfully deleted the instance's directory.
Deleting the temporary directory.
Successfully deleted the temporary directory.
Deleting software packages and environmental variables of the local node.
Successfully deleted software packages and environmental variables of the local nodes.
Deleting local OS user.
Successfully deleted local OS user.
Deleting local node's logs.
Successfully deleted local node's logs.
Successfully cleaned environment.

4.7 清理備庫目錄

-- 根據clusterconfig.xml檔案,清理備庫相應目錄
[root@opengauss-db4 opt]# rm -rf /opt/gaussdb/
[root@opengauss-db4 ~]# rm -rf /root/gauss*

轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/536151.html

標籤:其它

上一篇:GaussDB CN服務例外實體分析

下一篇:MongoDB - 索引知識

標籤雲
其他(157675) Python(38076) JavaScript(25376) Java(17977) C(15215) 區塊鏈(8255) C#(7972) AI(7469) 爪哇(7425) MySQL(7132) html(6777) 基礎類(6313) sql(6102) 熊猫(6058) PHP(5869) 数组(5741) R(5409) Linux(5327) 反应(5209) 腳本語言(PerlPython)(5129) 非技術區(4971) Android(4554) 数据框(4311) css(4259) 节点.js(4032) C語言(3288) json(3245) 列表(3129) 扑(3119) C++語言(3117) 安卓(2998) 打字稿(2995) VBA(2789) Java相關(2746) 疑難問題(2699) 细绳(2522) 單片機工控(2479) iOS(2429) ASP.NET(2402) MongoDB(2323) 麻木的(2285) 正则表达式(2254) 字典(2211) 循环(2198) 迅速(2185) 擅长(2169) 镖(2155) 功能(1967) .NET技术(1958) Web開發(1951) python-3.x(1918) HtmlCss(1915) 弹簧靴(1913) C++(1909) xml(1889) PostgreSQL(1872) .NETCore(1853) 谷歌表格(1846) Unity3D(1843) for循环(1842)

熱門瀏覽
  • GPU虛擬機創建時間深度優化

    **?桔妹導讀:**GPU虛擬機實體創建速度慢是公有云面臨的普遍問題,由于通常情況下創建虛擬機屬于低頻操作而未引起業界的重視,實際生產中還是存在對GPU實體創建時間有苛刻要求的業務場景。本文將介紹滴滴云在解決該問題時的思路、方法、并展示最終的優化成果。 從公有云服務商那里購買過虛擬主機的資深用戶,一 ......

    uj5u.com 2020-09-10 06:09:13 more
  • 可編程網卡芯片在滴滴云網路的應用實踐

    **?桔妹導讀:**隨著云規模不斷擴大以及業務層面對延遲、帶寬的要求越來越高,采用DPDK 加速網路報文處理的方式在橫向縱向擴展都出現了局限性。可編程芯片成為業界熱點。本文主要講述了可編程網卡芯片在滴滴云網路中的應用實踐,遇到的問題、帶來的收益以及開源社區貢獻。 #1. 資料中心面臨的問題 隨著滴滴 ......

    uj5u.com 2020-09-10 06:10:21 more
  • 滴滴資料通道服務演進之路

    **?桔妹導讀:**滴滴資料通道引擎承載著全公司的資料同步,為下游實時和離線場景提供了必不可少的源資料。隨著任務量的不斷增加,資料通道的整體架構也隨之發生改變。本文介紹了滴滴資料通道的發展歷程,遇到的問題以及今后的規劃。 #1. 背景 資料,對于任何一家互聯網公司來說都是非常重要的資產,公司的大資料 ......

    uj5u.com 2020-09-10 06:11:05 more
  • 滴滴AI Labs斬獲國際機器翻譯大賽中譯英方向世界第三

    **桔妹導讀:**深耕人工智能領域,致力于探索AI讓出行更美好的滴滴AI Labs再次斬獲國際大獎,這次獲獎的專案是什么呢?一起來看看詳細報道吧! 近日,由國際計算語言學協會ACL(The Association for Computational Linguistics)舉辦的世界最具影響力的機器 ......

    uj5u.com 2020-09-10 06:11:29 more
  • MPP (Massively Parallel Processing)大規模并行處理

    1、什么是mpp? MPP (Massively Parallel Processing),即大規模并行處理,在資料庫非共享集群中,每個節點都有獨立的磁盤存盤系統和記憶體系統,業務資料根據資料庫模型和應用特點劃分到各個節點上,每臺資料節點通過專用網路或者商業通用網路互相連接,彼此協同計算,作為整體提供 ......

    uj5u.com 2020-09-10 06:11:41 more
  • 滴滴資料倉庫指標體系建設實踐

    **桔妹導讀:**指標體系是什么?如何使用OSM模型和AARRR模型搭建指標體系?如何統一流程、規范化、工具化管理指標體系?本文會對建設的方法論結合滴滴資料指標體系建設實踐進行解答分析。 #1. 什么是指標體系 ##1.1 指標體系定義 指標體系是將零散單點的具有相互聯系的指標,系統化的組織起來,通 ......

    uj5u.com 2020-09-10 06:12:52 more
  • 單表千萬行資料庫 LIKE 搜索優化手記

    我們經常在資料庫中使用 LIKE 運算子來完成對資料的模糊搜索,LIKE 運算子用于在 WHERE 子句中搜索列中的指定模式。 如果需要查找客戶表中所有姓氏是“張”的資料,可以使用下面的 SQL 陳述句: SELECT * FROM Customer WHERE Name LIKE '張%' 如果需要 ......

    uj5u.com 2020-09-10 06:13:25 more
  • 滴滴Ceph分布式存盤系統優化之鎖優化

    **桔妹導讀:**Ceph是國際知名的開源分布式存盤系統,在工業界和學術界都有著重要的影響。Ceph的架構和演算法設計發表在國際系統領域頂級會議OSDI、SOSP、SC等上。Ceph社區得到Red Hat、SUSE、Intel等大公司的大力支持。Ceph是國際云計算領域應用最廣泛的開源分布式存盤系統, ......

    uj5u.com 2020-09-10 06:14:51 more
  • es~通過ElasticsearchTemplate進行聚合~嵌套聚合

    之前寫過《es~通過ElasticsearchTemplate進行聚合操作》的文章,這一次主要寫一個嵌套的聚合,例如先對sex集合,再對desc聚合,最后再對age求和,共三層嵌套。 Aggregations的部分特性類似于SQL語言中的group by,avg,sum等函式,Aggregation ......

    uj5u.com 2020-09-10 06:14:59 more
  • 爬蟲日志監控 -- Elastc Stack(ELK)部署

    傻瓜式部署,只需替換IP與用戶 導讀: 現ELK四大組件分別為:Elasticsearch(核心)、logstash(處理)、filebeat(采集)、kibana(可視化) 下載均在https://www.elastic.co/cn/downloads/下tar包,各組件版本最好一致,配合fdm會 ......

    uj5u.com 2020-09-10 06:15:05 more
最新发布
  • day02-2-商鋪查詢快取

    功能02-商鋪查詢快取 3.商鋪詳情快取查詢 3.1什么是快取? 快取就是資料交換的緩沖區(稱作Cache),是存盤資料的臨時地方,一般讀寫性能較高。 快取的作用: 降低后端負載 提高讀寫效率,降低回應時間 快取的成本: 資料一致性成本 代碼維護成本 運維成本 3.2需求說明 如下,當我們點擊商店詳 ......

    uj5u.com 2023-04-20 08:33:24 more
  • MySQL中binlog備份腳本分享

    關于MySQL的二進制日志(binlog),我們都知道二進制日志(binlog)非常重要,尤其當你需要point to point災難恢復的時侯,所以我們要對其進行備份。關于二進制日志(binlog)的備份,可以基于flush logs方式先切換binlog,然后拷貝&壓縮到到遠程服務器或本地服務器 ......

    uj5u.com 2023-04-20 08:28:06 more
  • day02-短信登錄

    功能實作02 2.功能01-短信登錄 2.1基于Session實作登錄 2.1.1思路分析 2.1.2代碼實作 2.1.2.1發送短信驗證碼 發送短信驗證碼: 發送驗證碼的介面為:http://127.0.0.1:8080/api/user/code?phone=xxxxx<手機號> 請求方式:PO ......

    uj5u.com 2023-04-20 08:27:27 more
  • 快取與資料庫雙寫一致性幾種策略分析

    本文將對幾種快取與資料庫保證資料一致性的使用方式進行分析。為保證高并發性能,以下分析場景不考慮執行的原子性及加鎖等強一致性要求的場景,僅追求最終一致性。 ......

    uj5u.com 2023-04-20 08:26:48 more
  • sql陳述句優化

    問題查找及措施 問題查找 需要找到具體的代碼,對其進行一對一優化,而非一直把關注點放在服務器和sql平臺 降低簡化每個事務中處理的問題,盡量不要讓一個事務拖太長的時間 例如檔案上傳時,應將檔案上傳這一步放在事務外面 微軟建議 4.啟動sql定時執行計劃 怎么啟動sqlserver代理服務-百度經驗 ......

    uj5u.com 2023-04-20 08:26:35 more
  • 云時代,MySQL到ClickHouse資料同步產品對比推薦

    ClickHouse 在執行分析查詢時的速度優勢很好的彌補了MySQL的不足,但是對于很多開發者和DBA來說,如何將MySQL穩定、高效、簡單的同步到 ClickHouse 卻很困難。本文對比了 NineData、MaterializeMySQL(ClickHouse自帶)、Bifrost 三款產品... ......

    uj5u.com 2023-04-20 08:26:29 more
  • sql陳述句優化

    問題查找及措施 問題查找 需要找到具體的代碼,對其進行一對一優化,而非一直把關注點放在服務器和sql平臺 降低簡化每個事務中處理的問題,盡量不要讓一個事務拖太長的時間 例如檔案上傳時,應將檔案上傳這一步放在事務外面 微軟建議 4.啟動sql定時執行計劃 怎么啟動sqlserver代理服務-百度經驗 ......

    uj5u.com 2023-04-20 08:25:13 more
  • Redis 報”OutOfDirectMemoryError“(堆外記憶體溢位)

    Redis 報錯“OutOfDirectMemoryError(堆外記憶體溢位) ”問題如下: 一、報錯資訊: 使用 Redis 的業務介面 ,產生 OutOfDirectMemoryError(堆外記憶體溢位),如圖: 格式化后的報錯資訊: { "timestamp": "2023-04-17 22: ......

    uj5u.com 2023-04-20 08:24:54 more
  • day02-2-商鋪查詢快取

    功能02-商鋪查詢快取 3.商鋪詳情快取查詢 3.1什么是快取? 快取就是資料交換的緩沖區(稱作Cache),是存盤資料的臨時地方,一般讀寫性能較高。 快取的作用: 降低后端負載 提高讀寫效率,降低回應時間 快取的成本: 資料一致性成本 代碼維護成本 運維成本 3.2需求說明 如下,當我們點擊商店詳 ......

    uj5u.com 2023-04-20 08:24:03 more
  • day02-短信登錄

    功能實作02 2.功能01-短信登錄 2.1基于Session實作登錄 2.1.1思路分析 2.1.2代碼實作 2.1.2.1發送短信驗證碼 發送短信驗證碼: 發送驗證碼的介面為:http://127.0.0.1:8080/api/user/code?phone=xxxxx<手機號> 請求方式:PO ......

    uj5u.com 2023-04-20 08:23:11 more