diff --git a/content/zh/docs/installation/figures/zh-cn_image_0260397341.png b/content/zh/docs/installation/figures/zh-cn_image_0260397341.png new file mode 100644 index 0000000000000000000000000000000000000000..d35d9837729b2f9c9736d1545c064004d65aee3f Binary files /dev/null and b/content/zh/docs/installation/figures/zh-cn_image_0260397341.png differ diff --git a/content/zh/docs/installation/figures/zh-cn_image_0260397375.png b/content/zh/docs/installation/figures/zh-cn_image_0260397375.png new file mode 100644 index 0000000000000000000000000000000000000000..4c4630062be26837e33aa4c01704b7f47279e65d Binary files /dev/null and b/content/zh/docs/installation/figures/zh-cn_image_0260397375.png differ diff --git "a/content/zh/docs/installation/\344\270\200\344\270\273\344\270\200\345\244\207\351\205\215\347\275\256\346\226\207\344\273\266.md" "b/content/zh/docs/installation/\344\270\200\344\270\273\344\270\200\345\244\207\351\205\215\347\275\256\346\226\207\344\273\266.md" deleted file mode 100644 index 49640a784dec238471e8e8b47fbfa98dea294cc4..0000000000000000000000000000000000000000 --- "a/content/zh/docs/installation/\344\270\200\344\270\273\344\270\200\345\244\207\351\205\215\347\275\256\346\226\207\344\273\266.md" +++ /dev/null @@ -1,48 +0,0 @@ -# 一主一备配置文件 - -``` - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -``` - diff --git "a/content/zh/docs/installation/\344\270\200\351\224\256\345\274\217\347\216\257\345\242\203\346\270\205\347\220\206.md" "b/content/zh/docs/installation/\344\270\200\351\224\256\345\274\217\347\216\257\345\242\203\346\270\205\347\220\206.md" deleted file mode 100644 index 72c990ea013b035e803bb9c7a807feb6e65b0c2a..0000000000000000000000000000000000000000 --- "a/content/zh/docs/installation/\344\270\200\351\224\256\345\274\217\347\216\257\345\242\203\346\270\205\347\220\206.md" +++ /dev/null @@ -1,92 +0,0 @@ -# 一键式环境清理 - -在openGauss卸载完成后,如果不需要在环境上重新部署openGauss,可以运行脚本gs\_postuninstall对openGauss服务器上环境信息做清理。openGauss环境清理是对环境准备脚本gs\_preinstall所做设置的清理。 - -## 前提条件 - -- openGauss卸载执行成功。 -- root用户互信可用。 -- 只能使用root用户执行gs\_postuninstall命令。 - -## 操作步骤 - -1. 以root用户登录openGauss服务器。 -2. 查看root用户互信是否建立,如果root用户没有建立互信,需要手工建立root用户互信,操作参考3.2.2手工建立互信。 - - 查看互信是否建成功,可以互相ssh主机名。输入exit退出。 - - ``` - plat1:~ # ssh plat2 - Last login: Tue Jan 5 10:28:18 2016 from plat1 - Huawei's internal systems must only be used for conducting Huawei's business or for purposes authorized by Huawei management.Use is subject to audit at any time by Huawei management. - plat2:~ # exit - logout - Connection to plat2 closed. - plat1:~ # - ``` - -3. 进入script路径下 - - ``` - cd /opt/software/openGauss/script - ``` - -4. 使用gs\_postuninstall进行清理。若为环境变量分离的模式安装的集群需要source环境变量分离文件ENVFILE。 - - ``` - ./gs_postuninstall -U omm -X /opt/software/openGauss/cluster_config.xml --delete-user --delete-group - ``` - - 或者在openGauss中每个节点执行本地后置清理。 - - ``` - ./gs_postuninstall -U omm -X /opt/software/openGauss/cluster_config.xml --delete-user --delete-group -L - ``` - - omm为运行openGauss的操作系统用户名,/opt/software/openGauss/cluster\_config.xml为openGauss配置文件路径。 - - 若为环境变量分离的模式安装的集群需删除之前source的环境变量分离的env参数 - - unset MPPDB\_ENV\_SEPARATE\_PATH - -5. 删除openGauss数据库各节点root用户的互信,操作参考3.2.2手工建立互信的删除root用户互信部分内容。 - -## 示例 - -清理主机的环境 - -``` -gs_postuninstall -U omm -X /opt/software/openGauss/cluster_config.xml --delete-user -Parsing the configuration file. -Successfully parsed the configuration file. -Check log file path. -Successfully checked log file path. -Checking unpreinstallation. -Successfully checked unpreinstallation. -Deleting Cgroup. -Successfully deleted Cgroup. -Deleting the instance's directory. -Successfully deleted the instance's directory. -Deleting the installation directory. -Successfully deleted the installation directory. -Deleting the temporary directory. -Successfully deleted the temporary directory. -Deleting remote OS user. -Successfully deleted remote OS user. -Deleting software packages and environmental variables of other nodes. -Successfully deleted software packages and environmental variables of other nodes. -Deleting logs of other nodes. -Successfully deleted logs of other nodes. -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. -``` - -## 错误排查 - -如果一键式环境清理失败请根据“$GAUSSLOG/om/gs\_postuninstall-YYYY-MM-DD\_HHMMSS.log”中的日志信息排查错误。 - diff --git "a/content/zh/docs/installation/\344\272\206\350\247\243\345\256\211\350\243\205\346\265\201\347\250\213.md" "b/content/zh/docs/installation/\344\272\206\350\247\243\345\256\211\350\243\205\346\265\201\347\250\213.md" index 223ebe59b78cc7100857f6d7f16bf836e215cc49..46a4ff155e44c412a3b45cb0721cd7c558c70a92 100644 --- "a/content/zh/docs/installation/\344\272\206\350\247\243\345\256\211\350\243\205\346\265\201\347\250\213.md" +++ "b/content/zh/docs/installation/\344\272\206\350\247\243\345\256\211\350\243\205\346\265\201\347\250\213.md" @@ -1,15 +1,15 @@ -# 了解安装流程 - -本章节通过流程图简要介绍openGauss的安装流程。 - -openGauss的安装流程如[图1](#fig18264185162412)所示。 - -**图 1** 安装流程图 -![](figures/安装流程图.png "安装流程图") - -**表 1** 安装流程图说明 - - +# 了解安装流程 + +本章节通过流程图简要介绍openGauss的安装流程。 + +openGauss的安装流程如[图1](#fig18264185162412)所示。 + +**图 1** 安装流程图 +![](figures/安装流程图.png "安装流程图") + +**表 1** 安装流程图说明 + + -

流程

说明

@@ -52,5 +52,5 @@ openGauss的安装流程如[图1](#fig18264185162412)所示。
- + + diff --git "a/content/zh/docs/installation/\344\272\206\350\247\243\345\256\211\350\243\205\347\224\250\346\210\267\345\217\212\347\224\250\346\210\267\347\273\204.md" "b/content/zh/docs/installation/\344\272\206\350\247\243\345\256\211\350\243\205\347\224\250\346\210\267\345\217\212\347\224\250\346\210\267\347\273\204.md" index c0492a9da6700a5b761b8d0b56893e267914d0a8..0409d06dd8a6ff67999b153590c5b38774575d0b 100644 --- "a/content/zh/docs/installation/\344\272\206\350\247\243\345\256\211\350\243\205\347\224\250\346\210\267\345\217\212\347\224\250\346\210\267\347\273\204.md" +++ "b/content/zh/docs/installation/\344\272\206\350\247\243\345\256\211\350\243\205\347\224\250\346\210\267\345\217\212\347\224\250\346\210\267\347\273\204.md" @@ -1,8 +1,8 @@ -# 了解安装用户及用户组 - -为了实现安装过程中安装帐户权限最小化,及安装后openGauss的系统运行安全性。安装脚本在安装过程中会自动按照用户指定创建安装用户,并将此用户作为后续运行和维护openGauss的管理员帐户。 - - +# 了解安装用户及用户组 + +为了实现安装过程中安装帐户权限最小化,及安装后openGauss的系统运行安全性。安装脚本在安装过程中会自动按照用户指定创建安装用户,并将此用户作为后续运行和维护openGauss的管理员帐户。 + + -

用户/组名

所属类型

@@ -31,7 +31,7 @@
- -在安装openGauss过程中运行“gs\_install”时,会创建与安装用户同名的数据库用户,即数据库用户omm。此用户具备数据库的最高操作权限,此用户初始密码由用户指定。 - + + +在安装openGauss过程中运行“gs\_install”时,会创建与安装用户同名的数据库用户,即数据库用户omm。此用户具备数据库的最高操作权限,此用户初始密码由用户指定。 + diff --git "a/content/zh/docs/installation/\344\277\256\346\224\271\346\223\215\344\275\234\347\263\273\347\273\237\351\205\215\347\275\256.md" "b/content/zh/docs/installation/\344\277\256\346\224\271\346\223\215\344\275\234\347\263\273\347\273\237\351\205\215\347\275\256.md" deleted file mode 100644 index 46dd41c9ee029d45974d8e64343dda9b0b48431f..0000000000000000000000000000000000000000 --- "a/content/zh/docs/installation/\344\277\256\346\224\271\346\223\215\344\275\234\347\263\273\347\273\237\351\205\215\347\275\256.md" +++ /dev/null @@ -1,15 +0,0 @@ -# 修改操作系统配置 - -- **[关闭操作系统防火墙](关闭操作系统防火墙.md)** -为了在防火墙开启的状态下,确保openGauss的正常使用。用户需要将同openGauss相关的服务、协议、IP以及端口添加到openGauss各主机的防火墙白名单中。 -- **[设置字符集参数](设置字符集参数.md)** - -- **[设置时区和时间](设置时区和时间.md)** - -- **[关闭swap交换内存](关闭swap交换内存.md)** - -- **[设置网卡MTU值](设置网卡MTU值.md)** - -- **[配置操作系统参数](配置操作系统参数.md)** -openGauss要求各主机上的操作系统参数设置成一定的值,以满足系统运行的性能要求等。 - diff --git "a/content/zh/docs/installation/\345\205\263\351\227\255swap\344\272\244\346\215\242\345\206\205\345\255\230.md" "b/content/zh/docs/installation/\345\205\263\351\227\255swap\344\272\244\346\215\242\345\206\205\345\255\230.md" deleted file mode 100644 index d2579ea02451cf211ed2ad67fdee9243a0e36d9d..0000000000000000000000000000000000000000 --- "a/content/zh/docs/installation/\345\205\263\351\227\255swap\344\272\244\346\215\242\345\206\205\345\255\230.md" +++ /dev/null @@ -1,8 +0,0 @@ -# 关闭swap交换内存 - -在各数据库节点上,使用swapoff -a命令将交换内存关闭。 - -``` -swapoff -a -``` - diff --git "a/content/zh/docs/installation/\345\205\263\351\227\255\346\223\215\344\275\234\347\263\273\347\273\237\351\230\262\347\201\253\345\242\231.md" "b/content/zh/docs/installation/\345\205\263\351\227\255\346\223\215\344\275\234\347\263\273\347\273\237\351\230\262\347\201\253\345\242\231.md" deleted file mode 100644 index 946da007b1d4b8a446162280a3d8ed20fc5bea09..0000000000000000000000000000000000000000 --- "a/content/zh/docs/installation/\345\205\263\351\227\255\346\223\215\344\275\234\347\263\273\347\273\237\351\230\262\347\201\253\345\242\231.md" +++ /dev/null @@ -1,97 +0,0 @@ -# 关闭操作系统防火墙 - -为了在防火墙开启的状态下,确保openGauss的正常使用。用户需要将同openGauss相关的服务、协议、IP以及端口添加到openGauss各主机的防火墙白名单中。 - -以openEuler操作系统为例,假设openGauss信息如[表1](#zh-cn_topic_0241802566_zh-cn_topic_0085434636_zh-cn_topic_0059782018_table4312170510523)所示。 - -**表 1** openGauss信息 - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

主机名称

-

内部IP

-

外部IP

-

plat1

-

192.168.0.11

-

10.10.0.11

-

plat2

-

192.168.0.12

-

10.10.0.12

-

plat3

-

192.168.0.13

-

10.10.0.13

-

plat4

-

192.168.0.14

-

10.10.0.14

-

管理网络

-

-

-

10.10.64.236

-
- -## 操作步骤 - -目前仅支持在防火墙关闭的状态下进行安装。 - -1. 修改/etc/selinux/config文件中的“SELINUX“值为“disabled“。 - 1. 使用VIM打开config文件。 - - ``` - vim /etc/selinux/config - ``` - - 2. 修改“SELINUX“的值“disabled“。 - - ``` - SELINUX=disabled - ``` - -2. 重新启动操作系统。 - - ``` - reboot - ``` - -3. 检查防火墙是否关闭。 - - ``` - systemctl status firewalld - ``` - - 若防火墙未关闭,请执行[4](#li17330102819394); - - 若防火墙已关闭,则无需再关闭防火墙。 - -4. 关闭防火墙。 - - ``` - systemctl disable firewalld.service - systemctl stop firewalld.service - ``` - -5. 在其他主机上重复步骤1到步骤4。 - diff --git "a/content/zh/docs/installation/\345\207\206\345\244\207\345\256\211\350\243\205\347\224\250\346\210\267\345\217\212\347\216\257\345\242\203.md" "b/content/zh/docs/installation/\345\207\206\345\244\207\345\256\211\350\243\205\347\224\250\346\210\267\345\217\212\347\216\257\345\242\203.md" deleted file mode 100644 index 2ae03866e1c129594f7dbe651fb1cd029ff09760..0000000000000000000000000000000000000000 --- "a/content/zh/docs/installation/\345\207\206\345\244\207\345\256\211\350\243\205\347\224\250\346\210\267\345\217\212\347\216\257\345\242\203.md" +++ /dev/null @@ -1,298 +0,0 @@ -# 准备安装用户及环境 - -创建完openGauss配置文件后,在执行安装前,为了后续能以最小权限进行安装及openGauss管理操作,保证系统安全性,需要运行安装前置脚本gs\_preinstall准备好安装用户及环境。 - -安装前置脚本gs\_preinstall可以协助用户自动完成如下的安装环境准备工作: - -- 自动设置Linux内核参数以达到提高服务器负载能力的目的。这些参数直接影响数据库系统的运行状态,请仅在确认必要时调整。openGauss所设置的Linux内核参数取值请参见[配置操作系统参数](配置操作系统参数.md)。 -- 自动将openGauss配置文件、安装包拷贝到openGauss主机的相同目录下。 -- openGauss安装用户、用户组不存在时,自动创建安装用户以及用户组。 -- 读取openGauss配置文件中的目录信息并创建,将目录权限授予安装用户。 - -## 前提条件 - -- 已完成[安装准备](安装准备.md)的所有任务。 - -## 注意事项 - -- 用户需要检查上层目录权限,保证安装用户对安装包和配置文件目录读写执行的权限。 -- xml文件中各主机的名称与IP映射配置正确。 -- 只能使用root用户执行gs\_preinstall命令。 - -## 操作步骤 - -1. 以root用户登录待安装openGauss的任意主机,并按规划创建存放安装包的目录。 - - ``` - mkdir -p /opt/software/openGauss - chmod 755 -R /opt/software - ``` - - >![](public_sys-resources/icon-note.gif) **说明:** - >- 不建议把安装包的存放目录规划到openGauss用户的家目录或其子目录下,可能导致权限问题。 - >- openGauss用户须具有/opt/software/openGauss目录的读写权限。 - -2. 将安装包“openGauss-x.x.x-openEULER-64bit.tar.gz”和配置文件“cluster\_config.xml”都上传至上一步所创建的目录中。 -3. 在安装包所在的目录下,解压安装包openGauss-x.x.x-openEULER-64bit.tar.gz。安装包解压后,会在/opt/software/openGauss路径下自动生成script子目录,并且在script目录下生成gs\_preinstall等各种OM工具脚本。 - - ``` - cd /opt/software/openGauss - tar -zxvf openGauss-x.x.x-openEULER-64bit.tar.gz - ``` - - >![](public_sys-resources/icon-note.gif) **说明:** - >- 在执行前置脚本gs\_preinstall时,需要规划好openGauss配置文件路径、安装包存放路径、程序安装目录、实例数据目录,后续普通用户使用过程中不能再更改这些路径。 - >- 运行前置脚本gs\_preinstall准备安装环境时,脚本内部会自动将openGauss配置文件、解压后的安装包同步拷贝到其余服务器的相同目录下。 - >- 在执行前置或者互信前,请检查/etc/profile文件中是否包含错误输出信息,如果存在错误输出,需手动处理。 - -4. 进入到工具脚本存放目录下。 - - ``` - cd /opt/software/openGauss/script - ``` - -5. 如果是openEuler的操作系统,执行如下命令打开performance.sh文件,用\#注释sysctl -w vm.min\_free\_kbytes=112640 &\> /dev/null,键入“ESC”键进入指令模式,执行**:wq**保存并退出修改。 - - ``` - vi /etc/profile.d/performance.sh - ``` - -6. 为确保openssl版本正确,执行预安装前请加载安装包中lib库。执行命令如下,其中_\{packagePath\}_为用户安装包放置的路径,本示例中为/opt/software/openGauss。 - - ``` - export LD_LIBRARY_PATH={packagePath}/script/gspylib/clib:$LD_LIBRARY_PATH - ``` - -7. 为确保成功安装,检查 hostname 与 /etc/hostname 是否一致。预安装过程中,会对hostname进行检查。 -8. 使用gs\_preinstall准备好安装环境。若为共用环境需加入--sep-env-file=ENVFILE参数分离环境变量,避免与其他用户相互影响,ENVFILE为用户自行指定的环境变量分离文件的路径。 - - 采用交互模式执行前置,并在执行过程中自动创建root用户互信和openGauss用户互信: - - ``` - ./gs_preinstall -U omm -G dbgrp -X /opt/software/openGauss/cluster_config.xml - ``` - - omm为数据库管理员(也是运行openGauss的操作系统用户),dbgrp为运行openGauss的操作系统用户的群组名称,/opt/software/openGauss/cluster\_config.xml为openGauss配置文件路径。在执行过程中,用户根据提示选择是否创建互信,并输入root用户或openGauss用户的密码。 - - - 不允许创建root用户互信时,创建omm用户,在各主机上执行本地模式前置,然后用户手动创建openGauss用户互信:如果预安装指定-L参数,预安装前需手动将所有节点的主机名和ip映射关系,写入各个主机的/etc/hosts,并在每个映射关系后边加入注释内容:\#Gauss OM IP Hosts Mapping。 - 1. 执行下面命令准备安装环境。 - - ``` - cd /opt/software/openGauss/script - ./gs_preinstall -U omm -G dbgrp -L -X /opt/software/openGauss/cluster_config.xml - ``` - - >![](public_sys-resources/icon-note.gif) **说明:** - >此操作需要在每台主机上执行该命令。 - - - - 采用非交互模式执行前置: - 1. 参考[手工建立互信](手工建立互信.md)章节手工建立root用户互信和openGauss用户互信。 - 2. 执行下面命令准备安装环境。 - - ``` - cd /opt/software/openGauss/script - ./gs_preinstall -U omm -G dbgrp -X /opt/software/openGauss/cluster_config.xml --non-interactive - ``` - - >![](public_sys-resources/icon-note.gif) **说明:** - >- 此模式要求用户确保在执行前,已经建立了各节点root用户互信和openGauss用户互信。 - >- root用户互信可能会存在安全隐患,因此建议用户在执行完安装后,立即删除各主机上root用户的互信。 - - - - -## 示例 - -执行前置脚本: - -``` -plat1:/opt/software/openGauss/script # ./gs_preinstall -U omm -G dbgrp -X /opt/software/openGauss/cluster_config.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 -Please enter password for root. -Password: -Creating SSH trust for the root permission user. -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. -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 the root permission user. -Setting pssh path -Successfully set core path. -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 -Please enter password for cluster user. -Password: -Please enter password for cluster user again. -Password: -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. -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. -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. -Setting SCTP service. -Successfully set SCTP service. -Set and check OS parameter. -Setting OS parameters. -Successfully set OS parameters. -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. -Set ARM Optimization. -No need to set ARM Optimization. -Fixing server package owner. -Setting finish flag. -Successfully set finish flag. -Preinstallation succeeded. -``` - -root密码不一致也不能修改为一致,执行前置脚本本地安装模式: - -``` -plat1:/opt/software/openGauss/script # ./gs_preinstall -U omm -G dbgrp -L -X /opt/software/openGauss/cluster_config.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. -Checking OS version. -Successfully checked OS version. -Creating cluster's path. -Successfully created cluster's path. -Setting SCTP service. -Successfully set SCTP service. -Set and check OS parameter. -Setting OS parameters. -Successfully set OS parameters. -Warning: Installation environment contains some warning messages. -Please get more details by "/home/package/r8c00/script/gs_checkos -i A -h SIA1000068990". -Set and check OS parameter completed. -Preparing CRON service. -Successfully prepared CRON service. -Preparing SSH service. -Successfully prepared SSH service. -Setting user environmental variables. -Successfully set user environmental variables. -Configuring alarms on the cluster nodes. -Successfully configured alarms on the cluster nodes. -Setting the dynamic link library. -Successfully set the dynamic link library. -Setting Cgroup. -Successfully set Cgroup. -Setting finish flag. -Successfully set finish flag. -Preinstallation succeeded. -``` - -以非交互模式执行前置: - -``` -plat1:/opt/software/openGauss/script # ./gs_preinstall -U omm -G dbgrp -X /opt/software/openGauss/cluster_config.xml --non-interactive -Parsing the configuration file. -Successfully parsed the configuration file. -Installing the tools on the local node. -Successfully installed the tools on the local node. -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. -Installing the tools in the cluster. -Successfully installed the tools in the cluster. -Checking hostname mapping. -Successfully checked hostname mapping. -Checking OS version. -Successfully checked OS version. -Creating cluster's path. -Successfully created cluster's path. -Setting SCTP service. -Successfully set SCTP service. -Set and check OS parameter. -Setting OS parameters. -Successfully set OS parameters. -Set and check OS parameter completed. -Preparing CRON service. -Successfully prepared CRON service. -Preparing SSH service. -Successfully prepared SSH service. -Setting user environmental variables. -Successfully set user environmental variables. -Configuring alarms on the cluster nodes. -Successfully configured alarms on the cluster nodes. -Setting the dynamic link library. -Successfully set the dynamic link library. -Setting Cgroup. -Successfully set Cgroup. -Set ARM Optimization. -Successfully set ARM Optimization. -Setting finish flag. -Successfully set finish flag. -Preinstallation succeeded. -``` - -## 错误排查 - -如果准备安装环境失败请根据openGauss日志目录“$GAUSSLOG/om”下的“gs\_preinstall-YYYY-MM-DD\_HHMMSS.log”和“gs\_local-YYYY-MM-DD\_HHMMSS.log”中的日志信息排查错误。例如配置文件中“gaussdbLogPath”参数指定的路径为“/var/log/gaussdb”,则“$GAUSSLOG/om”路径为“/var/log/gaussdb/omm/om”,omm用户为运行openGauss的用户。 - ->![](public_sys-resources/icon-notice.gif) **须知:** ->准备安装用户及环境的过程中会使用root添加定时任务用于定时巡检和上报。 - diff --git "a/content/zh/docs/installation/\345\207\206\345\244\207\350\275\257\347\241\254\344\273\266\345\256\211\350\243\205\347\216\257\345\242\203.md" "b/content/zh/docs/installation/\345\207\206\345\244\207\350\275\257\347\241\254\344\273\266\345\256\211\350\243\205\347\216\257\345\242\203.md" index 7a67ee06200bc3f01e2885d71e32d4bee349ea97..e41511c4ee1a354b3721d3ded36a45a89de3b0a6 100644 --- "a/content/zh/docs/installation/\345\207\206\345\244\207\350\275\257\347\241\254\344\273\266\345\256\211\350\243\205\347\216\257\345\242\203.md" +++ "b/content/zh/docs/installation/\345\207\206\345\244\207\350\275\257\347\241\254\344\273\266\345\256\211\350\243\205\347\216\257\345\242\203.md" @@ -1,11 +1,360 @@ -# 准备软硬件安装环境 - -本章节描述安装前需要进行的环境准备。 - -- **[软硬件环境要求](软硬件环境要求.md)** -介绍openGauss的软硬件环境要求。建议部署openGauss的各服务器具有等价的软硬件配置。 -- **[修改操作系统配置](修改操作系统配置.md)** - -- **[设置root用户远程登录](设置root用户远程登录.md)** -在openGauss安装时需要root帐户远程登录访问权限,本章介绍如何设置使用root用户远程登录。 - +# 准备软硬件安装环境 + +本章节描述安装前需要进行的环境准备。 + + + +- [软硬件环境要求](#软硬件环境要求a-namezh-cn_topic_0249784577a) + - [硬件环境要求](#硬件环境要求a-namezh-cn_topic_0241802565_zh-cn_topic_0085434629_zh-cn_topic_0059782022_sdd36768784254b8ba03c77c86b831caea) + - [软件环境要求](#软件环境要求a-namezh-cn_topic_0241802565_zh-cn_topic_0085434629_zh-cn_topic_0059782022_s3124e90db74142ddaf11e2e8fd69cadba) + - [软件依赖要求](#软件依赖要求a-namesection5459315183816a) +- [修改操作系统配置](#修改操作系统配置a-namezh-cn_topic_0249784574a) + - [关闭操作系统防火墙](#关闭操作系统防火墙a-namesection178235734314a) + - [设置字符集参数](#设置字符集参数a-namesection17609182719467a) + - [设置时区和时间](#设置时区和时间a-namesection2058219344711a) + - [关闭swap交换内存](#关闭swap交换内存a-namesection1868124934810a) + - [设置网卡MTU值](#设置网卡mtu值a-namesection23866245014a) +- [设置root用户远程登录](#设置root用户远程登录a-namezh-cn_topic_0249784566a) + + + +## 软硬件环境要求 + +介绍openGauss的软硬件环境要求。建议部署openGauss的各服务器具有等价的软硬件配置。 + +### 硬件环境要求 + +[表1](#zh-cn_topic_0241802565_zh-cn_topic_0085434629_zh-cn_topic_0059782022_t62cd0eed17004265b1b8ad98f302a4bc)列出了openGauss服务器应具备的最低硬件要求。在实际产品中,硬件配置的规划需考虑数据规模及所期望的数据库响应速度。请根据实际情况进行规划。 + +**表 1** 硬件环境要求 + + + + + + + + + + + + + + + + + + + +

项目

+

配置描述

+

内存

+

功能调试建议32GB以上。

+

性能测试和商业部署时,单实例部署建议128GB以上。

+

复杂的查询对内存的需求量比较高,在高并发场景下,可能出现内存不足。此时建议使用大内存的机器,或使用负载管理限制系统的并发。

+

CPU

+

功能调试最小1×8 核 2.0GHz。

+

性能测试和商业部署时,单实例部署建议1×16核 2.0GHz。

+

CPU超线程和非超线程两种模式都支持。但是,openGauss各节点的设置需保持一致。

+

硬盘

+

用于安装openGauss的硬盘需最少满足如下要求:

+
  • 至少1GB用于安装openGauss的应用程序包。
  • 每个主机需大约300MB用于元数据存储。
  • 预留70%以上的磁盘剩余空间用于数据存储。
+

建议系统盘配置为Raid1,数据盘配置为Raid5,且规划4组Raid5数据盘用于安装openGauss。有关Raid的配置方法在本手册中不做介绍。请参考硬件厂家的手册或互联网上的方法进行配置,其中Disk Cache Policy一项需要设置为Disabled,否则机器异常掉电后有数据丢失的风险。

+

openGauss支持使用SSD盘作为数据库的主存储设备,支持SAS接口和NVME协议的SSD盘,以RAID的方式部署使用。

+

网络要求

+

300兆以上以太网。

+

建议网卡设置为双网卡冗余bond。有关网卡冗余bond的配置方法在本手册中不做介绍。请参考硬件厂商的手册或互联网上的方法进行配置。

+

openGauss网络如果配置bond,请保证bond模式一致,不一致的bond配置可能导致openGauss工作异常。

+
+ +### 软件环境要求 + +**表 2** 软件环境要求 + + + + + + + + + + + + + + + + + + + +

软件类型

+

配置描述

+

Linux操作系统

+

openEuler 20.3LTS和CentOS 7.6

+

Linux文件系统

+

剩余inode个数 > 15亿(推荐)

+

工具

+

bzip2

+

Python

+
  • openEuler:支持Python 3.7.X
  • CentOS:支持Python 3.6.X
+
+ +### 软件依赖要求 + +openGauss的软件依赖要求如[表 软件依赖要求](#table1212531681911)所示。 + +建议使用上述操作系统安装光盘或者源中,下列依赖软件的默认安装包,若不存在下列软件,可参看软件对应的建议版本。 + +**表 3** 软件依赖要求 + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

所需软件

+

建议版本

+

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

+

lsb_release

+

建议版本:4.1

+
+ +## 修改操作系统配置 + +### 关闭操作系统防火墙 + +为了在防火墙开启的状态下,确保openGauss的正常使用。用户需要将同openGauss相关的服务、协议、IP以及端口添加到openGauss各主机的防火墙白名单中。 + +以openEuler操作系统为例,假设openGauss信息如[表 openGauss信息](#zh-cn_topic_0241802566_zh-cn_topic_0085434636_zh-cn_topic_0059782018_table4312170510523)所示。 + +**表 1** openGauss信息 + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

主机名称

+

内部IP

+

外部IP

+

plat1

+

192.168.0.11

+

10.10.0.11

+

plat2

+

192.168.0.12

+

10.10.0.12

+

plat3

+

192.168.0.13

+

10.10.0.13

+

plat4

+

192.168.0.14

+

10.10.0.14

+

管理网络

+

-

+

10.10.64.236

+
+ +**操作步骤** + +目前仅支持在防火墙关闭的状态下进行安装。 + +1. 修改/etc/selinux/config文件中的“SELINUX“值为“disabled“。 + 1. 使用VIM打开config文件。 + + ``` + vim /etc/selinux/config + ``` + + 2. 修改“SELINUX“的值“disabled“。 + + ``` + SELINUX=disabled + ``` + +2. 重新启动操作系统。 + + ``` + reboot + ``` + +3. 检查防火墙是否关闭。 + + ``` + systemctl status firewalld + ``` + + 若防火墙未关闭,请执行[4](#li17330102819394); + + 若防火墙已关闭,则无需再关闭防火墙。 + +4. 关闭防火墙。 + + ``` + systemctl disable firewalld.service + systemctl stop firewalld.service + ``` + +5. 在其他主机上重复步骤1到步骤4。 + +### 设置字符集参数 + +将各数据库节点的字符集设置为相同的字符集,可以在/etc/profile文件中添加"export LANG=XXX"(XXX为Unicode编码)。 + +``` +vim /etc/profile +``` + +### 设置时区和时间 + +将各数据库节点的时区设置为相同时区,可以将/usr/share/zoneinfo/目录下的时区文件拷贝为/etc/localtime文件。 + +``` +cp /usr/share/zoneinfo/$地区/$时区 /etc/localtime +``` + +>![](public_sys-resources/icon-note.gif) **说明:** +>_$地区/$时区为需要设置时区的信息,例如:Asia_/Shanghai。 + +使用date -s命令将各主机的时间设置为统一时间,举例如下。 + +``` +date -s Mon May 11 16:42:11 CST 2020 +``` + +>![](public_sys-resources/icon-note.gif) **说明:** +>可以通过date命令查询主机时区。 + +### 关闭swap交换内存 + +在各数据库节点上,使用swapoff -a命令将交换内存关闭。 + +``` +swapoff -a +``` + +### 设置网卡MTU值 + +将各数据库节点的网卡MTU值设置为相同大小。对于X86,MTU值推荐1500;对于ARM,MTU值推荐8192。 + +``` +ifconfig 网卡编号 mtu 值 +``` + +## 设置root用户远程登录 + +在openGauss安装时需要root帐户远程登录访问权限,本章介绍如何设置使用root用户远程登录。 + +1. 修改PermitRootLogin配置,允许用户远程登录。 + 1. 打开sshd\_config文件。 + + ``` + vim /etc/ssh/sshd_config + ``` + + 2. 修改权限配置,可以使用以下两种方式实现: + - 注释掉“PermitRootLogin no”。 + + ``` + #PermitRootLogin no + ``` + + - 将“PermitRootLogin“改为“yes“。 + + ``` + PermitRootLogin yes + ``` + + 3. 执行**:wq**保存并退出编辑页面。 + +2. 修改Banner配置,去掉连接到系统时,系统提示的欢迎信息。欢迎信息会干扰安装时远程操作的返回结果,影响安装正常执行。 + 1. 编辑sshd\_config文件。 + + ``` + vim /etc/ssh/sshd_config + ``` + + 2. 修改Banner配置,注释掉“Banner”所在的行。 + + ``` + #Banner XXXX + ``` + + 3. 执行**:wq**保存并退出编辑页面。 + +3. 使用如下命令使设置生效。 + + ``` + service sshd restart + ``` + + >![](public_sys-resources/icon-caution.gif) **注意:** + >若执行命令后返回提示信息“Redirecting to /bin/systemctl restart sshd.service”,请执行命令:/bin/systemctl restart sshd.service。 + +4. 以root用户身份重新登录。 + + ``` + ssh xxx.xxx.xxx.xxx + ``` + + >![](public_sys-resources/icon-note.gif) **说明:** + >xxx.xxx.xxx.xxx为安装openGauss环境的ip。 + + + \ No newline at end of file diff --git "a/content/zh/docs/installation/\345\210\233\345\273\272XML\351\205\215\347\275\256\346\226\207\344\273\266.md" "b/content/zh/docs/installation/\345\210\233\345\273\272XML\351\205\215\347\275\256\346\226\207\344\273\266.md" index a94db3067221c0f04c71f2d9f229ca6db753887c..8b72e73451f7690a89e6441159bb8a14549f61ef 100644 --- "a/content/zh/docs/installation/\345\210\233\345\273\272XML\351\205\215\347\275\256\346\226\207\344\273\266.md" +++ "b/content/zh/docs/installation/\345\210\233\345\273\272XML\351\205\215\347\275\256\346\226\207\344\273\266.md" @@ -1,15 +1,333 @@ -# 创建XML配置文件 - -安装openGauss前需要创建cluster\_config.xml文件。cluster\_config.xml文件包含部署openGauss的服务器信息、安装路径、IP地址以及端口号等。用于告知openGauss如何部署。用户需根据不同场配置对应的XML文件。 - -下面以一主一备的方案为例,说明如何创建XML配置文件。 - -- **[配置数据库名称及各项目录](配置数据库名称及各项目录.md)** - -- **[配置Host基本信息](配置Host基本信息.md)** - -- **[配置数据库主节点信息](配置数据库主节点信息.md)** - -- **[示例](示例.md)** - - +# 创建XML配置文件 + +安装openGauss前需要创建cluster\_config.xml文件。cluster\_config.xml文件包含部署openGauss的服务器信息、安装路径、IP地址以及端口号等。用于告知openGauss如何部署。用户需根据不同场配置对应的XML文件。 + +下面以一主一备的方案为例,说明如何创建XML配置文件。 + + + +- [配置数据库名称及各项目录](#配置数据库名称及各项目录a-namezh-cn_topic_0249784584a) +- [配置Host基本信息](#配置host基本信息a-namezh-cn_topic_0249784567a) +- [配置数据库主节点信息](#配置数据库主节点信息a-namezh-cn_topic_0249784583a) +- [示例](#示例a-namezh-cn_topic_0249784528a) + - [单节点配置文件](#单节点配置文件a-namesection1698454873416a) + - [一主一备配置文件](#一主一备配置文件a-namesection946242113712a) + + + + +## 配置数据库名称及各项目录 + +在script/gspylib/etc/conf/cluster\_config\_template.xml获取XML文件模板。加粗字体内容为示例,可自行替换。每行信息均有注释进行说明。 + +``` + + + + + + + + + + + + + + + + + + + + + + +``` + +>![](public_sys-resources/icon-notice.gif) **须知:** +>- “/opt/huawei/install/om”存放互信等工具,避免权限问题,不要把实例数据目录放在此目录下。 +>- 安装目录和数据目录需为空或者不存在,否则可能导致安装失败。 +>- 在对数据库节点的实例进行具体配置时,需确保配置的目录之间不相互耦合。即各个配置目录不关联,删除其中任意一个目录,不会级联删除其它目录。如gaussdbAppPath为"/opt/huawei/install/app",gaussdbLogPath为"/opt/huawei/install/app/omm"。当gaussdbAppPath目录被删除时,会级联删除gaussdbLogPath目录,从而引起其它问题。 +>- 若需要安装脚本自动创建安装用户时各配置的目录需保证不与系统创建的默认用户目录耦合关联。 +>- 配置openGauss路径和实例路径时,路径中不能包含"|",";","&","$","<","\>","\`","\\\\","'","\\"","\{","\}","\(","\)","\[","\]","\~","\*","?"特殊字符。 +>- 配置数据库节点名称时,请通过hostname命令获取数据库节点的主机名称,替换示例中的node1\_hostname,node2\_hostname。 + +**表 1** 参数说明 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

实例类型

+

参数

+

说明

+

整体信息

+

clusterName

+

openGauss名称。

+

nodeNames

+

openGauss中主机名称。

+

backIp1s

+

主机在后端存储网络中的IP地址(内网IP)。所有openGauss主机使用后端存储网络通讯。

+

gaussdbAppPath

+

openGauss程序安装目录。此目录应满足如下要求:

+
  • 磁盘空间>1GB
  • 与数据库所需其它路径相互独立,没有包含关系。
+

gaussdbLogPath

+

openGauss运行日志和操作日志存储目录。此目录应满足如下要求:

+
  • 磁盘空间建议根据主机上的数据库节点数规划。数据库节点预留1GB空间的基础上,再适当预留冗余空间。
  • openGauss所需其它路径相互独立,没有包含关系。
+

此路径可选。不指定的情况下,openGauss安装时会默认指定“$GAUSSLOG/安装用户名”作为日志目录。

+

tmpMppdbPath

+

数据库临时文件存放目录。

+

若不配置tmpMppdbPath,默认存放在/opt/huawei/wisequery/安装用户名_mppdb目录下,其中"opt/huawei/wisequery"是默认指定的数据库系统工具目录。

+

gaussdbToolPath

+

openGauss系统工具目录,主要用于存放互信工具等。此目录应满足如下要求:

+
  • 磁盘空间>100MB
  • 固定目录,与数据库所需其它目录相互独立,没有包含关系。
+

此目录可选。不指定的情况下,openGauss安装时会默认指定“/opt/huawei/wisequery”作为数据库系统工具目录。

+

corePath

+

openGauss core文件的指定目录。

+
+ +## 配置Host基本信息 + +>![](public_sys-resources/icon-note.gif) **说明:** +>每台Host服务器都必须有如下信息,如下示例以node1为例。 + +加粗字体内容为示例,可自行替换。每行信息均有注释进行说明。 + +``` + + + + + + + + + + + + +``` + +**表 1** 参数说明 + + + + + + + + + + + + + + + + + + + + + + + + +

实例类型

+

参数

+

说明

+

整体信息

+

name

+

主机名称。

+

azName

+

指定azName(Available Zone Name),字符串(不能含有特殊字符),例如AZ1、AZ2、AZ3。

+

azPriority

+

指定azPriority的优先级。

+

backIp1

+

主机在后端存储网络中的IP地址(内网IP)。所有openGauss主机使用后端存储网络通讯。

+

sshIp1

+

设置SSH可信通道IP地址(外网IP)。若无外网,则可以不设置该选项或者同backIp1设置相同IP。

+
+ +>![](public_sys-resources/icon-note.gif) **说明:** +>配置文件中所有IP参数(包含backIp、sshIp、listenIp等)均只支持配置一个IP。如果配置第二个IP参数,则不会读取第二个参数的配置值。 +>示例:xml配置文件中同时配置backIp1和backIp2参数: +>在解析配置文件时仅读取backIp1参数的配置值,不会读取backIp2参数的配置值。 +>``` +> +> +>``` + +## 配置数据库主节点信息 + +加粗字体内容为示例,可自行替换。每行信息均有注释进行说明。 + +**数据库主节点配置以下信息。** + +``` + + + + + + + + +``` + +**表 1** 参数说明 + + + + + + + + + + + + + + + + + + + + + +

实例类型

+

参数

+

说明

+

DBnode

+

dataNum

+

当前主机上需要部署的数据库节点个数。

+

dataPortBase

+

数据库节点的基础端口号,默认值40000。

+

dataNode1

+

用于指定当前主机上的数据库节点的数据存储目录。此目录为数据库的数据存储目录。应规划到数据盘上。

+

dataNode1_syncNum

+

可选参数,用于指定当前集群中同步模式的节点数目。取值范围为0~数据库备机节点数。

+
+ +## 示例 + +### 单节点配置文件 + +``` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +``` + +### 一主一备配置文件 + +``` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +``` + + \ No newline at end of file diff --git "a/content/zh/docs/installation/\345\210\235\345\247\213\345\214\226\345\256\211\350\243\205\347\216\257\345\242\203.md" "b/content/zh/docs/installation/\345\210\235\345\247\213\345\214\226\345\256\211\350\243\205\347\216\257\345\242\203.md" index 15b8e169ad148e77af3b018968de2b2d722aba67..6d49cb9622f7bcf62c0274967205044d225ceb1a 100644 --- "a/content/zh/docs/installation/\345\210\235\345\247\213\345\214\226\345\256\211\350\243\205\347\216\257\345\242\203.md" +++ "b/content/zh/docs/installation/\345\210\235\345\247\213\345\214\226\345\256\211\350\243\205\347\216\257\345\242\203.md" @@ -1,9 +1,1217 @@ -# 初始化安装环境 - -为了保证openGauss的正确安装,请首先对主机环境进行配置。 - -- **[准备安装用户及环境](准备安装用户及环境.md)** -创建完openGauss配置文件后,在执行安装前,为了后续能以最小权限进行安装及openGauss管理操作,保证系统安全性,需要运行安装前置脚本gs\_preinstall准备好安装用户及环境。 -- **[手工建立互信](手工建立互信.md)** -openGauss在安装过程中,需要在openGauss中的主机间执行命令,传送文件等操作。因此,在普通用户安装前需要确保互信是连通的。前置脚本中会先建立root用户间的互信,然后创建普通用户,并建立普通用户间的互信。 - +# 初始化安装环境 + +为了保证openGauss的正确安装,请首先对主机环境进行配置。 + + + +- [准备安装用户及环境](#准备安装用户及环境a-namezh-cn_topic_0249784578a) + - [前提条件](#前提条件a-namezh-cn_topic_0241805803_zh-cn_topic_0085434653_zh-cn_topic_0059781995_s3773af79eeb74c4bae1bd46533cc0cd8a) + - [注意事项](#注意事项a-namezh-cn_topic_0241805803_zh-cn_topic_0085434653_zh-cn_topic_0059781995_section20734484163420a) + - [操作步骤](#操作步骤a-namezh-cn_topic_0241805803_zh-cn_topic_0085434653_zh-cn_topic_0059781995_s407f29ab5691456590018c719cf81e9da) + - [示例](#示例a-namezh-cn_topic_0241805803_zh-cn_topic_0085434653_zh-cn_topic_0059781995_section412490911620a) + - [错误排查](#错误排查a-namezh-cn_topic_0241805803_zh-cn_topic_0085434653_zh-cn_topic_0059781995_s51853c2b09e54b12a90e4f8c512a61e4a) +- [手工建立互信](#手工建立互信a-namezh-cn_topic_0249784564a) + - [前提条件](#前提条件a-namezh-cn_topic_0241805804_zh-cn_topic_0085434625_zh-cn_topic_0059782039_s88bba380d9334b129eab3023c5399d45a) + - [使用脚本建立互信](#使用脚本建立互信a-namezh-cn_topic_0241805804_zh-cn_topic_0085434625_zh-cn_topic_0059782039_s8028dd8189914444b059c07d8c8c82dea) + - [手工建立互信](#手工建立互信a-namezh-cn_topic_0241805804_zh-cn_topic_0085434625_zh-cn_topic_0059782039_section63620881152125a) + - [删除root用户互信](#删除root用户互信a-namesection149417461942a) + - [示例](#示例a-namezh-cn_topic_0241805804_zh-cn_topic_0085434625_zh-cn_topic_0059782039_s9928a16b5b7347edbdb587133575483ea) +- [配置操作系统参数](#配置操作系统参数a-namezh-cn_topic_0249784554a) + - [操作系统参数](#操作系统参数a-namezh-cn_topic_0241805805_zh-cn_topic_0085434661_zh-cn_topic_0059782062_section3705271819540a) + - [文件系统参数](#文件系统参数a-namezh-cn_topic_0241805805_zh-cn_topic_0085434661_zh-cn_topic_0059782062_section4118580316369a) + - [transparent\_hugepage设置](#transparent\_hugepage设置a-namezh-cn_topic_0241805805_zh-cn_topic_0085434661_zh-cn_topic_0059782062_section38366550113020a) + - [文件句柄设置](#文件句柄设置a-namezh-cn_topic_0241805805_zh-cn_topic_0085434661_zh-cn_topic_0059782062_section49556455195442a) + - [系统支持的最大进程数设置](#系统支持的最大进程数设置a-namezh-cn_topic_0241805805_zh-cn_topic_0085434661_zh-cn_topic_0059782062_section65253147151525a) + - [网卡参数配置](#网卡参数配置a-namezh-cn_topic_0241805805_zh-cn_topic_0085434661_zh-cn_topic_0059782062_section6007556195457a) + + +## 准备安装用户及环境 + +创建完openGauss配置文件后,在执行安装前,为了后续能以最小权限进行安装及openGauss管理操作,保证系统安全性,需要运行安装前置脚本gs\_preinstall准备好安装用户及环境。 + +安装前置脚本gs\_preinstall可以协助用户自动完成如下的安装环境准备工作: + +- 自动设置Linux内核参数以达到提高服务器负载能力的目的。这些参数直接影响数据库系统的运行状态,请仅在确认必要时调整。openGauss所设置的Linux内核参数取值请参见[配置操作系统参数](配置操作系统参数.md)。 +- 自动将openGauss配置文件、安装包拷贝到openGauss主机的相同目录下。 +- openGauss安装用户、用户组不存在时,自动创建安装用户以及用户组。 +- 读取openGauss配置文件中的目录信息并创建,将目录权限授予安装用户。 + +### 前提条件 + +- 已完成[安装准备](安装准备.md)的所有任务。 + +### 注意事项 + +- 用户需要检查上层目录权限,保证安装用户对安装包和配置文件目录读写执行的权限。 +- xml文件中各主机的名称与IP映射配置正确。 +- 只能使用root用户执行gs\_preinstall命令。 + +### 操作步骤 + +1. 以root用户登录待安装openGauss的任意主机,并按规划创建存放安装包的目录。 + + ``` + mkdir -p /opt/software/openGauss + chmod 755 -R /opt/software + ``` + + >![](public_sys-resources/icon-note.gif) **说明:** + >- 不建议把安装包的存放目录规划到openGauss用户的家目录或其子目录下,可能导致权限问题。 + >- openGauss用户须具有/opt/software/openGauss目录的读写权限。 + +2. 将安装包“openGauss-x.x.x-openEULER-64bit.tar.gz”和配置文件“cluster\_config.xml”都上传至上一步所创建的目录中。 +3. 在安装包所在的目录下,解压安装包openGauss-x.x.x-openEULER-64bit.tar.gz。安装包解压后,会在/opt/software/openGauss路径下自动生成script子目录,并且在script目录下生成gs\_preinstall等各种OM工具脚本。 + + ``` + cd /opt/software/openGauss + tar -zxvf openGauss-x.x.x-openEULER-64bit.tar.gz + ``` + + >![](public_sys-resources/icon-note.gif) **说明:** + >- 在执行前置脚本gs\_preinstall时,需要规划好openGauss配置文件路径、安装包存放路径、程序安装目录、实例数据目录,后续普通用户使用过程中不能再更改这些路径。 + >- 运行前置脚本gs\_preinstall准备安装环境时,脚本内部会自动将openGauss配置文件、解压后的安装包同步拷贝到其余服务器的相同目录下。 + >- 在执行前置或者互信前,请检查/etc/profile文件中是否包含错误输出信息,如果存在错误输出,需手动处理。 + +4. 进入到工具脚本存放目录下。 + + ``` + cd /opt/software/openGauss/script + ``` + +5. 如果是openEuler的操作系统,执行如下命令打开performance.sh文件,用\#注释sysctl -w vm.min\_free\_kbytes=112640 &\> /dev/null,键入“ESC”键进入指令模式,执行**:wq**保存并退出修改。 + + ``` + vi /etc/profile.d/performance.sh + ``` + +6. 为确保openssl版本正确,执行预安装前请加载安装包中lib库。执行命令如下,其中_\{packagePath\}_为用户安装包放置的路径,本示例中为/opt/software/openGauss。 + + ``` + export LD_LIBRARY_PATH={packagePath}/script/gspylib/clib:$LD_LIBRARY_PATH + ``` + +7. 为确保成功安装,检查 hostname 与 /etc/hostname 是否一致。预安装过程中,会对hostname进行检查。 +8. 使用gs\_preinstall准备好安装环境。若为共用环境需加入--sep-env-file=ENVFILE参数分离环境变量,避免与其他用户相互影响,ENVFILE为用户自行指定的环境变量分离文件的路径。 + - 采用交互模式执行前置,并在执行过程中自动创建root用户互信和openGauss用户互信: + + ``` + ./gs_preinstall -U omm -G dbgrp -X /opt/software/openGauss/cluster_config.xml + ``` + + omm为数据库管理员(也是运行openGauss的操作系统用户),dbgrp为运行openGauss的操作系统用户的群组名称,/opt/software/openGauss/cluster\_config.xml为openGauss配置文件路径。在执行过程中,用户根据提示选择是否创建互信,并输入root用户或openGauss用户的密码。 + + - 不允许创建root用户互信时,创建omm用户,在各主机上执行本地模式前置,然后用户手动创建openGauss用户互信:如果预安装指定-L参数,预安装前需手动将所有节点的主机名和ip映射关系,写入各个主机的/etc/hosts,并在每个映射关系后边加入注释内容:\#Gauss OM IP Hosts Mapping。 + 1. 执行下面命令准备安装环境。 + + ``` + cd /opt/software/openGauss/script + ./gs_preinstall -U omm -G dbgrp -L -X /opt/software/openGauss/cluster_config.xml + ``` + + >![](public_sys-resources/icon-note.gif) **说明:** + >此操作需要在每台主机上执行该命令。 + + + - 采用非交互模式执行前置: + 1. 参考[手工建立互信](手工建立互信.md)章节手工建立root用户互信和openGauss用户互信。 + 2. 执行下面命令准备安装环境。 + + ``` + cd /opt/software/openGauss/script + ./gs_preinstall -U omm -G dbgrp -X /opt/software/openGauss/cluster_config.xml --non-interactive + ``` + + >![](public_sys-resources/icon-note.gif) **说明:** + >- 此模式要求用户确保在执行前,已经建立了各节点root用户互信和openGauss用户互信。 + >- root用户互信可能会存在安全隐患,因此建议用户在执行完安装后,立即删除各主机上root用户的互信。 + + + + +### 示例 + +执行前置脚本: + +``` +plat1:/opt/software/openGauss/script # ./gs_preinstall -U omm -G dbgrp -X /opt/software/openGauss/cluster_config.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 +Please enter password for root. +Password: +Creating SSH trust for the root permission user. +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. +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 the root permission user. +Setting pssh path +Successfully set core path. +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 +Please enter password for cluster user. +Password: +Please enter password for cluster user again. +Password: +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. +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. +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. +Setting SCTP service. +Successfully set SCTP service. +Set and check OS parameter. +Setting OS parameters. +Successfully set OS parameters. +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. +Set ARM Optimization. +No need to set ARM Optimization. +Fixing server package owner. +Setting finish flag. +Successfully set finish flag. +Preinstallation succeeded. +``` + +如果主备机的root用户密码不同,且不能统一修改为一致时,执行前置脚本本地安装模式: + +``` +plat1:/opt/software/openGauss/script # ./gs_preinstall -U omm -G dbgrp -L -X /opt/software/openGauss/cluster_config.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. +Checking OS version. +Successfully checked OS version. +Creating cluster's path. +Successfully created cluster's path. +Setting SCTP service. +Successfully set SCTP service. +Set and check OS parameter. +Setting OS parameters. +Successfully set OS parameters. +Warning: Installation environment contains some warning messages. +Please get more details by "/home/package/r8c00/script/gs_checkos -i A -h SIA1000068990". +Set and check OS parameter completed. +Preparing CRON service. +Successfully prepared CRON service. +Preparing SSH service. +Successfully prepared SSH service. +Setting user environmental variables. +Successfully set user environmental variables. +Configuring alarms on the cluster nodes. +Successfully configured alarms on the cluster nodes. +Setting the dynamic link library. +Successfully set the dynamic link library. +Setting Cgroup. +Successfully set Cgroup. +Setting finish flag. +Successfully set finish flag. +Preinstallation succeeded. +``` + +以非交互模式执行前置: + +``` +plat1:/opt/software/openGauss/script # ./gs_preinstall -U omm -G dbgrp -X /opt/software/openGauss/cluster_config.xml --non-interactive +Parsing the configuration file. +Successfully parsed the configuration file. +Installing the tools on the local node. +Successfully installed the tools on the local node. +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. +Installing the tools in the cluster. +Successfully installed the tools in the cluster. +Checking hostname mapping. +Successfully checked hostname mapping. +Checking OS version. +Successfully checked OS version. +Creating cluster's path. +Successfully created cluster's path. +Setting SCTP service. +Successfully set SCTP service. +Set and check OS parameter. +Setting OS parameters. +Successfully set OS parameters. +Set and check OS parameter completed. +Preparing CRON service. +Successfully prepared CRON service. +Preparing SSH service. +Successfully prepared SSH service. +Setting user environmental variables. +Successfully set user environmental variables. +Configuring alarms on the cluster nodes. +Successfully configured alarms on the cluster nodes. +Setting the dynamic link library. +Successfully set the dynamic link library. +Setting Cgroup. +Successfully set Cgroup. +Set ARM Optimization. +Successfully set ARM Optimization. +Setting finish flag. +Successfully set finish flag. +Preinstallation succeeded. +``` + +### 错误排查 + +如果准备安装环境失败请根据openGauss日志目录“$GAUSSLOG/om”下的“gs\_preinstall-YYYY-MM-DD\_HHMMSS.log”和“gs\_local-YYYY-MM-DD\_HHMMSS.log”中的日志信息排查错误。例如配置文件中“gaussdbLogPath”参数指定的路径为“/var/log/gaussdb”,则“$GAUSSLOG/om”路径为“/var/log/gaussdb/omm/om”,omm用户为运行openGauss的用户。 + +>![](public_sys-resources/icon-notice.gif) **须知:** +>准备安装用户及环境的过程中会使用root添加定时任务用于定时巡检和上报。 + +## 手工建立互信 + +openGauss在安装过程中,需要在openGauss中的主机间执行命令,传送文件等操作。因此,在普通用户安装前需要确保互信是连通的。前置脚本中会先建立root用户间的互信,然后创建普通用户,并建立普通用户间的互信。 + +>![](public_sys-resources/icon-notice.gif) **须知:** +>root用户互信可能会存在安全隐患,因此建议用户在使用完成后,立即删除各主机上root用户的互信。 + +### 前提条件 + +- 确保ssh服务打开。 +- 确保ssh端口不会被防火墙关闭。 +- 确保xml文件中各主机名称和IP配置正确。 +- 确保所有机器节点间网络畅通。 +- 如果为普通用户建立互信,需要提前在各主机创建相同用户并设置密码。 +- 如果各主机安装并启动了SELinux服务,需要确保/root和/home目录安全上下文为默认值(root目录:system\_u:object\_r:home\_root\_t:s0,home目录:system\_u:object\_r:admin\_home\_t:s0)或者关闭掉SELinux服务。 + + 检查系统SELinux状态的方法:执行命令getenforce,如果返回结果是Enforcing ,说明SELinux安装并启用。 + + 检查目录安全上下文的命令: + + ``` + ls -ldZ /root | awk '{print $4}' + ``` + + ``` + ls -ldZ /home | awk '{print $4}' + ``` + + 恢复目录安全上下文命令: + + ``` + restorecon -r -vv /home/ + ``` + + ``` + restorecon -r -vv /root/ + ``` + + +### 使用脚本建立互信 + +1. 创建一个执行互信脚本所需要的输入文本,并在此文件中添加openGauss中所有主机IP。 + + ``` + plat1:/opt/software/openGauss> vim hostfile + 192.168.0.1 + 192.168.0.2 + 192.168.0.3 + ``` + +2. 以需要创建互信的用户执行脚本。 +3. 执行下面脚本建立互信。 + + ``` + plat1:/opt/software/openGauss/script# ./gs_sshexkey -f /opt/software/hostfile + ``` + + /opt/software/hostfile为主机列表,列出所有需要建立互信机器的主机IP。 + + +### 手工建立互信 + +如果openGauss各主机的root密码不一致,gs\_preinstall脚本无法建立互信,可以手工建立互信。 + +>![](public_sys-resources/icon-note.gif) **说明:** +>建立互信的过程中需要生成如下4个文件:authorized\_keys、id\_rsa、id\_rsa.pub、known\_hosts。请勿删除或破坏这些互信相关的文件。 + +手工建立信任关系,步骤如下,plat1,plat2,plat3是主机名: + +1. 在其中一个主机上,生成root用户的本机授权文件。假设在主机plat1上执行。 + 1. 生成密钥。 + + ``` + ssh-keygen -t rsa + ``` + + 示例如下: + + ``` + plat1:~ # ssh-keygen -t rsa + Generating public/private rsa key pair. + Enter file in which to save the key (/root/.ssh/id_rsa): + Created directory '/root/.ssh'. + Enter passphrase (empty for no passphrase): + Enter same passphrase again: + Your identification has been saved in /root/.ssh/id_rsa. + Your public key has been saved in /root/.ssh/id_rsa.pub. + The key fingerprint is: + d5:35:46:33:27:22:09:f0:1e:12:a7:87:fa:33:3f:ab root@plat1 + The key's randomart image is: + +--[ RSA 2048]----+ + | o.o.....O .| + | * .o + * | + | + + . . | + | . + o | + | . S | + | . | + | + | + | +. | + | E.oo | + +-----------------+ + ``` + + 2. 生成本机授权文件。 + + ``` + cat .ssh/id_rsa.pub >> ~/.ssh/authorized_keys + ``` + + 示例如下: + + ``` + plat1:~ # cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys + ``` + +2. 收集所有的待建互信主机的公钥,写入到本机的known\_hosts文件中。此步骤需要在步骤1执行的主机上执行。需要收集plat1、plat2、plat3三个主机的公钥。 + 1. 收集plat1的公钥,写入到本机known\_hosts文件中。 + + ``` + ssh-keyscan -t rsa plat1 >> ~/.ssh/known_hosts + ``` + + 示例如下: + + ``` + plat1:~ # ssh-keyscan -t rsa plat1 >> ~/.ssh/known_hosts + # plat1 SSH-2.0-OpenSSH_5.1 + ``` + + 2. 收集plat2的公钥,写入到本机known\_hosts文件中。 + + ``` + ssh-keyscan -t rsa plat2 >> ~/.ssh/known_hosts + ``` + + 示例如下: + + ``` + plat1:~ # ssh-keyscan -t rsa plat2 >> ~/.ssh/known_hosts + # plat2 SSH-2.0-OpenSSH_5.1 + ``` + + 3. 收集plat3的公钥,写入到本机known\_hosts文件中。 + + ``` + ssh-keyscan -t rsa plat3 >> ~/.ssh/known_hosts + ``` + + 示例如下: + + ``` + plat1:~ # ssh-keyscan -t rsa plat3 >> ~/.ssh/known_hosts + # plat3 SSH-2.0-OpenSSH_5.1 + ``` + + >![](public_sys-resources/icon-note.gif) **说明:** + >- 当远程主机的公钥被接受以后,它就会被保存在文件$HOME/.ssh/known\_hosts之中。下次再连接这台主机,系统就会认出它的公钥已经保存在本地了,从而跳过警告部分。 + >- 如果该主机上known\_hosts文件被删除,互信仍然可以使用,但是会有告警提示信息。如果需要规避告警提示信息,请将/etc/ssh/ssh\_config配置文件中,StrictHostKeyChecking参数设置为no。 + + +3. 将互信文件分发到其它所有主机上。在本例中,需要将plat1上的互信文件分发到plat2和plat3上。 + + 1、将互信文件分发到plat2上。Password输入拷贝目标主机的密码。 + + ``` + scp -r ~/.ssh plat2:~ + ``` + + 示例如下: + + ``` + plat1:~ # scp -r ~/.ssh plat2:~ + Password: + authorized_keys 100% 796 0.8KB/s 00:00 + id_rsa 100% 1675 1.6KB/s 00:00 + id_rsa.pub 100% 398 0.4KB/s 00:00 + known_hosts 100% 1089 1.1KB/s 00:00 + ``` + + 2、将互信文件分发到plat3上。Password输入拷贝目标主机的密码。 + + ``` + scp -r ~/.ssh plat3:~ + ``` + + 示例如下: + + ``` + plat1:~ # scp -r ~/.ssh plat3:~ + Password: + authorized_keys 100% 796 0.8KB/s 00:00 + id_rsa 100% 1675 1.6KB/s 00:00 + id_rsa.pub 100% 398 0.4KB/s 00:00 + known_hosts 100% 1089 1.1KB/s 00:00 + ``` + +4. 查看互信是否建成功,可以互相ssh主机名。输入exit退出。 + + ``` + plat1:~ # ssh plat2 + Last login: Sat Jun 20 14:01:07 2020 + plat2:~ # exit + logout + Connection to plat2 closed. + plat1:~ # + ``` + + >![](public_sys-resources/icon-note.gif) **说明:** + >如果三个以上节点,和上述过程类似。假设节点名为plat1、plat2、plat3、......。第一步,需要在plat1上生成root用户的本机授权文件;第二步,需要收集所有待建互信主机\(plat1、plat2、plat3、......\)的公钥并写入到本机known\_hosts文件中;第三步,需要将互信文件分发到除本机外的所有其它主机\(plat2、plat3、......\)上;第四步,检查互信是否建立成功。 + + +### 删除root用户互信 + +为了避免Root用户互信可能存在的安全隐患,因此建议用户在使用完成后,立即删除各主机上root用户的互信。 + +1. 删除openGauss数据库各节点上的互信相关文件/root/.ssh。 + + rm –rf \~/.ssh + +2. 查看互信是否删除成功,可以互相ssh主机名,提示不能互信,互信删除成功。 + + plat1:\~ \# ssh plat2 + + he authenticity of host ' plssat2 \(plat2\)' can't be established. + + ECDSA key fingerprint is SHA256:Q4DPRedFytsjsJSKf4l2lHKuzVw4prq3bIUCNVKIa7M. + + ECDSA key fingerprint is MD5:e2:77:6c:aa:4c:43:5f:f2:c4:58:ec:d5:53:de:7c:fc. + + Are you sure you want to continue connecting \(yes/no\)? + + +### 示例 + +root用户建立互信示例: + +``` +plat1:~ # gs_sshexkey -f /opt/software/hostfile -W Gauss_123 +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. +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. +``` + +普通用户建立互信示例: + +``` +gaussdb@plat1:~ > gs_sshexkey -f /opt/software/hostfile -W Gauss_123 +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. +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. +``` + +安全模式下建立互信示例,需要用户根据提示,手动输入建立互信的用户密码(建议使用安全模式): + +``` +plat1:~ # gs_sshexkey -f /opt/software/hostfile +Please enter password for current user[root]. +Password: +Checking network information. +All nodes in the network are Normal. +Successfully checked network information. +Creating SSH trust. +Creating the local key file. +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. +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. +``` + +## 配置操作系统参数 + +openGauss要求各主机上的操作系统参数设置成一定的值,以满足系统运行的性能要求等。 + +这些参数有些会在openGauss安装环境准备阶段完成设置,且这些参数将直接影响openGauss的运行状态,请仅在确认必要时进行手动调整。方法如下: + +1. 以root用户身份登录服务器。 +2. 对文件“/etc/sysctl.conf”进行编辑修改。 + + 具体参数的修改请参见[操作系统参数](#zh-cn_topic_0241805805_zh-cn_topic_0085434661_zh-cn_topic_0059782062_section3705271819540)。 + +3. 执行如下命令使修改配置生效。 + + ``` + sysctl -p + ``` + + +### 操作系统参数 + +**表 1** 操作系统参数 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

参数名称

+

参数说明

+

预安装时是否由脚本自动设置

+

推荐取值

+

net.ipv4.tcp_max_tw_buckets

+

表示同时保持TIME_WAIT状态的TCP/IP连接最大数量。如果超过所配置的取值,TIME_WAIT将立刻被释放并打印警告信息。

+

+

10000

+

net.ipv4.tcp_tw_reuse

+

允许将TIME-WAIT状态的sockets重新用于新的TCP连接。

+
  • 0表示关闭。
  • 1表示开启。
+

+

1

+

net.ipv4.tcp_tw_recycle

+

表示开启TCP连接中TIME-WAIT状态sockets的快速回收。

+
  • 0表示关闭。
  • 1表示开启。
+

+

1

+

net.ipv4.tcp_keepalive_time

+

表示当keepalive启用的时候,TCP发送keepalive消息的频度。

+

+

30

+

net.ipv4.tcp_keepalive_probes

+

在认定连接失效之前,发送TCP的keepalive探测包数量。这个值乘以tcp_keepalive_intvl之后决定了一个连接发送了keepalive之后可以有多少时间没有回应。

+

+

9

+

net.ipv4.tcp_keepalive_intvl

+

当探测没有确认时,重新发送探测的频度。

+

+

30

+

net.ipv4.tcp_retries1

+

在连接建立过程中TCP协议最大重试次数。

+

+

5

+

net.ipv4.tcp_syn_retries

+

TCP协议SYN报文最大重试次数。

+

+

5

+

net.ipv4.tcp_synack_retries

+

TCP协议SYN应答报文最大重试次数。

+

+

5

+

net.sctp.path_max_retrans

+

SCTP协议最大重试次数。

+

+

10

+

net.sctp.max_init_retransmits

+

SCTP协议INIT报文最大重试次数。

+

+

10

+

net.sctp.association_max_retrans

+

SCTP协议单个逻辑连接最大重试次数。

+

+

10

+

net.sctp.hb_interval

+

SCTP协议心跳检测包重传间隔。

+

+

30000

+

net.ipv4.tcp_retries2

+

控制内核向已经建立连接的远程主机重新发送数据的次数,低值可以更早的检测到与远程主机失效的连接,因此服务器可以更快的释放该连接。

+

发生“connection reset by peer”时可以尝试调大该值规避问题。

+

+

12

+

vm.overcommit_memory

+

控制在做内存分配的时候,内核的检查方式。

+
  • 0:表示系统会尽量精确计算当前可用的内存。
  • 1:表示不作检查直接返回成功。
  • 2:内存总量×vm.overcommit_ratio/100+SWAP的总量,如果申请空间超过此数值则返回失败。
+

内核默认是2过于保守,推荐设置为0,如果系统压力大可以设置为1。

+

+

0

+

net.sctp.sndbuf_policy

+

SCTP发送缓冲区分配原则。

+
  • 0为按连接。
  • 1为按耦联。
+

+

0

+

net.sctp.rcvbuf_policy

+

SCTP接收缓冲区分配原则。

+
  • 0为按连接。
  • 1为按耦联。
+

+

0

+

net.sctp.sctp_mem

+

内核SCTP协议栈的最大可用内存,分无压力,有压力,和压力大三个区间,压力大时会丢包,单位为页面。

+

+

94500000 915000000 927000000

+

net.sctp.sctp_rmem

+

内核SCTP协议栈的接收总可用内存,分无压力,有压力和压力大三个区间,压力大时会丢包,单位为页面。

+

+

8192 250000 16777216

+

net.sctp.sctp_wmem

+

内核SCTP协议栈的发送总可用内存,分无压力,有压力和压力大三个区间,压力大时会丢包,单位为页面。

+

+

8192 250000 16777216

+

net.ipv4.tcp_rmem

+

TCP协议接收端缓冲区的可用内存大小。分无压力,有压力,和压力大三个区间,单位为页面。

+

+

8192 250000 16777216

+

net.ipv4.tcp_wmem

+

TCP协议发送端缓冲区的可用内存大小。分无压力,有压力,和压力大三个区间,单位为页面。

+

+

8192 250000 16777216

+

net.core.wmem_max

+

socket发送端缓冲区大小的最大值。

+

+

21299200

+

net.core.rmem_max

+

socket接收端缓冲区大小的最大值。

+

+

21299200

+

net.core.wmem_default

+

socket发送端缓冲区大小的默认值。

+

+

21299200

+

net.core.rmem_default

+

socket接收端缓冲区大小的默认值。

+

+

21299200

+

net.ipv4.ip_local_port_range

+

物理机可用临时端口范围。

+

+

26000-65535

+

kernel.sem

+

内核信号量参数设置大小。

+

+

250 6400000 1000 25600

+

vm.min_free_kbytes

+

保证物理内存有足够空闲空间,防止突发性换页。

+

+

系统总内存的5%

+

net.core.somaxconn

+

定义了系统中每一个端口最大的监听队列的长度,这是个全局的参数。

+

+

65535

+

net.ipv4.tcp_syncookies

+

当出现SYN等待队列溢出时,启用cookies来处理,可防范少量SYN攻击。

+
  • 0表示关闭SYN Cookies。
  • 1表示开启SYN Cookies。
+

+

1

+

net.sctp.addip_enable

+

SCTP动态地址重置支持开关

+
  • 0表示关闭。
  • 1表示开启。
+

+

0

+

net.core.netdev_max_backlog

+

在每个网络接口接收数据包的速率比内核处理这些包的速率快时,允许送到队列的数据包的最大数目。

+

+

65535

+

net.ipv4.tcp_max_syn_backlog

+

记录的那些尚未收到客户端确认信息的连接请求的最大值。

+

+

65535

+

net.ipv4.tcp_fin_timeout

+

系统默认的超时时间。

+

+

60

+

kernel.shmall

+

内核可用的共享内存总量。

+

+

1152921504606846720

+

kernel.shmmax

+

内核参数定义单个共享内存段的最大值。

+

+

18446744073709551615

+

net.ipv4.tcp_sack

+

启用有选择的应答,通过有选择地应答乱序接受到的报文来提高性能,让发送者只发送丢失的报文段(对于广域网来说)这个选项应该启用,但是会增加对CPU的占用。

+
  • 0表示关闭。
  • 1表示开启
+

+

1

+

net.ipv4.tcp_timestamps

+

TCP时间戳(会在TCP包头增加12节),以一种比重发超时更精确的方式(参考RFC 1323)来启用对RTT的计算,启用可以实现更好的性能。

+
  • 0表示关闭。
  • 1表示开启
+

+

1

+

vm.extfrag_threshold

+

系统内存不够用时,linux会为当前系统内存碎片情况打分,如果超过vm.extfrag_threshold的值,kswapd就会触发memory compaction。所以这个值设置的接近1000,说明系统在内存碎片的处理倾向于把旧的页换出,以符合申请的需要,而设置接近0,表示系统在内存碎片的处理倾向做memory compaction。

+

+

500

+

vm.overcommit_ratio

+

系统使用绝不过量使用内存的算法时,系统整个内存地址空间不得超过swap+RAM值的此参数百分比,当vm.overcommit_memory=2时此参数生效。

+

+

90

+

/sys/module/sctp/parameters/no_checksums

+

SCTP协议是否关闭checksum。

+

+

0

+

MTU

+

节点网卡最大传输单元。OS默认值为1500,调整为8192可以提升SCTP协议数据收发的性能。

+

+

8192

+
+ +### 文件系统参数 + +- soft nofile + + 说明:soft nofile表示软限制,用户使用的文件句柄数量可以超过该限制,但是如果超过会有告警信息。 + + 推荐取值:1000000 + +- hard nofile + + 说明:hard nofile表示硬限制,是一个严格的限制,用户使用的文件句柄数量一定不能超过该设置。 + + 推荐取值:1000000 + +- stack size + + 说明:线程堆栈大小。 + + 推荐值:3072 + + +### transparent\_hugepage设置 + +openGauss默认关闭使用transparent\_hugepage服务,并将关闭命令写入操作系统启动文件。 + +### 文件句柄设置 + +需要对文件句柄数进行手动设置时,使用root用户执行如下命令进行参数修改: + +``` +echo "* soft nofile 1000000" >>/etc/security/limits.conf +echo "* hard nofile 1000000" >>/etc/security/limits.conf +``` + +完成修改后,需重启操作系统使得设置的参数生效。 + +**表 2** 文件句柄数设置 + + + + + + + + + + + + + + + + + + + +

参数名

+

说明

+

预安装时是否由脚本自动设置

+

推荐取值

+

* soft nofile

+

soft nofile表示软限制,即表示任何用户能打开的最大文件数量为1000000,不管它开启多少个shell。

+

+

1000000

+

* hard nofile

+

hard nofile表示硬限制,软限制要小于等于硬限制。

+

+

1000000

+
+ +### 系统支持的最大进程数设置 + +需要对系统支持的最大进程数进行手动设置时,执行如下命令打开conf文件。 + +``` +vim /etc/security/limits.d/90-nproc.conf +``` + +修改\* soft nproc参数。 + +完成修改后,需重启操作系统使得设置的参数生效。 + +**表 3** 系统支持的最大进程数设置 + + + + + + + + + + + + + + +

参数名

+

说明

+

预安装时是否由脚本自动设置

+

推荐取值

+

* soft nproc

+

soft nproc参数用来限制每个用户的最大processes数量。

+

+

unlimited

+
+ +### 网卡参数配置 + +**表 4** 网卡参数配置 + + + + + + + + + + + + + + + + + + + +

参数名

+

说明

+

预安装时是否由脚本自动设置

+

推荐取值

+

rx

+

网卡接收队列长度设置

+

+

4096

+

tx

+

网卡传送队列长度设置

+

+

4096

+
+ +>![](public_sys-resources/icon-notice.gif) **须知:** +>- 网卡参数配置功能只针对万兆及万兆以上级别的业务网卡。即backIp1所绑定的网卡。 +>- 设置网卡参数的命令只有在设置成功后,才会被写入系统启动文件。执行失败的信息会被记入后台日志中。 + + \ No newline at end of file diff --git "a/content/zh/docs/installation/\345\210\235\345\247\213\345\214\226\346\225\260\346\215\256\345\272\223.md" "b/content/zh/docs/installation/\345\210\235\345\247\213\345\214\226\346\225\260\346\215\256\345\272\223.md" new file mode 100644 index 0000000000000000000000000000000000000000..f47b2ecbcedfae5bba4eb6175266a4ffd46b60b1 --- /dev/null +++ "b/content/zh/docs/installation/\345\210\235\345\247\213\345\214\226\346\225\260\346\215\256\345\272\223.md" @@ -0,0 +1,20 @@ +# 初始化数据库 + +使用SQL创建新的数据库 + +使用SQL语句创建数据库时,指定数据库的字符集为GBK。 + +``` +gsql -d postgres -p 26000 +``` + +``` +postgres=# CREATE DATABASE mydb WITH ENCODING 'GBK' template = template0; +``` + +显示类似如下信息: + +``` +CREATE DATABASE +``` + diff --git "a/content/zh/docs/installation/\345\210\235\345\247\213\351\205\215\347\275\256.md" "b/content/zh/docs/installation/\345\210\235\345\247\213\351\205\215\347\275\256.md" deleted file mode 100644 index 5345de777efe8a2b887680c8c5fc05f0ea0b99be..0000000000000000000000000000000000000000 --- "a/content/zh/docs/installation/\345\210\235\345\247\213\351\205\215\347\275\256.md" +++ /dev/null @@ -1,7 +0,0 @@ -# 初始配置 - -安装完成后,可以对GUC参数、区域和字符集等进行配置,保证openGauss的平稳运行。 - -- **[配置区域和字符集](配置区域和字符集.md)** -区域和字符集在安装过程中通过指定初始化GUC参数来控制,考虑到这两个参数的重要性,在此单独对这两个参数进行详细说明。 - diff --git "a/content/zh/docs/installation/\345\215\225\350\212\202\347\202\271\351\205\215\347\275\256\346\226\207\344\273\266.md" "b/content/zh/docs/installation/\345\215\225\350\212\202\347\202\271\351\205\215\347\275\256\346\226\207\344\273\266.md" deleted file mode 100644 index 1f2ef0e7f8b727e9d82daa90d57bee680bf0d134..0000000000000000000000000000000000000000 --- "a/content/zh/docs/installation/\345\215\225\350\212\202\347\202\271\351\205\215\347\275\256\346\226\207\344\273\266.md" +++ /dev/null @@ -1,38 +0,0 @@ -# 单节点配置文件 - -``` - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -``` - diff --git "a/content/zh/docs/installation/\345\215\270\350\275\275openGauss.md" "b/content/zh/docs/installation/\345\215\270\350\275\275openGauss.md" index 17b190055d130519c1baa3dde657684089cb4031..286f09988c8f69e46be5aa1768cf833a19d6b3ff 100644 --- "a/content/zh/docs/installation/\345\215\270\350\275\275openGauss.md" +++ "b/content/zh/docs/installation/\345\215\270\350\275\275openGauss.md" @@ -1,9 +1,150 @@ -# 卸载openGauss - -卸载openGauss的过程包含卸载openGauss和对openGauss服务器的环境做清理。 - -- **[执行卸载](执行卸载.md)** -openGauss提供了卸载脚本帮助用户完整的卸载openGauss。 -- **[一键式环境清理](一键式环境清理.md)** -在openGauss卸载完成后,如果不需要在环境上重新部署openGauss,可以运行脚本gs\_postuninstall对openGauss服务器上环境信息做清理。openGauss环境清理是对环境准备脚本gs\_preinstall所做设置的清理。 - +# 卸载openGauss + +卸载openGauss的过程包含卸载openGauss和对openGauss服务器的环境做清理。 + +## 执行卸载 + +openGauss提供了卸载脚本帮助用户完整的卸载openGauss。 + +**操作步骤** + +1. 以操作系统用户omm登录数据库主节点。 +2. 使用gs\_uninstall卸载openGauss。 + + ``` + gs_uninstall --delete-data + ``` + + 或者在openGauss中每个节点执行本地卸载。 + + ``` + gs_uninstall --delete-data -L + ``` + + +**示例** + +使用gs\_uninstall脚本进行卸载openGauss。 + +``` +gs_uninstall --delete-data +Checking uninstallation. +Successfully checked uninstallation. +Stopping the cluster. +Successfully stopped the cluster. +Successfully deleted instances. +Uninstalling application. +Successfully uninstalled application. +Uninstallation succeeded. +``` + +单机卸载场景使用gs\_uninstall脚本进行卸载。 + +``` +gs_uninstall --delete-data +Checking uninstallation. +Successfully checked uninstallation. +Stopping the cluster. +Successfully stopped the cluster. +Successfully deleted instances. +Uninstalling application. +Successfully uninstalled application. +Uninstallation succeeded. +``` + +**错误排查** + +如果卸载失败请根据“$GAUSSLOG/om/gs\_uninstall-YYYY-MM-DD\_HHMMSS.log”中的日志信息排查错误。 + +## 一键式环境清理 + +在openGauss卸载完成后,如果不需要在环境上重新部署openGauss,可以运行脚本gs\_postuninstall对openGauss服务器上环境信息做清理。openGauss环境清理是对环境准备脚本gs\_preinstall所做设置的清理。 + +**前提条件** + +- openGauss卸载执行成功。 +- root用户互信可用。 +- 只能使用root用户执行gs\_postuninstall命令。 + +**操作步骤** + +1. 以root用户登录openGauss服务器。 +2. 查看root用户互信是否建立,如果root用户没有建立互信,需要手工建立root用户互信,操作参考3.2.2手工建立互信。 + + 查看互信是否建成功,可以互相ssh主机名。输入exit退出。 + + ``` + plat1:~ # ssh plat2 + Last login: Tue Jan 5 10:28:18 2016 from plat1 + Huawei's internal systems must only be used for conducting Huawei's business or for purposes authorized by Huawei management.Use is subject to audit at any time by Huawei management. + plat2:~ # exit + logout + Connection to plat2 closed. + plat1:~ # + ``` + +3. 进入script路径下 + + ``` + cd /opt/software/openGauss/script + ``` + +4. 使用gs\_postuninstall进行清理。若为环境变量分离的模式安装的集群需要source环境变量分离文件ENVFILE。 + + ``` + ./gs_postuninstall -U omm -X /opt/software/openGauss/cluster_config.xml --delete-user --delete-group + ``` + + 或者在openGauss中每个节点执行本地后置清理。 + + ``` + ./gs_postuninstall -U omm -X /opt/software/openGauss/cluster_config.xml --delete-user --delete-group -L + ``` + + omm为运行openGauss的操作系统用户名,/opt/software/openGauss/cluster\_config.xml为openGauss配置文件路径。 + + 若为环境变量分离的模式安装的集群需删除之前source的环境变量分离的env参数 + + unset MPPDB\_ENV\_SEPARATE\_PATH + +5. 删除openGauss数据库各节点root用户的互信,操作参考3.2.2手工建立互信的删除root用户互信部分内容。 + +**示例** + +清理主机的环境 + +``` +gs_postuninstall -U omm -X /opt/software/openGauss/cluster_config.xml --delete-user +Parsing the configuration file. +Successfully parsed the configuration file. +Check log file path. +Successfully checked log file path. +Checking unpreinstallation. +Successfully checked unpreinstallation. +Deleting Cgroup. +Successfully deleted Cgroup. +Deleting the instance's directory. +Successfully deleted the instance's directory. +Deleting the installation directory. +Successfully deleted the installation directory. +Deleting the temporary directory. +Successfully deleted the temporary directory. +Deleting remote OS user. +Successfully deleted remote OS user. +Deleting software packages and environmental variables of other nodes. +Successfully deleted software packages and environmental variables of other nodes. +Deleting logs of other nodes. +Successfully deleted logs of other nodes. +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. +``` + +**错误排查** + +如果一键式环境清理失败请根据“$GAUSSLOG/om/gs\_postuninstall-YYYY-MM-DD\_HHMMSS.log”中的日志信息排查错误。 + diff --git "a/content/zh/docs/installation/\345\256\211\350\243\205openGauss.md" "b/content/zh/docs/installation/\345\256\211\350\243\205openGauss.md" index c2e351e75728f530b95618e25fb416929c46dd11..9bb1342b417410597e651dff8d2cc0f27a54372b 100644 --- "a/content/zh/docs/installation/\345\256\211\350\243\205openGauss.md" +++ "b/content/zh/docs/installation/\345\256\211\350\243\205openGauss.md" @@ -1,11 +1,13 @@ -# 安装openGauss - -- **[创建XML配置文件](创建XML配置文件.md)** -安装openGauss前需要创建cluster\_config.xml文件。cluster\_config.xml文件包含部署openGauss的服务器信息、安装路径、IP地址以及端口号等。用于告知openGauss如何部署。用户需根据不同场配置对应的XML文件。 -- **[初始化安装环境](初始化安装环境.md)** -为了保证openGauss的正确安装,请首先对主机环境进行配置。 -- **[执行安装](执行安装.md)** -执行前置脚本准备好openGauss安装环境之后,按照启动安装过程部署openGauss。 -- **[(可选)设置备机可读]((可选)设置备机可读.md)** -备机可读特性为可选特性,需要修改配置参数并重启主备机器后才能使用。在开启备机可读之后,备机将支持读操作,并满足数据一致性要求。 - +# 安装openGauss + +- **[创建XML配置文件](创建XML配置文件.md)** +安装openGauss前需要创建cluster\_config.xml文件。cluster\_config.xml文件包含部署openGauss的服务器信息、安装路径、IP地址以及端口号等。用于告知openGauss如何部署。用户需根据不同场配置对应的XML文件。 +- **[初始化安装环境](初始化安装环境.md)** +为了保证openGauss的正确安装,请首先对主机环境进行配置。 +- **[执行安装](执行安装.md)** +执行前置脚本准备好openGauss安装环境之后,按照启动安装过程部署openGauss。 +- **[初始化数据库](初始化数据库.md)** + +- **[(可选)设置备机可读]((可选)设置备机可读.md)** +备机可读特性为可选特性,需要修改配置参数并重启主备机器后才能使用。在开启备机可读之后,备机将支持读操作,并满足数据一致性要求。 + diff --git "a/content/zh/docs/installation/\345\256\211\350\243\205\345\207\206\345\244\207.md" "b/content/zh/docs/installation/\345\256\211\350\243\205\345\207\206\345\244\207.md" index 889d96fa5b5ceafc5dcb9b0e6a4e4a472c502422..13649d972152fa6a7749c1fcf5c49884a6aca13a 100644 --- "a/content/zh/docs/installation/\345\256\211\350\243\205\345\207\206\345\244\207.md" +++ "b/content/zh/docs/installation/\345\256\211\350\243\205\345\207\206\345\244\207.md" @@ -1,13 +1,13 @@ -# 安装准备 - -本章详细介绍了安装openGauss的环境准备和配置,请在安装之前仔细阅读本章的内容。如果已完成本章节的配置,请进入“安装openGauss”章节。 - -- **[了解安装流程](了解安装流程.md)** -本章节通过流程图简要介绍openGauss的安装流程。 -- **[获取安装包](获取安装包.md)** -openGauss开源社区上提供了安装包的获取方式。 -- **[准备软硬件安装环境](准备软硬件安装环境.md)** -本章节描述安装前需要进行的环境准备。 -- **[了解安装用户及用户组](了解安装用户及用户组.md)** -为了实现安装过程中安装帐户权限最小化,及安装后openGauss的系统运行安全性。安装脚本在安装过程中会自动按照用户指定创建安装用户,并将此用户作为后续运行和维护openGauss的管理员帐户。 - +# 安装准备 + +本章详细介绍了安装openGauss的环境准备和配置,请在安装之前仔细阅读本章的内容。如果已完成本章节的配置,请进入“安装openGauss”章节。 + +- **[了解安装流程](了解安装流程.md)** +本章节通过流程图简要介绍openGauss的安装流程。 +- **[获取安装包](获取安装包.md)** +openGauss开源社区上提供了安装包的获取方式。 +- **[准备软硬件安装环境](准备软硬件安装环境.md)** +本章节描述安装前需要进行的环境准备。 +- **[了解安装用户及用户组](了解安装用户及用户组.md)** +为了实现安装过程中安装帐户权限最小化,及安装后openGauss的系统运行安全性。安装脚本在安装过程中会自动按照用户指定创建安装用户,并将此用户作为后续运行和维护openGauss的管理员帐户。 + diff --git "a/content/zh/docs/installation/\345\256\211\350\243\205\346\246\202\350\277\260.md" "b/content/zh/docs/installation/\345\256\211\350\243\205\346\246\202\350\277\260.md" index 99f9277908319d7b4fa6fb9c6e58f189587d1c8c..fdc528ffffb409a0d027c1f548eb5f2db0cd111f 100644 --- "a/content/zh/docs/installation/\345\256\211\350\243\205\346\246\202\350\277\260.md" +++ "b/content/zh/docs/installation/\345\256\211\350\243\205\346\246\202\350\277\260.md" @@ -1,9 +1,9 @@ -# 安装概述 - -openGauss支持单机部署和单机HA部署两种部署方式。单机部署时,可在一个主机部署多个数据库实例,但为了数据安全,不建议用户这样部署。单机HA部署支持一台主机和最少一台备机,备机一共最多4台的配置方式。 - -单机部署和单机HA部署均支持精简模式和兼容模式。精简模式下,您可以安装openGauss数据库并正常使用;兼容模式是在精简模式的基础上做了兼容增强,安装兼容包后会兼容主流数据库的接口名称,便于习惯主流数据库的用户使用openGauss。 - ->![](public_sys-resources/icon-note.gif) **说明:** ->通过openGauss提供的脚本安装时,只允许在单台物理机只部署一个数据库系统。如果您需要在单台物理机部署多个数据库系统,建议您通过命令行安装,不需要通过openGauss提供安装脚本执行安装。 - +# 安装概述 + +openGauss支持单机部署和单机HA部署两种部署方式。单机部署时,可在一个主机部署多个数据库实例,但为了数据安全,不建议用户这样部署。单机HA部署支持一台主机和最少一台备机,备机一共最多4台的配置方式。 + +单机部署和单机HA部署均支持精简模式和兼容模式。精简模式下,您可以安装openGauss数据库并正常使用;兼容模式是在精简模式的基础上做了兼容增强,安装兼容包后会兼容主流数据库的接口名称,便于习惯主流数据库的用户使用openGauss。 + +>![](public_sys-resources/icon-note.gif) **说明:** +>通过openGauss提供的脚本安装时,只允许在单台物理机只部署一个数据库系统。如果您需要在单台物理机部署多个数据库系统,建议您通过命令行安装,不需要通过openGauss提供安装脚本执行安装。 + diff --git "a/content/zh/docs/installation/\345\256\211\350\243\205\351\252\214\350\257\201.md" "b/content/zh/docs/installation/\345\256\211\350\243\205\351\252\214\350\257\201.md" index 5a1f012701919d60d5db3952ef842f69420843fb..03b1e6b3bbedab34443b0ba8bbda372d264cee14 100644 --- "a/content/zh/docs/installation/\345\256\211\350\243\205\351\252\214\350\257\201.md" +++ "b/content/zh/docs/installation/\345\256\211\350\243\205\351\252\214\350\257\201.md" @@ -1,5 +1,61 @@ -# 安装验证 - -- **[检查健康状态](检查健康状态.md)** - - +# 安装验证 + +通过openGauss提供的gs\_checkos工具可以完成操作系统状态检查。 + +## 前提条件 + +- 当前的硬件和网络环境正常。 +- 各主机间root互信状态正常。 +- 只能使用root用户执行gs\_checkos命令。 + +## 操作步骤 + +1. 以root用户身份登录服务器。 +2. 执行如下命令对openGauss节点服务器的OS参数进行检查。 + + ``` + gs_checkos -i A + ``` + + 检查节点服务器的OS参数的目的是为了保证openGauss正常通过预安装,并且在安装成功后可以安全高效的运行。详细的检查项目请参见《工具参考》gs\_checkos工具的表 1 操作系统检查项,操作系统参数和文件系统参数。 + + +## 示例 + +执行gs\_checkos前需要先执行前置脚本,准备环境。以参数"A"为例。 + +``` +gs_checkos -i A +Checking items: + A1. [ OS version status ] : Normal + A2. [ Kernel version status ] : Normal + A3. [ Unicode status ] : Normal + A4. [ Time zone status ] : Normal + A5. [ Swap memory status ] : Normal + A6. [ System control parameters status ] : Normal + A7. [ File system configuration status ] : Normal + A8. [ Disk configuration status ] : Normal + A9. [ Pre-read block size status ] : Normal + A10.[ IO scheduler status ] : Normal + A11.[ Network card configuration status ] : Normal + A12.[ Time consistency status ] : Warning + A13.[ Firewall service status ] : Normal + A14.[ THP service status ] : Normal +Total numbers:14. Abnormal numbers:0. Warning number:1. +``` + +以参数"B"为例。 + +``` +gs_checkos -i B +Setting items: + B1. [ Set system control parameters ] : Normal + B2. [ Set file system configuration value ] : Normal + B3. [ Set pre-read block size value ] : Normal + B4. [ Set IO scheduler value ] : Normal + B5. [ Set network card configuration value ] : Normal + B6. [ Set THP service ] : Normal + B7. [ Set RemoveIPC value ] : Normal +Total numbers:6. Abnormal numbers:0. Warning number:0. +``` + diff --git "a/content/zh/docs/installation/\346\211\213\345\267\245\345\273\272\347\253\213\344\272\222\344\277\241.md" "b/content/zh/docs/installation/\346\211\213\345\267\245\345\273\272\347\253\213\344\272\222\344\277\241.md" deleted file mode 100644 index ec0743be6529d00a676a9396490b7556c9753efe..0000000000000000000000000000000000000000 --- "a/content/zh/docs/installation/\346\211\213\345\267\245\345\273\272\347\253\213\344\272\222\344\277\241.md" +++ /dev/null @@ -1,310 +0,0 @@ -# 手工建立互信 - -openGauss在安装过程中,需要在openGauss中的主机间执行命令,传送文件等操作。因此,在普通用户安装前需要确保互信是连通的。前置脚本中会先建立root用户间的互信,然后创建普通用户,并建立普通用户间的互信。 - ->![](public_sys-resources/icon-notice.gif) **须知:** ->root用户互信可能会存在安全隐患,因此建议用户在使用完成后,立即删除各主机上root用户的互信。 - -## 前提条件 - -- 确保ssh服务打开。 -- 确保ssh端口不会被防火墙关闭。 -- 确保xml文件中各主机名称和IP配置正确。 -- 确保所有机器节点间网络畅通。 -- 如果为普通用户建立互信,需要提前在各主机创建相同用户并设置密码。 -- 如果各主机安装并启动了SELinux服务,需要确保/root和/home目录安全上下文为默认值(root目录:system\_u:object\_r:home\_root\_t:s0,home目录:system\_u:object\_r:admin\_home\_t:s0)或者关闭掉SELinux服务。 - - 检查系统SELinux状态的方法:执行命令getenforce,如果返回结果是Enforcing ,说明SELinux安装并启用。 - - 检查目录安全上下文的命令: - - ``` - ls -ldZ /root | awk '{print $4}' - ``` - - ``` - ls -ldZ /home | awk '{print $4}' - ``` - - 恢复目录安全上下文命令: - - ``` - restorecon -r -vv /home/ - ``` - - ``` - restorecon -r -vv /root/ - ``` - - -## 使用脚本建立互信 - -1. 创建一个执行互信脚本所需要的输入文本,并在此文件中添加openGauss中所有主机IP。 - - ``` - plat1:/opt/software/openGauss> vim hostfile - 192.168.0.1 - 192.168.0.2 - 192.168.0.3 - ``` - -2. 以需要创建互信的用户执行脚本。 -3. 执行下面脚本建立互信。 - - ``` - plat1:/opt/software/openGauss/script# ./gs_sshexkey -f /opt/software/hostfile - ``` - - /opt/software/hostfile为主机列表,列出所有需要建立互信机器的主机IP。 - - -## 手工建立互信 - -如果openGauss各主机的root密码不一致,gs\_preinstall脚本无法建立互信,可以手工建立互信。 - ->![](public_sys-resources/icon-note.gif) **说明:** ->建立互信的过程中需要生成如下4个文件:authorized\_keys、id\_rsa、id\_rsa.pub、known\_hosts。请勿删除或破坏这些互信相关的文件。 - -手工建立信任关系,步骤如下,plat1,plat2,plat3是主机名: - -1. 在其中一个主机上,生成root用户的本机授权文件。假设在主机plat1上执行。 - 1. 生成密钥。 - - ``` - ssh-keygen -t rsa - ``` - - 示例如下: - - ``` - plat1:~ # ssh-keygen -t rsa - Generating public/private rsa key pair. - Enter file in which to save the key (/root/.ssh/id_rsa): - Created directory '/root/.ssh'. - Enter passphrase (empty for no passphrase): - Enter same passphrase again: - Your identification has been saved in /root/.ssh/id_rsa. - Your public key has been saved in /root/.ssh/id_rsa.pub. - The key fingerprint is: - d5:35:46:33:27:22:09:f0:1e:12:a7:87:fa:33:3f:ab root@plat1 - The key's randomart image is: - +--[ RSA 2048]----+ - | o.o.....O .| - | * .o + * | - | + + . . | - | . + o | - | . S | - | . | - | + | - | +. | - | E.oo | - +-----------------+ - ``` - - 2. 生成本机授权文件。 - - ``` - cat .ssh/id_rsa.pub >> ~/.ssh/authorized_keys - ``` - - 示例如下: - - ``` - plat1:~ # cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys - ``` - -2. 收集所有的待建互信主机的公钥,写入到本机的known\_hosts文件中。此步骤需要在步骤1执行的主机上执行。需要收集plat1、plat2、plat3三个主机的公钥。 - 1. 收集plat1的公钥,写入到本机known\_hosts文件中。 - - ``` - ssh-keyscan -t rsa plat1 >> ~/.ssh/known_hosts - ``` - - 示例如下: - - ``` - plat1:~ # ssh-keyscan -t rsa plat1 >> ~/.ssh/known_hosts - # plat1 SSH-2.0-OpenSSH_5.1 - ``` - - 2. 收集plat2的公钥,写入到本机known\_hosts文件中。 - - ``` - ssh-keyscan -t rsa plat2 >> ~/.ssh/known_hosts - ``` - - 示例如下: - - ``` - plat1:~ # ssh-keyscan -t rsa plat2 >> ~/.ssh/known_hosts - # plat2 SSH-2.0-OpenSSH_5.1 - ``` - - 3. 收集plat3的公钥,写入到本机known\_hosts文件中。 - - ``` - ssh-keyscan -t rsa plat3 >> ~/.ssh/known_hosts - ``` - - 示例如下: - - ``` - plat1:~ # ssh-keyscan -t rsa plat3 >> ~/.ssh/known_hosts - # plat3 SSH-2.0-OpenSSH_5.1 - ``` - - >![](public_sys-resources/icon-note.gif) **说明:** - >- 当远程主机的公钥被接受以后,它就会被保存在文件$HOME/.ssh/known\_hosts之中。下次再连接这台主机,系统就会认出它的公钥已经保存在本地了,从而跳过警告部分。 - >- 如果该主机上known\_hosts文件被删除,互信仍然可以使用,但是会有告警提示信息。如果需要规避告警提示信息,请将/etc/ssh/ssh\_config配置文件中,StrictHostKeyChecking参数设置为no。 - - -3. 将互信文件分发到其它所有主机上。在本例中,需要将plat1上的互信文件分发到plat2和plat3上。 - - 1、将互信文件分发到plat2上。Password输入拷贝目标主机的密码。 - - ``` - scp -r ~/.ssh plat2:~ - ``` - - 示例如下: - - ``` - plat1:~ # scp -r ~/.ssh plat2:~ - Password: - authorized_keys 100% 796 0.8KB/s 00:00 - id_rsa 100% 1675 1.6KB/s 00:00 - id_rsa.pub 100% 398 0.4KB/s 00:00 - known_hosts 100% 1089 1.1KB/s 00:00 - ``` - - 2、将互信文件分发到plat3上。Password输入拷贝目标主机的密码。 - - ``` - scp -r ~/.ssh plat3:~ - ``` - - 示例如下: - - ``` - plat1:~ # scp -r ~/.ssh plat3:~ - Password: - authorized_keys 100% 796 0.8KB/s 00:00 - id_rsa 100% 1675 1.6KB/s 00:00 - id_rsa.pub 100% 398 0.4KB/s 00:00 - known_hosts 100% 1089 1.1KB/s 00:00 - ``` - -4. 查看互信是否建成功,可以互相ssh主机名。输入exit退出。 - - ``` - plat1:~ # ssh plat2 - Last login: Sat Jun 20 14:01:07 2020 - plat2:~ # exit - logout - Connection to plat2 closed. - plat1:~ # - ``` - - >![](public_sys-resources/icon-note.gif) **说明:** - >如果三个以上节点,和上述过程类似。假设节点名为plat1、plat2、plat3、......。第一步,需要在plat1上生成root用户的本机授权文件;第二步,需要收集所有待建互信主机\(plat1、plat2、plat3、......\)的公钥并写入到本机known\_hosts文件中;第三步,需要将互信文件分发到除本机外的所有其它主机\(plat2、plat3、......\)上;第四步,检查互信是否建立成功。 - - -## 删除root用户互信 - -为了避免Root用户互信可能存在的安全隐患,因此建议用户在使用完成后,立即删除各主机上root用户的互信。 - -1. 删除openGauss数据库各节点上的互信相关文件/root/.ssh。 - - rm –rf \~/.ssh - -2. 查看互信是否删除成功,可以互相ssh主机名,提示不能互信,互信删除成功。 - - plat1:\~ \# ssh plat2 - - he authenticity of host ' plssat2 \(plat2\)' can't be established. - - ECDSA key fingerprint is SHA256:Q4DPRedFytsjsJSKf4l2lHKuzVw4prq3bIUCNVKIa7M. - - ECDSA key fingerprint is MD5:e2:77:6c:aa:4c:43:5f:f2:c4:58:ec:d5:53:de:7c:fc. - - Are you sure you want to continue connecting \(yes/no\)? - - -## 示例 - -root用户建立互信示例: - -``` -plat1:~ # gs_sshexkey -f /opt/software/hostfile -W Gauss_123 -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. -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. -``` - -普通用户建立互信示例: - -``` -gaussdb@plat1:~ > gs_sshexkey -f /opt/software/hostfile -W Gauss_123 -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. -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. -``` - -安全模式下建立互信示例,需要用户根据提示,手动输入建立互信的用户密码(建议使用安全模式): - -``` -plat1:~ # gs_sshexkey -f /opt/software/hostfile -Please enter password for current user[root]. -Password: -Checking network information. -All nodes in the network are Normal. -Successfully checked network information. -Creating SSH trust. -Creating the local key file. -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. -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. -``` - diff --git "a/content/zh/docs/installation/\346\211\247\350\241\214\345\215\270\350\275\275.md" "b/content/zh/docs/installation/\346\211\247\350\241\214\345\215\270\350\275\275.md" deleted file mode 100644 index 3ac8b25bdcbd60f112e0479975303d3fb95e3d87..0000000000000000000000000000000000000000 --- "a/content/zh/docs/installation/\346\211\247\350\241\214\345\215\270\350\275\275.md" +++ /dev/null @@ -1,54 +0,0 @@ -# 执行卸载 - -openGauss提供了卸载脚本帮助用户完整的卸载openGauss。 - -## 操作步骤 - -1. 以操作系统用户omm登录数据库主节点。 -2. 使用gs\_uninstall卸载openGauss。 - - ``` - gs_uninstall --delete-data - ``` - - 或者在openGauss中每个节点执行本地卸载。 - - ``` - gs_uninstall --delete-data -L - ``` - - -## 示例 - -使用gs\_uninstall脚本进行卸载openGauss。 - -``` -gs_uninstall --delete-data -Checking uninstallation. -Successfully checked uninstallation. -Stopping the cluster. -Successfully stopped the cluster. -Successfully deleted instances. -Uninstalling application. -Successfully uninstalled application. -Uninstallation succeeded. -``` - -单机卸载场景使用gs\_uninstall脚本进行卸载。 - -``` -gs_uninstall --delete-data -Checking uninstallation. -Successfully checked uninstallation. -Stopping the cluster. -Successfully stopped the cluster. -Successfully deleted instances. -Uninstalling application. -Successfully uninstalled application. -Uninstallation succeeded. -``` - -## 错误排查 - -如果卸载失败请根据“$GAUSSLOG/om/gs\_uninstall-YYYY-MM-DD\_HHMMSS.log”中的日志信息排查错误。 - diff --git "a/content/zh/docs/installation/\346\211\247\350\241\214\345\256\211\350\243\205.md" "b/content/zh/docs/installation/\346\211\247\350\241\214\345\256\211\350\243\205.md" index 680050f30b07d7d2429c22b5e16dbae755de0a1b..4c9d669708943260607b48d18eaeedeab3988b5d 100644 --- "a/content/zh/docs/installation/\346\211\247\350\241\214\345\256\211\350\243\205.md" +++ "b/content/zh/docs/installation/\346\211\247\350\241\214\345\256\211\350\243\205.md" @@ -1,78 +1,78 @@ -# 执行安装 - -执行前置脚本准备好openGauss安装环境之后,按照启动安装过程部署openGauss。 - -## 前提条件 - -- 已成功执行前置脚本gs\_preinstall。即完成了[准备安装用户及环境](准备安装用户及环境.md)。 -- 所有服务器操作系统和网络均正常运行。 -- 用户需确保各个主机上的locale保持一致。详细请参见[配置区域和字符集](配置区域和字符集.md)。 - -## 操作步骤 - -1. 检查安装包和openGauss配置文件在规划路径下是否已存在,如果没有,重新执行预安装,确保预安装成功,再执行以下步骤。 -2. 登录到openGauss的主机,并切换到omm用户。 - - ``` - su - omm - ``` - - >![](public_sys-resources/icon-note.gif) **说明:** - >- omm指的是前置脚本gs\_preinstall中-U参数指定的用户。 - >- 安装脚本gs\_install必须以前置脚本中指定的omm执行,否则,脚本执行会报错。 - -3. 使用gs\_install安装openGauss。若为环境变量分离的模式安装的集群需要source环境变量分离文件ENVFILE。 - - ``` - gs_install -X /opt/software/openGauss/cluster_config.xml - ``` - - /opt/software/openGauss/cluster\_config.xml为openGauss配置文件的路径。在执行过程中,用户需根据提示输入数据库的密码,密码具有一定的复杂度,为保证用户正常使用该数据库,请记住输入的数据库密码。 - - 设置的密码要符合复杂度要求: - - - 最少包含8个字符; - - 不能和用户名和当前密码(ALTER)相同,或和当前密码反序; - - 至少包含大写字母(A-Z),小写字母(a-z),数字,非字母数字字符(限定为\~!@\#$%^&\*\(\)-\_=+\\|\[\{\}\];:,<.\>/?)四类字符中的三类字符。 - - 安装过程中会生成ssl证书,证书存放路径为\{gaussdbAppPath\}/share/sslcert/om,其中\{gaussdbAppPath\}为集群openGauss配置文件中指定的程序安装目录。 - - 日志文件路径下会生成两个日志文件:“gs\_install-YYYY-MMDD\_HHMMSS.log”和“gs\_local-YYYY-MM-DD\_HHMMSS.log”。 - - >![](public_sys-resources/icon-note.gif) **说明:** - >- openGauss支持字符集的多种写法:gbk/GBK、UTF-8/UTF8/uft8/utf-8和Latine1/latine1。 - >- 安装时若不指定字符集,默认字符集为SQL\_ASCII,为简化和统一区域loacle默认设置为C,若想指定其他字符集和区域,请在安装时使用参数--gsinit-parameter="--locale=LOCALE"来指定,LOCALE为新数据库设置缺省的区域。 - > 例如用户要将数据库编码格式初始化为UTF-8,可以采用如下步骤: - > 用locale -a |grep utf8命令查看系统支持UTF-8编码的区域,如下: - > ``` - > omm@linux:~> locale -a|grep utf8 - > ``` - > 显示类似如下信息,其中en\_US.utf8表示区域en\_US支持UTF-8编码。 - > ``` - > ...... - > en_SG.utf8 - > en_US.utf8 - > ...... - > ``` - > 根据需要选择区域,如en\_US.utf8,初始化数据库时加入--locale=en\_US.utf8选项进行安装,示例如下: - > ``` - > gs_install -X /opt/software/openGauss/cluster_config.xml --gsinit-parameter="--locale=en_US.utf8" - > ``` - -4. 安装执行成功之后,需要手动删除主机root用户的互信,即删除openGauss数据库各节点上的互信文件。 - - ``` - rm –rf ~/.ssh - ``` - - -## 安装生成的目录 - -安装后的目录及各目录下的文件说明请参见[表1](#zh-cn_topic_0241805806_zh-cn_topic_0085434626_zh-cn_topic_0059782015_tdcb4fb0f38a6419099ee2c47d4d0b37f)。 - -**表 1** 安装生成的目录 - - +# 执行安装 + +执行前置脚本准备好openGauss安装环境之后,按照启动安装过程部署openGauss。 + +## 前提条件 + +- 已成功执行前置脚本gs\_preinstall。即完成了[准备安装用户及环境](准备安装用户及环境.md)。 +- 所有服务器操作系统和网络均正常运行。 +- 用户需确保各个主机上的locale保持一致。 + +## 操作步骤 + +1. 检查安装包和openGauss配置文件在规划路径下是否已存在,如果没有,重新执行预安装,确保预安装成功,再执行以下步骤。 +2. 登录到openGauss的主机,并切换到omm用户。 + + ``` + su - omm + ``` + + >![](public_sys-resources/icon-note.gif) **说明:** + >- omm指的是前置脚本gs\_preinstall中-U参数指定的用户。 + >- 安装脚本gs\_install必须以前置脚本中指定的omm执行,否则,脚本执行会报错。 + +3. 使用gs\_install安装openGauss。若为环境变量分离的模式安装的集群需要source环境变量分离文件ENVFILE。 + + ``` + gs_install -X /opt/software/openGauss/cluster_config.xml + ``` + + /opt/software/openGauss/cluster\_config.xml为openGauss配置文件的路径。在执行过程中,用户需根据提示输入数据库的密码,密码具有一定的复杂度,为保证用户正常使用该数据库,请记住输入的数据库密码。 + + 设置的密码要符合复杂度要求: + + - 最少包含8个字符; + - 不能和用户名和当前密码(ALTER)相同,或和当前密码反序; + - 至少包含大写字母(A-Z),小写字母(a-z),数字,非字母数字字符(限定为\~!@\#$%^&\*\(\)-\_=+\\|\[\{\}\];:,<.\>/?)四类字符中的三类字符。 + + 安装过程中会生成ssl证书,证书存放路径为\{gaussdbAppPath\}/share/sslcert/om,其中\{gaussdbAppPath\}为集群openGauss配置文件中指定的程序安装目录。 + + 日志文件路径下会生成两个日志文件:“gs\_install-YYYY-MMDD\_HHMMSS.log”和“gs\_local-YYYY-MM-DD\_HHMMSS.log”。 + + >![](public_sys-resources/icon-note.gif) **说明:** + >- openGauss支持字符集的多种写法:gbk/GBK、UTF-8/UTF8/uft8/utf-8和Latine1/latine1。 + >- 安装时若不指定字符集,默认字符集为SQL\_ASCII,为简化和统一区域loacle默认设置为C,若想指定其他字符集和区域,请在安装时使用参数--gsinit-parameter="--locale=LOCALE"来指定,LOCALE为新数据库设置缺省的区域。 + > 例如用户要将数据库编码格式初始化为UTF-8,可以采用如下步骤: + > 用locale -a |grep utf8命令查看系统支持UTF-8编码的区域,如下: + > ``` + > omm@linux:~> locale -a|grep utf8 + > ``` + > 显示类似如下信息,其中en\_US.utf8表示区域en\_US支持UTF-8编码。 + > ``` + > ...... + > en_SG.utf8 + > en_US.utf8 + > ...... + > ``` + > 根据需要选择区域,如en\_US.utf8,初始化数据库时加入--locale=en\_US.utf8选项进行安装,示例如下: + > ``` + > gs_install -X /opt/software/openGauss/cluster_config.xml --gsinit-parameter="--locale=en_US.utf8" + > ``` + +4. 安装执行成功之后,需要手动删除主机root用户的互信,即删除openGauss数据库各节点上的互信文件。 + + ``` + rm –rf ~/.ssh + ``` + + +## 安装生成的目录 + +安装后的目录及各目录下的文件说明请参见[表1](#zh-cn_topic_0241805806_zh-cn_topic_0085434626_zh-cn_topic_0059782015_tdcb4fb0f38a6419099ee2c47d4d0b37f)。 + +**表 1** 安装生成的目录 + + -

序号

项目目录说明

@@ -187,48 +187,48 @@
- -## 示例 - -执行安装: - -``` -omm@plat1:~> gs_install -X /opt/software/openGauss/cluster_config.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 ciper and rand files for database. -Please enter password for database: -Please repeat for database: -begin to create CA cert files -The sslcert will be generated in /opt/gaussdb/cluster/app/share/sslcert/om -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 DN nodes. -Successful check consistence of memCheck and coresCheck on all nodes. -Configuring pg_hba on all nodes. -Configuration is completed. -Successfully started cluster. -Successfully installed application. -``` - -## 错误排查 - -如果安装失败请根据openGauss日志目录下的“gs\_install-YYYY-MM-DD\_HHMMSS.log”和“gs\_local-YYYY-MM-DD\_HHMMSS.log”中的日志信息排查错误。 - + + +## 示例 + +执行安装: + +``` +omm@plat1:~> gs_install -X /opt/software/openGauss/cluster_config.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 ciper and rand files for database. +Please enter password for database: +Please repeat for database: +begin to create CA cert files +The sslcert will be generated in /opt/gaussdb/cluster/app/share/sslcert/om +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 DN nodes. +Successful check consistence of memCheck and coresCheck on all nodes. +Configuring pg_hba on all nodes. +Configuration is completed. +Successfully started cluster. +Successfully installed application. +``` + +## 错误排查 + +如果安装失败请根据openGauss日志目录下的“gs\_install-YYYY-MM-DD\_HHMMSS.log”和“gs\_local-YYYY-MM-DD\_HHMMSS.log”中的日志信息排查错误。 + diff --git "a/content/zh/docs/installation/\346\243\200\346\237\245openGauss\345\201\245\345\272\267\347\212\266\346\200\201.md" "b/content/zh/docs/installation/\346\243\200\346\237\245openGauss\345\201\245\345\272\267\347\212\266\346\200\201.md" deleted file mode 100644 index 5a5382434f061a252aa291982d70dc81c178d21b..0000000000000000000000000000000000000000 --- "a/content/zh/docs/installation/\346\243\200\346\237\245openGauss\345\201\245\345\272\267\347\212\266\346\200\201.md" +++ /dev/null @@ -1,60 +0,0 @@ -# 检查openGauss健康状态 - -通过openGauss提供的gs\_checkos工具可以完成操作系统状态检查。 - -## 前提条件 - -- 当前的硬件和网络环境正常。 -- 各主机间root互信状态正常。 -- 只能使用root用户执行gs\_checkos命令。 - -## 操作步骤 - -1. 以root用户身份登录服务器。 -2. 执行如下命令对openGauss节点服务器的OS参数进行检查。 - - ``` - gs_checkos -i A - ``` - - 检查节点服务器的OS参数的目的是为了保证openGauss正常通过预安装,并且在安装成功后可以安全高效的运行。详细的检查项目请参见《工具参考》gs\_checkos工具的表 1 操作系统检查项,操作系统参数和文件系统参数。 - - -## 示例 - -执行gs\_checkos前需要先执行前置脚本,准备环境。以参数"A"为例。 - -``` -gs_checkos -i A -Checking items: - A1. [ OS version status ] : Normal - A2. [ Kernel version status ] : Normal - A3. [ Unicode status ] : Normal - A4. [ Time zone status ] : Normal - A5. [ Swap memory status ] : Normal - A6. [ System control parameters status ] : Normal - A7. [ File system configuration status ] : Normal - A8. [ Disk configuration status ] : Normal - A9. [ Pre-read block size status ] : Normal - A10.[ IO scheduler status ] : Normal - A11.[ Network card configuration status ] : Normal - A12.[ Time consistency status ] : Warning - A13.[ Firewall service status ] : Normal - A14.[ THP service status ] : Normal -Total numbers:14. Abnormal numbers:0. Warning number:1. -``` - -以参数"B"为例。 - -``` -gs_checkos -i B -Setting items: - B1. [ Set system control parameters ] : Normal - B2. [ Set file system configuration value ] : Normal - B3. [ Set pre-read block size value ] : Normal - B4. [ Set IO scheduler value ] : Normal - B5. [ Set network card configuration value ] : Normal - B6. [ Set THP service ] : Normal -Total numbers:6. Abnormal numbers:0. Warning number:0. -``` - diff --git "a/content/zh/docs/installation/\346\243\200\346\237\245\345\201\245\345\272\267\347\212\266\346\200\201.md" "b/content/zh/docs/installation/\346\243\200\346\237\245\345\201\245\345\272\267\347\212\266\346\200\201.md" deleted file mode 100644 index c2e842984c5628c22217d00316190bb81201bb4b..0000000000000000000000000000000000000000 --- "a/content/zh/docs/installation/\346\243\200\346\237\245\345\201\245\345\272\267\347\212\266\346\200\201.md" +++ /dev/null @@ -1,61 +0,0 @@ -# 检查健康状态 - -通过openGauss提供的gs\_checkos工具可以完成操作系统状态检查。 - -## 前提条件 - -- 当前的硬件和网络环境正常。 -- 各主机间root互信状态正常。 -- 只能使用root用户执行gs\_checkos命令。 - -## 操作步骤 - -1. 以root用户身份登录服务器。 -2. 执行如下命令对openGauss节点服务器的OS参数进行检查。 - - ``` - gs_checkos -i A - ``` - - 检查节点服务器的OS参数的目的是为了保证openGauss正常通过预安装,并且在安装成功后可以安全高效的运行。详细的检查项目请参见《工具参考》gs\_checkos工具的表 1 操作系统检查项,操作系统参数和文件系统参数。 - - -## 示例 - -执行gs\_checkos前需要先执行前置脚本,准备环境。以参数"A"为例。 - -``` -gs_checkos -i A -Checking items: - A1. [ OS version status ] : Normal - A2. [ Kernel version status ] : Normal - A3. [ Unicode status ] : Normal - A4. [ Time zone status ] : Normal - A5. [ Swap memory status ] : Normal - A6. [ System control parameters status ] : Normal - A7. [ File system configuration status ] : Normal - A8. [ Disk configuration status ] : Normal - A9. [ Pre-read block size status ] : Normal - A10.[ IO scheduler status ] : Normal - A11.[ Network card configuration status ] : Normal - A12.[ Time consistency status ] : Warning - A13.[ Firewall service status ] : Normal - A14.[ THP service status ] : Normal -Total numbers:14. Abnormal numbers:0. Warning number:1. -``` - -以参数"B"为例。 - -``` -gs_checkos -i B -Setting items: - B1. [ Set system control parameters ] : Normal - B2. [ Set file system configuration value ] : Normal - B3. [ Set pre-read block size value ] : Normal - B4. [ Set IO scheduler value ] : Normal - B5. [ Set network card configuration value ] : Normal - B6. [ Set THP service ] : Normal - B7. [ Set RemoveIPC value ] : Normal -Total numbers:6. Abnormal numbers:0. Warning number:0. -``` - diff --git "a/content/zh/docs/installation/\347\244\272\344\276\213.md" "b/content/zh/docs/installation/\347\244\272\344\276\213.md" deleted file mode 100644 index c594a36d648750901da8a1308fe5c4eba55e1396..0000000000000000000000000000000000000000 --- "a/content/zh/docs/installation/\347\244\272\344\276\213.md" +++ /dev/null @@ -1,7 +0,0 @@ -# 示例 - -- **[单节点配置文件](单节点配置文件.md)** - -- **[一主一备配置文件](一主一备配置文件.md)** - - diff --git "a/content/zh/docs/installation/\350\216\267\345\217\226\345\256\211\350\243\205\345\214\205.md" "b/content/zh/docs/installation/\350\216\267\345\217\226\345\256\211\350\243\205\345\214\205.md" index 6ed654f0785c48c42f0765fdb1aa0d0aa2ee141b..265898abd4d027cd7ee9e86ccdf6719a69bfb6df 100644 --- "a/content/zh/docs/installation/\350\216\267\345\217\226\345\256\211\350\243\205\345\214\205.md" +++ "b/content/zh/docs/installation/\350\216\267\345\217\226\345\256\211\350\243\205\345\214\205.md" @@ -1,23 +1,23 @@ -# 获取安装包 - -openGauss开源社区上提供了安装包的获取方式。 - -## 操作步骤 - -1. 从openGauss开源社区下载对应平台的安装包。 - 1. 通过[https://opengauss.org/zh/download.html](https://opengauss.org/zh/download.html)登录openGauss开源社区。用户可根据安装包说明[表1](#zh-cn_topic_0241805803_zh-cn_topic_0085434653_zh-cn_topic_0059781995_te4a9d557337c400c85acff184476a722)按需下载。 - - **图1** 开源网站openGauss Server页面 - - ![](figures/zh-cn_image_0260397375.png) - - **图2** 开源网站openGauss Connectors页面 - - ![](figures/zh-cn_image_0260397341.png) - - **表 1** openGauss Connectors安装包说明 - - +# 获取安装包 + +openGauss开源社区上提供了安装包的获取方式。 + +## 操作步骤 + +1. 从openGauss开源社区下载对应平台的安装包。 + 1. 通过[https://opengauss.org/zh/download.html](https://opengauss.org/zh/download.html)登录openGauss开源社区。用户可根据安装包说明[表1](#zh-cn_topic_0241805803_zh-cn_topic_0085434653_zh-cn_topic_0059781995_te4a9d557337c400c85acff184476a722)按需下载。 + + **图1** 开源网站openGauss Server页面 + + ![](figures/zh-cn_image_0260397375.png) + + **图2** 开源网站openGauss Connectors页面 + + ![](figures/zh-cn_image_0260397341.png) + + **表 1** openGauss Connectors安装包说明 + + -

安装包名称

说明

@@ -40,30 +40,30 @@ openGauss开源社区上提供了安装包的获取方式。
- - 2. 选择所需安装包单击“下载”。 - 3. 解压下载后的压缩包。 - -2. 检查安装包。 - - 解压安装包,检查安装目录及文件是否齐全。在安装包所在目录执行以下命令: - - ``` - tar -zxvf openGauss-x.x.x-openEuler-64bit.tar.gz - ls -1 - ``` - - 执行ls命令,显示类似如下信息: - - ``` - total 50M - drwxr-xr-x 14 root root 4.0K Jul 6 11:03 lib - -rw-r--r-- 1 root root 65 Jul 6 11:03 openGauss-x.x.x-openEuler-64bit.sha256 - -rw-r--r-- 1 root root 50M Jul 6 11:03 openGauss-x.x.x-openEuler-64bit.tar.bz2 - drwxr-xr-x 5 root root 4.0K Jul 6 11:03 script - -rw-r--r-- 1 root root 32 Jul 6 11:03 version.cfg - - ``` - - + + + 2. 选择所需安装包单击“下载”。 + 3. 解压下载后的压缩包。 + +2. 检查安装包。 + + 解压安装包,检查安装目录及文件是否齐全。在安装包所在目录执行以下命令: + + ``` + tar -zxvf openGauss-x.x.x-openEuler-64bit.tar.gz + ls -1 + ``` + + 执行ls命令,显示类似如下信息: + + ``` + total 50M + drwxr-xr-x 14 root root 4.0K Jul 6 11:03 lib + -rw-r--r-- 1 root root 65 Jul 6 11:03 openGauss-x.x.x-openEuler-64bit.sha256 + -rw-r--r-- 1 root root 50M Jul 6 11:03 openGauss-x.x.x-openEuler-64bit.tar.bz2 + drwxr-xr-x 5 root root 4.0K Jul 6 11:03 script + -rw-r--r-- 1 root root 32 Jul 6 11:03 version.cfg + + ``` + + diff --git "a/content/zh/docs/installation/\350\216\267\345\217\226\345\271\266\346\240\241\351\252\214\345\256\211\350\243\205\345\214\205.md" "b/content/zh/docs/installation/\350\216\267\345\217\226\345\271\266\346\240\241\351\252\214\345\256\211\350\243\205\345\214\205.md" deleted file mode 100644 index b378b72c66ef6c62b1ed049c05498b1f607152f7..0000000000000000000000000000000000000000 --- "a/content/zh/docs/installation/\350\216\267\345\217\226\345\271\266\346\240\241\351\252\214\345\256\211\350\243\205\345\214\205.md" +++ /dev/null @@ -1,55 +0,0 @@ -# 获取并校验安装包 - -为了防止安装包在传输过程中被恶意篡改或破坏给客户网络安全造成威胁,在获取到安装包后,需要对安装包的完整性进行校验,通过了校验的安装包才能部署。 - -## 前提条件 - -已经获取openGauss安装包和签名文件,安装包与签名文件是一一对应并放在同一目录下,一个安装包对应一个校验文件,签名文件由各产品与对应的安装包版本同时发布,签名文件的后缀是“sha256”,通常情况下名称和安装包名称相同。假设安装包的名称openGauss-x.x.x.x-openEuler-64bit.tar.gz时,对应的校验文件的名称为“openGauss-x.x.x.x-openEuler-64bit.tar.gz.sha256”。 - -## 操作步骤 - -1. 从openGauss开源社区下载对应平台的安装包。 - 1. 登录openGauss开源社区。 - 2. 单击“下载”。 - 3. 解压下载后的压缩包。 - -2. 验证安装程序。 - 1. 解压安装包,检查安装目录及文件是否齐全。在安装包所在目录执行以下命令: - - ``` - tar -zxvf openGauss-x.x.x-openEuler-64bit.tar.gz - ls -1 - ``` - - 执行ls命令,显示类似如下信息,其中packages目录中_openGauss-x.x.x-openEuler_-64bit.tar.gz表示数据库安装包,在执行_openGauss-x.x.x_安装的过程中会对数据库安装程序自动执行SHA256校验 - - ``` - total 577M - -rw-r--r-- 1 root root 36 Jun 15 11:46 bepkit_env.conf - drwxr-xr-x 14 root root 4.0K Jun 15 11:46 lib - -rw-r--r-- 1 root root 65 Jun 15 11:46 openGauss-x.x.x-openEuler-64bit.sha256 - -rwxr-xr-x 1 root root 214M Jun 15 11:46 openGauss-x.x.x-openEuler-64bit-symbol.tar.gz - -rw-r--r-- 1 root root 47M Jun 15 11:46 openGauss-x.x.x-openEuler-64bit.tar.bz2 - -rw-r--r-- 1 root root 53M Jun 15 11:46 openGauss-x.x.x-openEuler-64bit.tar.gz - -rw------- 1 root root 265M Jun 18 15:50 openGauss-x.x.x_PACKAGES_RELEASE.tar.gz - drwxr-xr-x 5 root root 4.0K Jun 15 11:46 script - -rw-r--r-- 1 root root 32 Jun 15 11:46 version.cfg - - ``` - - 2. 进入scripts目录启动openGauss安装,观察是否提示安装不成功。 - - 在安装过程中,安装包会自动使用SHA256文件校验数据库安装程序的完整性。 - - 如果出现类似如下的信息,则表示数据库安装包校验失败,从而会导致openGauss安装失败。 - - ``` - Error: The sha256 value is different! - Bin file a4ebce0b6052723b1f386928e4d820fa2 - sha256 file 4ebce0b6052723b1f386928e4d820fa2 - ``` - - 如果无任何错误提示,则表示安装程序正确,未被非法修改。 - - - diff --git "a/content/zh/docs/installation/\350\256\276\347\275\256root\347\224\250\346\210\267\350\277\234\347\250\213\347\231\273\345\275\225.md" "b/content/zh/docs/installation/\350\256\276\347\275\256root\347\224\250\346\210\267\350\277\234\347\250\213\347\231\273\345\275\225.md" deleted file mode 100644 index c0c1e96de9f66a393cb79988da5c5e510db4d162..0000000000000000000000000000000000000000 --- "a/content/zh/docs/installation/\350\256\276\347\275\256root\347\224\250\346\210\267\350\277\234\347\250\213\347\231\273\345\275\225.md" +++ /dev/null @@ -1,60 +0,0 @@ -# 设置root用户远程登录 - -在openGauss安装时需要root帐户远程登录访问权限,本章介绍如何设置使用root用户远程登录。 - -1. 修改PermitRootLogin配置,允许用户远程登录。 - 1. 打开sshd\_config文件。 - - ``` - vim /etc/ssh/sshd_config - ``` - - 2. 修改权限配置,可以使用以下两种方式实现: - - 注释掉“PermitRootLogin no”。 - - ``` - #PermitRootLogin no - ``` - - - 将“PermitRootLogin“改为“yes“。 - - ``` - PermitRootLogin yes - ``` - - 3. 执行**:wq**保存并退出编辑页面。 - -2. 修改Banner配置,去掉连接到系统时,系统提示的欢迎信息。欢迎信息会干扰安装时远程操作的返回结果,影响安装正常执行。 - 1. 编辑sshd\_config文件。 - - ``` - vim /etc/ssh/sshd_config - ``` - - 2. 修改Banner配置,注释掉“Banner”所在的行。 - - ``` - #Banner XXXX - ``` - - 3. 执行**:wq**保存并退出编辑页面。 - -3. 使用如下命令使设置生效。 - - ``` - service sshd restart - ``` - - >![](public_sys-resources/icon-caution.gif) **注意:** - >若执行命令后返回提示信息“Redirecting to /bin/systemctl restart sshd.service”,请执行命令:/bin/systemctl restart sshd.service。 - -4. 以root用户身份重新登录。 - - ``` - ssh xxx.xxx.xxx.xxx - ``` - - >![](public_sys-resources/icon-note.gif) **说明:** - >xxx.xxx.xxx.xxx为安装openGauss环境的ip。 - - diff --git "a/content/zh/docs/installation/\350\256\276\347\275\256\345\255\227\347\254\246\351\233\206\345\217\202\346\225\260.md" "b/content/zh/docs/installation/\350\256\276\347\275\256\345\255\227\347\254\246\351\233\206\345\217\202\346\225\260.md" deleted file mode 100644 index 6b54c3de880248ea33bb2db2a107893ee8a4fe93..0000000000000000000000000000000000000000 --- "a/content/zh/docs/installation/\350\256\276\347\275\256\345\255\227\347\254\246\351\233\206\345\217\202\346\225\260.md" +++ /dev/null @@ -1,8 +0,0 @@ -# 设置字符集参数 - -将各数据库节点的字符集设置为相同的字符集,可以在/etc/profile文件中添加"export LANG=XXX"(XXX为Unicode编码)。 - -``` -vim /etc/profile -``` - diff --git "a/content/zh/docs/installation/\350\256\276\347\275\256\346\227\266\345\214\272\345\222\214\346\227\266\351\227\264.md" "b/content/zh/docs/installation/\350\256\276\347\275\256\346\227\266\345\214\272\345\222\214\346\227\266\351\227\264.md" deleted file mode 100644 index f7b7505588ed684fd5e8f5e82bdc4297ecf351bc..0000000000000000000000000000000000000000 --- "a/content/zh/docs/installation/\350\256\276\347\275\256\346\227\266\345\214\272\345\222\214\346\227\266\351\227\264.md" +++ /dev/null @@ -1,20 +0,0 @@ -# 设置时区和时间 - -将各数据库节点的时区设置为相同时区,可以将/usr/share/zoneinfo/目录下的时区文件拷贝为/etc/localtime文件。 - -``` -cp /usr/share/zoneinfo/$地区/$时区 /etc/localtime -``` - ->![](public_sys-resources/icon-note.gif) **说明:** ->_$地区/$时区为需要设置时区的信息,例如:Asia_/Shanghai。 - -使用date -s命令将各主机的时间设置为统一时间,举例如下。 - -``` -date -s Mon May 11 16:42:11 CST 2020 -``` - ->![](public_sys-resources/icon-note.gif) **说明:** ->可以通过date命令查询主机时区。 - diff --git "a/content/zh/docs/installation/\350\256\276\347\275\256\347\275\221\345\215\241MTU\345\200\274.md" "b/content/zh/docs/installation/\350\256\276\347\275\256\347\275\221\345\215\241MTU\345\200\274.md" deleted file mode 100644 index b197dc9e3de0ec537ccb91423caca19238f829f7..0000000000000000000000000000000000000000 --- "a/content/zh/docs/installation/\350\256\276\347\275\256\347\275\221\345\215\241MTU\345\200\274.md" +++ /dev/null @@ -1,8 +0,0 @@ -# 设置网卡MTU值 - -将各数据库节点的网卡MTU值设置为相同大小。对于X86,MTU值推荐1500;对于ARM,MTU值推荐8192。 - -``` -ifconfig 网卡编号 mtu 值 -``` - diff --git "a/content/zh/docs/installation/\350\275\257\347\241\254\344\273\266\347\216\257\345\242\203\350\246\201\346\261\202.md" "b/content/zh/docs/installation/\350\275\257\347\241\254\344\273\266\347\216\257\345\242\203\350\246\201\346\261\202.md" deleted file mode 100644 index 3795de1627bae6a0e79f1c0af7282dc59f03db31..0000000000000000000000000000000000000000 --- "a/content/zh/docs/installation/\350\275\257\347\241\254\344\273\266\347\216\257\345\242\203\350\246\201\346\261\202.md" +++ /dev/null @@ -1,136 +0,0 @@ -# 软硬件环境要求 - -介绍openGauss的软硬件环境要求。建议部署openGauss的各服务器具有等价的软硬件配置。 - -## 硬件环境要求 - -[表1](#zh-cn_topic_0241802565_zh-cn_topic_0085434629_zh-cn_topic_0059782022_t62cd0eed17004265b1b8ad98f302a4bc)列出了openGauss服务器应具备的最低硬件要求。在实际产品中,硬件配置的规划需考虑数据规模及所期望的数据库响应速度。请根据实际情况进行规划。 - -**表 1** 硬件环境要求 - - - - - - - - - - - - - - - - - - - -

项目

-

配置描述

-

内存

-

功能调试建议32GB以上。

-

性能测试和商业部署时,单实例部署建议128GB以上。

-

复杂的查询对内存的需求量比较高,在高并发场景下,可能出现内存不足。此时建议使用大内存的机器,或使用负载管理限制系统的并发。

-

CPU

-

功能调试最小1×8 核 2.0GHz。

-

性能测试和商业部署时,单实例部署建议1×16核 2.0GHz。

-

CPU超线程和非超线程两种模式都支持。但是,openGauss各节点的设置需保持一致。

-

硬盘

-

用于安装openGauss的硬盘需最少满足如下要求:

-
  • 至少1GB用于安装openGauss的应用程序包。
  • 每个主机需大约300MB用于元数据存储。
  • 预留70%以上的磁盘剩余空间用于数据存储。
-

建议系统盘配置为Raid1,数据盘配置为Raid5,且规划4组Raid5数据盘用于安装openGauss。有关Raid的配置方法在本手册中不做介绍。请参考硬件厂家的手册或互联网上的方法进行配置,其中Disk Cache Policy一项需要设置为Disabled,否则机器异常掉电后有数据丢失的风险。

-

openGauss支持使用SSD盘作为数据库的主存储设备,支持SAS接口和NVME协议的SSD盘,以RAID的方式部署使用。

-

网络要求

-

300兆以上以太网。

-

建议网卡设置为双网卡冗余bond。有关网卡冗余bond的配置方法在本手册中不做介绍。请参考硬件厂商的手册或互联网上的方法进行配置。

-

openGauss网络如果配置bond,请保证bond模式一致,不一致的bond配置可能导致openGauss工作异常。

-
- -## 软件环境要求 - -**表 2** 软件环境要求 - - - - - - - - - - - - - - - - - - - -

软件类型

-

配置描述

-

Linux操作系统

-

openEuler 20.3LTS和CentOS 7.6

-

Linux文件系统

-

剩余inode个数 > 15亿(推荐)

-

工具

-

bzip2

-

Python

-
  • openEuler:支持Python 3.7.X
  • CentOS:支持Python 3.6.X
-
- -## 软件依赖要求 - -openGauss的软件依赖要求如[表3](#table11459151513383)所示。 - -建议使用上述操作系统安装光盘或者源中,下列依赖软件的默认安装包,若不存在下列软件,可参看软件对应的建议版本。 - -**表 3** 软件依赖要求 - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

所需软件

-

建议版本

-

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

-

lsb_release

-

建议版本:4.1

-
- diff --git "a/content/zh/docs/installation/\351\205\215\347\275\256Host\345\237\272\346\234\254\344\277\241\346\201\257.md" "b/content/zh/docs/installation/\351\205\215\347\275\256Host\345\237\272\346\234\254\344\277\241\346\201\257.md" deleted file mode 100644 index 18061bbc38925534707611a254c0c3fb9535a810..0000000000000000000000000000000000000000 --- "a/content/zh/docs/installation/\351\205\215\347\275\256Host\345\237\272\346\234\254\344\277\241\346\201\257.md" +++ /dev/null @@ -1,72 +0,0 @@ -# 配置Host基本信息 - ->![](public_sys-resources/icon-note.gif) **说明:** ->每台Host服务器都必须有如下信息,如下示例以node1为例。 - -加粗字体内容为示例,可自行替换。每行信息均有注释进行说明。 - -``` - - - - - - - - - - - - -``` - -**表 1** 参数说明 - - - - - - - - - - - - - - - - - - - - - - - - -

实例类型

-

参数

-

说明

-

整体信息

-

name

-

主机名称。

-

azName

-

指定azName(Available Zone Name),字符串(不能含有特殊字符),例如AZ1、AZ2、AZ3。

-

azPriority

-

指定azPriority的优先级。

-

backIp1

-

主机在后端存储网络中的IP地址(内网IP)。所有openGauss主机使用后端存储网络通讯。

-

sshIp1

-

设置SSH可信通道IP地址(外网IP)。若无外网,则可以不设置该选项或者同backIp1设置相同IP。

-
- ->![](public_sys-resources/icon-note.gif) **说明:** ->配置文件中所有IP参数(包含backIp、sshIp、listenIp等)均只支持配置一个IP。如果配置第二个IP参数,则不会读取第二个参数的配置值。 ->示例:xml配置文件中同时配置backIp1和backIp2参数: ->在解析配置文件时仅读取backIp1参数的配置值,不会读取backIp2参数的配置值。 ->``` -> -> ->``` - diff --git "a/content/zh/docs/installation/\351\205\215\347\275\256\345\214\272\345\237\237\345\222\214\345\255\227\347\254\246\351\233\206.md" "b/content/zh/docs/installation/\351\205\215\347\275\256\345\214\272\345\237\237\345\222\214\345\255\227\347\254\246\351\233\206.md" deleted file mode 100644 index 9d0e31bdb9681b87e0185c84316947105bded9a6..0000000000000000000000000000000000000000 --- "a/content/zh/docs/installation/\351\205\215\347\275\256\345\214\272\345\237\237\345\222\214\345\255\227\347\254\246\351\233\206.md" +++ /dev/null @@ -1,129 +0,0 @@ -# 配置区域和字符集 - -区域和字符集在安装过程中通过指定初始化GUC参数来控制,考虑到这两个参数的重要性,在此单独对这两个参数进行详细说明。 - -## 相关概念 - -区域: - -- 区域是指应用中考虑字母、排序、数字格式等与文化相关的问题。 -- 使用gs\_install脚本初始化一个数据库时会初始化区域。缺省时,gs\_install脚本将会指定C区域为默认区域来初始化数据库。因此,如果安装的默认区域与用户规划的相同,则初始化数据库时不需要再设置。 - -字符集(编码格式): - -- openGauss支持GBK、UTF-8和Latin1编码格式。 -- 使用gs\_install脚本初始化数据库时会初始化字符集。缺省时,gs\_install脚本将会指定SQL\_ASCII字符集来初始化数据库,初始化完数据库不能再对数据库服务端字符集进行修改。但在创建数据库的时候是可以修改默认字符集。因此,多个数据库可以设置为不同的字符集。 - -## 规划原则和方法 - -- 规划字符集,选择原则和设置方法请参见[表1](#zh-cn_topic_0241805810_zh-cn_topic_0085434664_zh-cn_topic_0059782037_table4528029520399)。 - - **表 1** 字符集 - - - - - - - - - - - - - - - - - - -

字符集

-

规划原则

-

设置方法

-

GBK

-

如果数据库只需要支持中文,数据量很大,性能要求也很高,那就应该选择双字节定长编码的中文字符集。对openGauss来说,中文字符集目前只能选择GBK 。

-
  • 在安装数据库时指定初始化参数-E。
  • 通过SQL语句创建数据库时指定ENCODING参数。
-

详细请参见示例

-

UTF-8

-

如果应用程序要处理各种各样的文字,或者将处理结果发布到使用不同语言的国家或地区,就应该选择Unicode字符集。对openGauss来说,Unicode字符集目前只能选择UTF-8 。

-

Latin1

-

如果数据库只需要支持ASCII收录的字符、西欧语言、希腊语、泰语、阿拉伯语、希伯来语对应的文字符号,则可以选择Latin1。

-
- - >![](public_sys-resources/icon-note.gif) **说明:** - >- openGauss支持字符集的多种写法:gbk/GBK、UTF-8/UTF8/uft8/utf-8和Latine1/latine1。 - >- 安装时若不指定字符集,默认字符集为SQL\_ASCII,若想指定,请在安装时指定,具体操作请参见[示例](#zh-cn_topic_0241805810_zh-cn_topic_0085434664_zh-cn_topic_0059782037_sa523d6a2a09c4cf29d503e2175747721)。 - -- 规划区域。 - 1. 检查与指定字符集(假设为UTF-8)匹配的区域。 - - ``` - locale -a |grep utf8 - ``` - - 显示类似如下信息,其中en\_US.utf8表示区域en\_US支持UTF-8编码。 - - ``` - ...... - en_SG.utf8 - en_US.utf8 - ...... - ``` - - 2. 在初始化数据库时设置区域,设置方法请参见[示例](#zh-cn_topic_0241805810_zh-cn_topic_0085434664_zh-cn_topic_0059782037_sa523d6a2a09c4cf29d503e2175747721)。 - - -## 示例 - -示例1:初始化新的数据库系统 - -1.以操作系统用户omm登录数据库主节点,进入数据目录"/opt/huawei/install/data",创建新的目录"data\_dn2",确保该数据目录所有权分配给数据库用户omm,所属用户组为omm用户所属的用户组。 - -``` -mkdir /opt/huawei/install/data/data_dn2 -``` - -2.执行gs\_initdb命令初始化新的数据库,指定数据库初始化的字符集为UTF-8,区域为zh\_CN.UTF-8。 - -``` -gs_initdb -E UTF-8 --locale=zh_CN.UTF-8 -D /opt/huawei/install/data/data_dn2 --nodename dn2 -w "Bigdata@123" -``` - -/opt/huawei/install/data/data\_dn2为初始化新数据库的数据目录路径,Bigdata@123为数据库用户密码。 - -显示类似如下信息: - -``` -The files belonging to this database system will be owned by user "omm". -This user must also own the server process. - -The database cluster will be initialized with locale "zh_CN.UTF-8". -gs_initdb: could not find suitable text search configuration for locale "zh_CN.UTF-8" -The default text search configuration will be set to "simple". - -fixing permissions on existing directory /opt/huawei/install/data/data_dn2 ... ok -creating subdirectories ... ok -selecting default max_connections ... 100 -selecting default shared_buffers ... 32MB -creating configuration files ... ok -...... -``` - -示例2:使用SQL创建新的数据库 - -使用SQL语句创建数据库时,指定数据库的字符集为GBK。 - -``` -gsql -d postgres -p 15400 -``` - -``` -postgres=# CREATE DATABASE mydb WITH ENCODING 'GBK' template = template0; -``` - -显示类似如下信息: - -``` -CREATE DATABASE -``` - diff --git "a/content/zh/docs/installation/\351\205\215\347\275\256\346\223\215\344\275\234\347\263\273\347\273\237\345\217\202\346\225\260.md" "b/content/zh/docs/installation/\351\205\215\347\275\256\346\223\215\344\275\234\347\263\273\347\273\237\345\217\202\346\225\260.md" deleted file mode 100644 index 8f5dda3f11b2468fca2f367606547fbc4d041cc0..0000000000000000000000000000000000000000 --- "a/content/zh/docs/installation/\351\205\215\347\275\256\346\223\215\344\275\234\347\263\273\347\273\237\345\217\202\346\225\260.md" +++ /dev/null @@ -1,503 +0,0 @@ -# 配置操作系统参数 - -openGauss要求各主机上的操作系统参数设置成一定的值,以满足系统运行的性能要求等。 - -这些参数有些会在openGauss安装环境准备阶段完成设置,且这些参数将直接影响openGauss的运行状态,请仅在确认必要时进行手动调整。方法如下: - -1. 以root用户身份登录服务器。 -2. 对文件“/etc/sysctl.conf”进行编辑修改。 - - 具体参数的修改请参见[操作系统参数](#zh-cn_topic_0241805805_zh-cn_topic_0085434661_zh-cn_topic_0059782062_section3705271819540)。 - -3. 执行如下命令使修改配置生效。 - - ``` - sysctl -p - ``` - - -## 操作系统参数 - -**表 1** 操作系统参数 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

参数名称

-

参数说明

-

推荐取值

-

net.ipv4.tcp_max_tw_buckets

-

表示同时保持TIME_WAIT状态的TCP/IP连接最大数量。如果超过所配置的取值,TIME_WAIT将立刻被释放并打印警告信息。

-

10000

-

net.ipv4.tcp_tw_reuse

-

允许将TIME-WAIT状态的sockets重新用于新的TCP连接。

-
  • 0表示关闭。
  • 1表示开启。
-

1

-

net.ipv4.tcp_tw_recycle

-

表示开启TCP连接中TIME-WAIT状态sockets的快速回收。

-
  • 0表示关闭。
  • 1表示开启。
-

1

-

net.ipv4.tcp_keepalive_time

-

表示当keepalive启用的时候,TCP发送keepalive消息的频度。

-

30

-

net.ipv4.tcp_keepalive_probes

-

在认定连接失效之前,发送TCP的keepalive探测包数量。这个值乘以tcp_keepalive_intvl之后决定了一个连接发送了keepalive之后可以有多少时间没有回应。

-

9

-

net.ipv4.tcp_keepalive_intvl

-

当探测没有确认时,重新发送探测的频度。

-

30

-

net.ipv4.tcp_retries1

-

在连接建立过程中TCP协议最大重试次数。

-

5

-

net.ipv4.tcp_syn_retries

-

TCP协议SYN报文最大重试次数。

-

5

-

net.ipv4.tcp_synack_retries

-

TCP协议SYN应答报文最大重试次数。

-

5

-

net.sctp.path_max_retrans

-

SCTP协议最大重试次数。

-

10

-

net.sctp.max_init_retransmits

-

SCTP协议INIT报文最大重试次数。

-

10

-

net.sctp.association_max_retrans

-

SCTP协议单个逻辑连接最大重试次数。

-

10

-

net.sctp.hb_interval

-

SCTP协议心跳检测包重传间隔。

-

30000

-

net.ipv4.tcp_retries2

-

控制内核向已经建立连接的远程主机重新发送数据的次数,低值可以更早的检测到与远程主机失效的连接,因此服务器可以更快的释放该连接。

-

发生“connection reset by peer”时可以尝试调大该值规避问题。

-

12

-

vm.overcommit_memory

-

控制在做内存分配的时候,内核的检查方式。

-
  • 0:表示系统会尽量精确计算当前可用的内存。
  • 1:表示不作检查直接返回成功。
  • 2:内存总量×vm.overcommit_ratio/100+SWAP的总量,如果申请空间超过此数值则返回失败。
-

内核默认是2过于保守,推荐设置为0,如果系统压力大可以设置为1。

-

0

-

net.sctp.sndbuf_policy

-

SCTP发送缓冲区分配原则。

-
  • 0为按连接。
  • 1为按耦联。
-

0

-

net.sctp.rcvbuf_policy

-

SCTP接收缓冲区分配原则。

-
  • 0为按连接。
  • 1为按耦联。
-

0

-

net.sctp.sctp_mem

-

内核SCTP协议栈的最大可用内存,分无压力,有压力,和压力大三个区间,压力大时会丢包,单位为页面。

-

94500000 915000000 927000000

-

net.sctp.sctp_rmem

-

内核SCTP协议栈的接收总可用内存,分无压力,有压力和压力大三个区间,压力大时会丢包,单位为页面。

-

8192 250000 16777216

-

net.sctp.sctp_wmem

-

内核SCTP协议栈的发送总可用内存,分无压力,有压力和压力大三个区间,压力大时会丢包,单位为页面。

-

8192 250000 16777216

-

net.ipv4.tcp_rmem

-

TCP协议接收端缓冲区的可用内存大小。分无压力,有压力,和压力大三个区间,单位为页面。

-

8192 250000 16777216

-

net.ipv4.tcp_wmem

-

TCP协议发送端缓冲区的可用内存大小。分无压力,有压力,和压力大三个区间,单位为页面。

-

8192 250000 16777216

-

net.core.wmem_max

-

socket发送端缓冲区大小的最大值。

-

21299200

-

net.core.rmem_max

-

socket接收端缓冲区大小的最大值。

-

21299200

-

net.core.wmem_default

-

socket发送端缓冲区大小的默认值。

-

21299200

-

net.core.rmem_default

-

socket接收端缓冲区大小的默认值。

-

21299200

-

net.ipv4.ip_local_port_range

-

物理机可用临时端口范围。

-

26000-65535

-

kernel.sem

-

内核信号量参数设置大小。

-

250 6400000 1000 25600

-

vm.min_free_kbytes

-

保证物理内存有足够空闲空间,防止突发性换页。

-

系统总内存的5%

-

net.core.somaxconn

-

定义了系统中每一个端口最大的监听队列的长度,这是个全局的参数。

-

65535

-

net.ipv4.tcp_syncookies

-

当出现SYN等待队列溢出时,启用cookies来处理,可防范少量SYN攻击。

-
  • 0表示关闭SYN Cookies。
  • 1表示开启SYN Cookies。
-

1

-

net.sctp.addip_enable

-

SCTP动态地址重置支持开关

-
  • 0表示关闭。
  • 1表示开启。
-

0

-

net.core.netdev_max_backlog

-

在每个网络接口接收数据包的速率比内核处理这些包的速率快时,允许送到队列的数据包的最大数目。

-

65535

-

net.ipv4.tcp_max_syn_backlog

-

记录的那些尚未收到客户端确认信息的连接请求的最大值。

-

65535

-

net.ipv4.tcp_fin_timeout

-

系统默认的超时时间。

-

60

-

kernel.shmall

-

内核可用的共享内存总量。

-

1152921504606846720

-

kernel.shmmax

-

内核参数定义单个共享内存段的最大值。

-

18446744073709551615

-

net.ipv4.tcp_sack

-

启用有选择的应答,通过有选择地应答乱序接受到的报文来提高性能,让发送者只发送丢失的报文段(对于广域网来说)这个选项应该启用,但是会增加对CPU的占用。

-
  • 0表示关闭。
  • 1表示开启
-

1

-

net.ipv4.tcp_timestamps

-

TCP时间戳(会在TCP包头增加12节),以一种比重发超时更精确的方式(参考RFC 1323)来启用对RTT的计算,启用可以实现更好的性能。

-
  • 0表示关闭。
  • 1表示开启
-

1

-

vm.extfrag_threshold

-

系统内存不够用时,linux会为当前系统内存碎片情况打分,如果超过vm.extfrag_threshold的值,kswapd就会触发memory compaction。所以这个值设置的接近1000,说明系统在内存碎片的处理倾向于把旧的页换出,以符合申请的需要,而设置接近0,表示系统在内存碎片的处理倾向做memory compaction。

-

500

-

vm.overcommit_ratio

-

系统使用绝不过量使用内存的算法时,系统整个内存地址空间不得超过swap+RAM值的此参数百分比,当vm.overcommit_memory=2时此参数生效。

-

90

-

/sys/module/sctp/parameters/no_checksums

-

SCTP协议是否关闭checksum。

-

0

-

MTU

-

节点网卡最大传输单元。OS默认值为1500,调整为8192可以提升SCTP协议数据收发的性能。

-

8192

-
- -## 文件系统参数 - -- soft nofile - - 说明:soft nofile表示软限制,用户使用的文件句柄数量可以超过该限制,但是如果超过会有告警信息。 - - 推荐取值:1000000 - -- hard nofile - - 说明:hard nofile表示硬限制,是一个严格的限制,用户使用的文件句柄数量一定不能超过该设置。 - - 推荐取值:1000000 - -- stack size - - 说明:线程堆栈大小。 - - 推荐值:3072 - - -## transparent\_hugepage设置 - -openGauss默认关闭使用transparent\_hugepage服务,并将关闭命令写入操作系统启动文件。 - -## 文件句柄设置 - -需要对文件句柄数进行手动设置时,使用root用户执行如下命令进行参数修改: - -``` -echo "* soft nofile 1000000" >>/etc/security/limits.conf -echo "* hard nofile 1000000" >>/etc/security/limits.conf -``` - -完成修改后,需重启操作系统使得设置的参数生效。 - -**表 2** 文件句柄数设置 - - - - - - - - - - - - - - - - - - - -

参数名

-

说明

-

预安装时是否由脚本自动设置

-

推荐取值

-

* soft nofile

-

soft nofile表示软限制,即表示任何用户能打开的最大文件数量为1000000,不管它开启多少个shell。

-

-

1000000

-

* hard nofile

-

hard nofile表示硬限制,软限制要小于等于硬限制。

-

-

1000000

-
- -## 系统支持的最大进程数设置 - -需要对系统支持的最大进程数进行手动设置时,执行如下命令打开conf文件。 - -``` -vim /etc/security/limits.d/90-nproc.conf -``` - -修改\* soft nproc参数。 - -完成修改后,需重启操作系统使得设置的参数生效。 - -**表 3** 系统支持的最大进程数设置 - - - - - - - - - - - - - - -

参数名

-

说明

-

预安装时是否由脚本自动设置

-

推荐取值

-

* soft nproc

-

soft nproc参数用来限制每个用户的最大processes数量。

-

-

60000

-
- -## 网卡参数配置 - -**表 4** 网卡参数配置 - - - - - - - - - - - - - - - - - - - - - - - - -

参数名

-

说明

-

预安装时是否由脚本自动设置

-

推荐取值

-

rx

-

网卡接收队列长度设置

-

-

4096

-

tx

-

网卡传送队列长度设置

-

-

4096

-

mtu

-

网卡最大传输单元设置

-

-

x86是1500

-

ARM是8192

-
- ->![](public_sys-resources/icon-notice.gif) **须知:** ->- 网卡参数配置功能只针对万兆及万兆以上级别的业务网卡。即backIp1所绑定的网卡。 ->- 设置网卡参数的命令只有在设置成功后,才会被写入系统启动文件。执行失败的信息会被记入后台日志中。 - diff --git "a/content/zh/docs/installation/\351\205\215\347\275\256\346\225\260\346\215\256\345\272\223\344\270\273\350\212\202\347\202\271\344\277\241\346\201\257.md" "b/content/zh/docs/installation/\351\205\215\347\275\256\346\225\260\346\215\256\345\272\223\344\270\273\350\212\202\347\202\271\344\277\241\346\201\257.md" deleted file mode 100644 index 11ee8175c4aa35db028e516c7baea2485bceb81c..0000000000000000000000000000000000000000 --- "a/content/zh/docs/installation/\351\205\215\347\275\256\346\225\260\346\215\256\345\272\223\344\270\273\350\212\202\347\202\271\344\277\241\346\201\257.md" +++ /dev/null @@ -1,77 +0,0 @@ -# 配置数据库主节点信息 - -加粗字体内容为示例,可自行替换。每行信息均有注释进行说明。 - -**数据库主节点配置以下信息。** - -``` - - - - - - - - -``` - -**表 1** 参数说明 - - - - - - - - - - - - - - - - - - - - - -

实例类型

-

参数

-

说明

-

DBnode

-

dataNum

-

当前主机上需要部署的数据库节点个数。

-

dataPortBase

-

数据库节点的基础端口号,默认值40000。

-

dataNode1

-

用于指定当前主机上的数据库节点的数据存储目录。此目录为数据库的数据存储目录。应规划到数据盘上。

-

dataNode1_syncNum

-

可选参数,用于指定当前集群中同步模式的节点数目。取值范围为0~数据库备机节点数。

-
- -**表 2** 数据库实例数据目录 - - - - - - - - - - - - - -

实例名称

-

实例数据目录

-

主DBnode

-

/opt/huawei/install/data/xxx

-

其中,xxx为当前主DBnode的名称。

-

备DBnode

-

/opt/huawei/install/data/slaveX

-

其中,slaveX为当前备DBnode的名称。

-
- diff --git "a/content/zh/docs/installation/\351\205\215\347\275\256\346\225\260\346\215\256\345\272\223\345\220\215\347\247\260\345\217\212\345\220\204\351\241\271\347\233\256\345\275\225.md" "b/content/zh/docs/installation/\351\205\215\347\275\256\346\225\260\346\215\256\345\272\223\345\220\215\347\247\260\345\217\212\345\220\204\351\241\271\347\233\256\345\275\225.md" deleted file mode 100644 index d472e449640d238506f401d992d6c399822cb271..0000000000000000000000000000000000000000 --- "a/content/zh/docs/installation/\351\205\215\347\275\256\346\225\260\346\215\256\345\272\223\345\220\215\347\247\260\345\217\212\345\220\204\351\241\271\347\233\256\345\275\225.md" +++ /dev/null @@ -1,106 +0,0 @@ -# 配置数据库名称及各项目录 - -在script/gspylib/etc/conf/cluster\_config\_template.xml获取XML文件模板。加粗字体内容为示例,可自行替换。每行信息均有注释进行说明。 - -``` - - - - - - - - - - - - - - - - - - - - - - - -``` - ->![](public_sys-resources/icon-notice.gif) **须知:** ->- “/opt/huawei/install/om”存放互信等工具,避免权限问题,不要把实例数据目录放在此目录下。 ->- 安装目录和数据目录需为空或者不存在,否则可能导致安装失败。 ->- 在对数据库节点的实例进行具体配置时,需确保配置的目录之间不相互耦合。即各个配置目录不关联,删除其中任意一个目录,不会级联删除其它目录。如gaussdbAppPath为"/opt/huawei/install/app",gaussdbLogPath为"/opt/huawei/install/app/omm"。当gaussdbAppPath目录被删除时,会级联删除gaussdbLogPath目录,从而引起其它问题。 ->- 若需要安装脚本自动创建安装用户时各配置的目录需保证不与系统创建的默认用户目录耦合关联。 ->- 配置openGauss路径和实例路径时,路径中不能包含"|",";","&","$","<","\>","\`","\\\\","'","\\"","\{","\}","\(","\)","\[","\]","\~","\*","?"特殊字符。 ->- 配置数据库节点名称时,请通过hostname命令获取数据库节点的主机名称,替换示例中的node1,node2。 - -**表 1** 参数说明 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

实例类型

-

参数

-

说明

-

整体信息

-

clusterName

-

openGauss名称。

-

nodeNames

-

openGauss中主机名称。

-

backIp1s

-

主机在后端存储网络中的IP地址(内网IP)。所有openGauss主机使用后端存储网络通讯。

-

gaussdbAppPath

-

openGauss程序安装目录。此目录应满足如下要求:

-
  • 磁盘空间>1GB
  • 与数据库所需其它路径相互独立,没有包含关系。
-

gaussdbLogPath

-

openGauss运行日志和操作日志存储目录。此目录应满足如下要求:

-
  • 磁盘空间建议根据主机上的数据库节点数规划。数据库节点预留1GB空间的基础上,再适当预留冗余空间。
  • openGauss所需其它路径相互独立,没有包含关系。
-

此路径可选。不指定的情况下,openGauss安装时会默认指定“$GAUSSLOG/安装用户名”作为日志目录。

-

tmpdbPath

-

数据库临时文件存放目录。

-

若不配置tmpdbPath,默认存放在/opt/huawei/wisequery/perfadm_db目录下。

-

gaussdbToolPath

-

openGauss系统工具目录,主要用于存放互信工具等。此目录应满足如下要求:

-
  • 磁盘空间>100MB
  • 固定目录,与数据库所需其它目录相互独立,没有包含关系。
-

此目录可选。不指定的情况下,openGauss安装时会默认指定“/opt/huawei/wisequery”作为数据库系统工具目录。

-

corePath

-

openGauss core文件的指定目录。

-

clusterType

-

openGauss类型,openGauss拓扑类型;可选字段。

-

“single-inst”表示单机一主多备部署形态。

-
- diff --git "a/content/zh/docs/installation/\357\274\210\345\217\257\351\200\211\357\274\211\350\256\276\347\275\256\345\244\207\346\234\272\345\217\257\350\257\273.md" "b/content/zh/docs/installation/\357\274\210\345\217\257\351\200\211\357\274\211\350\256\276\347\275\256\345\244\207\346\234\272\345\217\257\350\257\273.md" index 445845a305a0245a2a1af31fa0aa71fb1741782a..d09a2ddc509ba50fcb4d6e70bbf6ff5562fa458c 100644 --- "a/content/zh/docs/installation/\357\274\210\345\217\257\351\200\211\357\274\211\350\256\276\347\275\256\345\244\207\346\234\272\345\217\257\350\257\273.md" +++ "b/content/zh/docs/installation/\357\274\210\345\217\257\351\200\211\357\274\211\350\256\276\347\275\256\345\244\207\346\234\272\345\217\257\350\257\273.md" @@ -1,10 +1,10 @@ -# (可选)设置备机可读 - -备机可读特性为可选特性,需要修改配置参数并重启主备机器后才能使用。在开启备机可读之后,备机将支持读操作,并满足数据一致性要求。 - -## 操作步骤 - -1. 如果主备机上的openGauss数据库实例正在运行,请先分别停止主备机上的数据库实例。 -2. 根据[表2](配置数据库主节点信息.md#zh-cn_topic_0241802596_table15838192510429)对应路径,分别打开主机与备机的postgres.conf配置文件,找到并将对应参数修改为:wal\_level=hot\_standby;hot\_standby = on;hot\_standby\_feedback = on。 -3. 修改完成后,分别启动主备机即可。 - +# (可选)设置备机可读 + +备机可读特性为可选特性,需要修改配置参数并重启主备机器后才能使用。在开启备机可读之后,备机将支持读操作,并满足数据一致性要求。 + +## 操作步骤 + +1. 如果主备机上的openGauss数据库实例正在运行,请先分别停止主备机上的数据库实例。 +2. 分别打开主机与备机的postgres.conf配置文件,找到并将对应参数修改为:wal\_level=hot\_standby;hot\_standby = on;hot\_standby\_feedback = on。 +3. 修改完成后,分别启动主备机即可。 + diff --git a/content/zh/menu/index.md b/content/zh/menu/index.md index 2bffe7feebbe170ef1270d9fce0e3a73bde51219..2c99a48c40d6271531b044973664c697d2960e2b 100644 --- a/content/zh/menu/index.md +++ b/content/zh/menu/index.md @@ -133,36 +133,15 @@ headless: true - [了解安装流程]({{< relref "./docs/Installation/了解安装流程.md" >}}) - [获取安装包]({{< relref "./docs/Installation/获取安装包.md" >}}) - [准备软硬件安装环境]({{< relref "./docs/Installation/准备软硬件安装环境.md" >}}) - - [软硬件环境要求]({{< relref "./docs/Installation/软硬件环境要求.md" >}}) - - [修改操作系统配置]({{< relref "./docs/Installation/修改操作系统配置.md" >}}) - - [关闭操作系统防火墙]({{< relref "./docs/Installation/关闭操作系统防火墙.md" >}}) - - [设置字符集参数]({{< relref "./docs/Installation/设置字符集参数.md" >}}) - - [设置时区和时间]({{< relref "./docs/Installation/设置时区和时间.md" >}}) - - [关闭swap交换内存]({{< relref "./docs/Installation/关闭swap交换内存.md" >}}) - - [设置网卡MTU值]({{< relref "./docs/Installation/设置网卡MTU值.md" >}}) - - [配置操作系统参数]({{< relref "./docs/Installation/配置操作系统参数.md" >}}) - - [设置root用户远程登录]({{< relref "./docs/Installation/设置root用户远程登录.md" >}}) - [了解安装用户及用户组]({{< relref "./docs/Installation/了解安装用户及用户组.md" >}}) - [安装openGauss]({{< relref "./docs/Installation/安装openGauss.md" >}}) - [创建XML配置文件]({{< relref "./docs/Installation/创建XML配置文件.md" >}}) - - [配置数据库名称及各项目录]({{< relref "./docs/Installation/配置数据库名称及各项目录.md" >}}) - - [配置Host基本信息]({{< relref "./docs/Installation/配置Host基本信息.md" >}}) - - [配置数据库主节点信息]({{< relref "./docs/Installation/配置数据库主节点信息.md" >}}) - - [示例]({{< relref "./docs/Installation/示例.md" >}}) - - [单节点配置文件]({{< relref "./docs/Installation/单节点配置文件.md" >}}) - - [一主一备配置文件]({{< relref "./docs/Installation/一主一备配置文件.md" >}}) - [初始化安装环境]({{< relref "./docs/Installation/初始化安装环境.md" >}}) - - [准备安装用户及环境]({{< relref "./docs/Installation/准备安装用户及环境.md" >}}) - - [手工建立互信]({{< relref "./docs/Installation/手工建立互信.md" >}}) - [执行安装]({{< relref "./docs/Installation/执行安装.md" >}}) + - [初始化数据库]({{< relref "./docs/Installation/初始化数据库.md" >}}) - [(可选)设置备机可读]({{< relref "./docs/Installation/(可选)设置备机可读.md" >}}) - [安装验证]({{< relref "./docs/Installation/安装验证.md" >}}) - - [检查健康状态]({{< relref "./docs/Installation/检查健康状态.md" >}}) - [卸载openGauss]({{< relref "./docs/Installation/卸载openGauss.md" >}}) - - [执行卸载]({{< relref "./docs/Installation/执行卸载.md" >}}) - - [一键式环境清理]({{< relref "./docs/Installation/一键式环境清理.md" >}}) - - [初始配置]({{< relref "./docs/Installation/初始配置.md" >}}) - - [配置区域和字符集]({{< relref "./docs/Installation/配置区域和字符集.md" >}}) - [管理员指南]({{< relref "./docs/Administratorguide/Administratorguide.md" >}}) - [启停openGauss]({{< relref "./docs/Administratorguide/启停openGauss.md" >}})