- VisualStudio2022插件的安装及使用-编程手把手系列文章
- pprof-在现网场景怎么用
- C#实现的下拉多选框,下拉多选树,多级节点
- 【学习笔记】基础数据结构:猫树
项目 | 内容 |
---|---|
操作系统 | CentOS7.6 |
IP | 192.168.4.201 |
主机名 | opgs201 |
CPU | 8core |
内存 | 16GB |
磁盘1 | 100GB |
创建一个虚拟机 。
安装操作系统,选择带GUI的安装 。
安装python3,因为这个新装的centos7.6是没有自带python3的,这里我建议安装python3.6就够 。
先挂载光盘iso 。
##挂载虚拟机的光盘
mount /dev/cdrom /mnt
#备份原来的yum文件
cd /etc/yum.repos.d
mkdir bk
mv *.repo bk/
##创建一个repo
echo "[EL]" >> /etc/yum.repos.d/linux7.repo
echo "name =LINUX7.DVD" >> /etc/yum.repos.d/linux7.repo
echo "baseurl=file:///mnt" >> /etc/yum.repos.d/linux7.repo
echo "gpgcheck=0" >> /etc/yum.repos.d/linux7.repo
echo "enabled=1" >> /etc/yum.repos.d/linux7.repo
可以参考我的这篇文章,就是为了适配安装openGauss而安装python3的 。
https://www.cnblogs.com/su1999/p/18459499 。
安装好之后,安装下面openGauss需要的依赖包(有些在上面安装python3时安装了) 。
yum install -y lksctp*
yum install -y java-1.8.0-openjdk*
yum install -y psmisc
yum install -y bzip2
yum install -y libaio-devel
yum install -y flex bison ncurses-devel glibc-devel patch readline-devel redhat-lsb-core libnsl
echo "192.168.4.201 opgs201" >> /etc/hosts
systemctl disable firewalld.service
systemctl stop firewalld.service
sed -i 's/^SELINUX=.*/SELINUX=disabled/' /etc/selinux/config
cat /etc/selinux/config|grep SELINUX=
echo "export LANG=en_US.UTF-8" >> /etc/profile
source /etc/profile
这里可以使用脚本快速完成 。
sed -i '/PermitRootLogin/s/^/#/' /etc/ssh/sshd_config
sed -i '/Banner/s/^/#/' /etc/ssh/sshd_config
echo -e "\n" >> /etc/ssh/sshd_config
echo "PermitRootLogin yes" >> /etc/ssh/sshd_config
echo "Banner none " >> /etc/ssh/sshd_config
systemctl restart sshd.service
在生产环境可以使用NTP或者chrony来同步服务器的时间 。
rm -rf /etc/localtime
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
关闭swap可以提升性能 。
sed -i '/swap/s/^/#/' /etc/fstab
cat /etc/fstab
swapoff -a
cat >> /etc/sysctl.conf << EOF
net.ipv4.tcp_retries1 = 5
net.ipv4.tcp_syn_retries = 5
net.ipv4.tcp_fin_timeout = 60
EOF
sysctl -p
临时关闭透明页 。
echo never > /sys/kernel/mm/transparent_hugepage/enabled
echo never > /sys/kernel/mm/transparent_hugepage/defrag
写进开机文件,永久生效 。
cat >> /etc/rc.d/rc.local <<EOF
if test -f /sys/kernel/mm/transparent_hugepage/enabled; then
echo never > /sys/kernel/mm/transparent_hugepage/enabled
fi
if test -f /sys/kernel/mm/transparent_hugepage/defrag; then
echo never > /sys/kernel/mm/transparent_hugepage/defrag
fi
EOF
##生效
chmod +x /etc/rc.d/rc.local
这一步是可选的 。
systemctl set-default multi-user.target
yum install -y lksctp*
yum install -y java-1.8.0-openjdk*
yum install -y psmisc
yum install -y bzip2
yum install -y libaio-devel
yum install -y flex bison ncurses-devel glibc-devel patch readline-devel redhat-lsb-core libnsl
echo "192.168.4.201 opgs201" >> /etc/hosts
systemctl disable firewalld.service
systemctl stop firewalld.service
sed -i 's/^SELINUX=.*/SELINUX=disabled/' /etc/selinux/config
echo "export LANG=en_US.UTF-8" >> /etc/profile
source /etc/profile
sed -i '/PermitRootLogin/s/^/#/' /etc/ssh/sshd_config
sed -i '/Banner/s/^/#/' /etc/ssh/sshd_config
echo -e "\n" >> /etc/ssh/sshd_config
echo "PermitRootLogin yes" >> /etc/ssh/sshd_config
echo "Banner none " >> /etc/ssh/sshd_config
systemctl restart sshd.service
rm -rf /etc/localtime
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
sed -i '/swap/s/^/#/' /etc/fstab
swapoff -a
cat >> /etc/sysctl.conf << EOF
net.ipv4.tcp_retries1 = 5
net.ipv4.tcp_syn_retries = 5
net.ipv4.tcp_fin_timeout = 60
EOF
sysctl -p
echo never > /sys/kernel/mm/transparent_hugepage/enabled
echo never > /sys/kernel/mm/transparent_hugepage/defrag
cat >> /etc/rc.d/rc.local <<EOF
if test -f /sys/kernel/mm/transparent_hugepage/enabled; then
echo never > /sys/kernel/mm/transparent_hugepage/enabled
fi
if test -f /sys/kernel/mm/transparent_hugepage/defrag; then
echo never > /sys/kernel/mm/transparent_hugepage/defrag
fi
EOF
##生效
chmod +x /etc/rc.d/rc.local
systemctl set-default multi-user.target
echo -e "\n"
reboot
这里先手动创建用户与组 。
groupadd dbgrp
useradd -g dbgrp omm
### 密码Gauss@1234 需要有一定的福再度
echo Gauss@1234 | passwd --stdin omm
创建目录 。
##放置软件包的目录
mkdir -p /opt/software/openGauss
chmod 755 -R /opt/software/openGauss
##openGauss数据库的目录,注意需要保持空目录,不然安装会错误
##
mkdir -p /openGauss/
chmod -R 755 /openGauss
chown -R omm:dbgrp /openGauss/
把安装包上传到/opt/software/openGauss/目录下,解压 。
/opt/software/openGauss/
tar -zxvf openGauss-5.0.3-CentOS-64bit-all.tar.gz
tar -zxvf openGauss-5.0.3-CentOS-64bit-om.tar.gz
示例:
[root@opgs201 ~]# cd /opt/software/openGauss/
[root@opgs201 openGauss]# tar -zxvf openGauss-5.0.3-CentOS-64bit-all.tar.gz
openGauss-5.0.3-CentOS-64bit-cm.tar.gz
openGauss-5.0.3-CentOS-64bit-om.tar.gz
openGauss-5.0.3-CentOS-64bit.tar.bz2
openGauss-5.0.3-CentOS-64bit-cm.sha256
openGauss-5.0.3-CentOS-64bit-om.sha256
openGauss-5.0.3-CentOS-64bit.sha256
upgrade_sql.tar.gz
upgrade_sql.sha256
解压后有这些文件 。
[root@opgs201 soft]# ls -l
total 264712
-rw-r--r-- 1 root root 134969411 Oct 9 23:42 openGauss-5.0.3-CentOS-64bit-all.tar.gz
-rw-r--r-- 1 root root 105 Jul 31 21:15 openGauss-5.0.3-CentOS-64bit-cm.sha256
-rw-r--r-- 1 root root 22528084 Jul 31 21:15 openGauss-5.0.3-CentOS-64bit-cm.tar.gz
-rw-r--r-- 1 root root 65 Jul 31 21:14 openGauss-5.0.3-CentOS-64bit-om.sha256
-rw-r--r-- 1 root root 11973852 Jul 31 21:14 openGauss-5.0.3-CentOS-64bit-om.tar.gz
-rw-r--r-- 1 root root 65 Jul 31 21:15 openGauss-5.0.3-CentOS-64bit.sha256
-rw-r--r-- 1 root root 101064032 Jul 31 21:15 openGauss-5.0.3-CentOS-64bit.tar.bz2
-rw------- 1 root root 65 Jul 31 21:13 upgrade_sql.sha256
-rw------- 1 root root 502230 Jul 31 21:13 upgrade_sql.tar.gz
再解压里面的这个 。
[root@opgs201 openGauss]# tar -zxvf openGauss-5.0.3-CentOS-64bit-om.tar.gz
我这个是单节点的,所以准备单节点的xml,这个文件配在哪里呢?
配在软件目录下 。
cd /opt/software/openGauss/
vi cluster_config.xml
或者直接cat 。
cat >> /opt/software/openGauss/cluster_config.xml << EOF
<?xml version="1.0" encoding="UTF-8"?>
<ROOT>
<CLUSTER>
<PARAM name="clusterName" value="dbCluster" />
<!-- 这里输入自己的主机名 -->
<PARAM name="nodeNames" value="opgs201" />
<!-- 数据库安装目录-->
<PARAM name="gaussdbAppPath" value="/openGauss/app" />
<!-- 日志目录-->
<PARAM name="gaussdbLogPath" value="/openGauss/log/omm" />
<!-- 临时文件目录-->
<PARAM name="tmpMppdbPath" value="/openGauss/tmp" />
<!-- 数据库工具目录-->
<PARAM name="gaussdbToolPath" value="/openGauss/om" />
<!-- 数据库core文件目录-->
<PARAM name="corePath" value="/openGauss/corefile" />
<!-- 节点IP,与数据库节点名称列表一一对应 -->
<PARAM name="backIp1s" value="192.168.4.201"/>
</CLUSTER>
<!-- 每台服务器上的节点部署信息 -->
<DEVICELIST>
<!-- 节点1上的部署信息 -->
<DEVICE sn="node1_hostname">
<!-- 节点1的主机名称 -->
<PARAM name="name" value="opgs201"/>
<!-- 节点1所在的AZ及AZ优先级 -->
<PARAM name="azName" value="AZ1"/>
<PARAM name="azPriority" value="1"/>
<!-- 节点1的IP,如果服务器只有一个网卡可用,将backIP1和sshIP1配置成同一个IP -->
<PARAM name="backIp1" value="192.168.4.201"/>
<PARAM name="sshIp1" value="192.168.4.201"/>
<!--dbnode-->
<PARAM name="dataNum" value="1"/>
<PARAM name="dataPortBase" value="15400"/>
<PARAM name="dataNode1" value="/openGauss/data/dn"/>
<PARAM name="dataNode1_syncNum" value="0"/>
</DEVICE>
</DEVICELIST>
</ROOT>
EOF
看看这个 。
进入script目录 。
里面有很多脚本 。
[root@opgs201 soft]# cd script/
[root@opgs201 script]# ./gs
gs_backup gs_checkperf gs_expansion gs_postuninstall gs_sdr gs_uninstall
gs_check gs_collector gs_install gs_preinstall gs_ssh gs_upgradectl
gs_checkos gs_dropnode gs_om gspylib/ gs_sshexkey
[root@opgs201 script]# ls
base_diff gs_check gs_expansion gspylib gs_upgradectl os_platform ssh-agent
base_utils gs_checkos gs_install gs_sdr impl py_pstree.py ssh-copy-id
config gs_checkperf gs_om gs_ssh __init__.py scp ssh-keygen
domain_utils gs_collector gs_postuninstall gs_sshexkey killall ssh transfer.py
gs_backup gs_dropnode gs_preinstall gs_uninstall local ssh-add
执行其中的gs_preinstall检查脚本 。
[root@opgs201 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.
Setting host ip env
Successfully set host ip env.
Are you sure you want to create the user[omm] (yes/no)? yes
Preparing SSH service.
Successfully prepared SSH service.
Checking OS software.
Successfully check os software.
Checking OS version.
Successfully checked OS version.
Creating cluster's path.
Successfully created cluster's path.
Set and check OS parameter.
Setting OS parameters.
Successfully set OS parameters.
Warning: Installation environment contains some warning messages.
Please get more details by "/opt/software/openGauss/script/gs_checkos -i A -h opgs201 --detail".
Set and check OS parameter completed.
Preparing CRON service.
Successfully prepared CRON service.
Setting user environmental variables.
Successfully set user environmental variables.
Setting the dynamic link library.
Successfully set the dynamic link library.
Setting Core file
Successfully set core path.
Setting pssh path
Successfully set pssh path.
Setting Cgroup.
Successfully set Cgroup.
Set ARM Optimization.
No need to set ARM Optimization.
Fixing server package owner.
Setting finish flag.
Successfully set finish flag.
Preinstallation succeeded.
[root@opgs201 script]#
现在有了omm用户了,程序会写进一下环境变量 。
[root@opgs201 script]# su - omm
Last login: Sun Oct 13 08:45:28 CST 2024
[omm@opgs201 ~]$ cat .bashrc
# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# Uncomment the following line if you don't like systemctl's auto-paging feature:
# export SYSTEMD_PAGER=
# User specific aliases and functions
export GPHOME=/openGauss/om
export PATH=$GPHOME/script/gspylib/pssh/bin:$GPHOME/script:$PATH
export LD_LIBRARY_PATH=$GPHOME/lib:$LD_LIBRARY_PATH
export PYTHONPATH=$GPHOME/lib
export GAUSSHOME=/openGauss/app
export PATH=$GAUSSHOME/bin:$PATH
export LD_LIBRARY_PATH=$GAUSSHOME/lib:$LD_LIBRARY_PATH
export S3_CLIENT_CRT_FILE=$GAUSSHOME/lib/client.crt
export GAUSS_VERSION=5.0.3
export PGHOST=/openGauss/tmp
export GAUSSLOG=/openGauss/log/omm/omm
umask 077
export GAUSS_ENV=1
使用omm用户安装 。
[omm@opgs201 ~]$ 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 cipher 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 /openGauss/app/share/sslcert/om
NO cm_server instance, no need to create CA for CM.
Non-dss_ssl_enable, no need to create CA for DSS
Cluster installation is completed.
Configuring.
Deleting instances from all nodes.
Successfully deleted instances from all nodes.
Checking node configuration on all nodes.
Initializing instances on all nodes.
Updating instance configuration on all nodes.
Check consistence of memCheck and coresCheck on database nodes.
Configuring pg_hba on all nodes.
Configuration is completed.
The cluster status is Normal.
Successfully started cluster.
Successfully installed application.
end deploy..
echo "export PGDATABASE=postgres" >> ~/.bashrc、
echo "export PGDATA=/openGauss/data/dn" >> ~/.bashrc
echo "export PGPORT=15400" >> ~/.bashrc
echo "alias gsql='gsql -r'" >> ~/.bashrc
echo "alias dba='gsql -d postgres -p 15400'" >> ~/.bashrc
source ~/.bash_profile
执行gsql命令就能进去了 。
[omm@opgs201 ~]$ dba
gsql ((openGauss 5.0.3 build 89d144c2) compiled at 2024-07-31 20:59:31 commit 0 last mr )
Non-SSL connection (SSL connection is recommended when requiring high-security)
Type "help" for help.
openGauss=# select version();
version
---------------------------------------------------------------------------------------------------------------------------------------
---------------
(openGauss 5.0.3 build 89d144c2) compiled at 2024-07-31 20:59:31 commit 0 last mr on x86_64-unknown-linux-gnu, compiled by g++ (GCC)
7.3.0, 64-bit
(1 row)
停止 。
[omm@opgs201 ~]$ gs_om -t stop
Stopping cluster.
=========================================
Successfully stopped cluster.
=========================================
End stop cluster.
最后此篇关于最详细CentOS7.6安装openGauss5.0.3教程的文章就讲到这里了,如果你想了解更多关于最详细CentOS7.6安装openGauss5.0.3教程的内容请搜索CFSDN的文章或继续浏览相关文章,希望大家以后支持我的博客! 。
目录 进程 其他相关概念 创建线程的两种方式 为什么使用start()方法而不直接使用run()方法 start()方法底层
CURL状态码列表 状态码 状态原因 解释 0 正常访问
ODBC连接类函数 odbc_connect函数:打开一个ODBC连接 odbc_close函数:关闭一个已经打开的ODBC连接 odbc_close_all函数:关闭所有已经打开的ODBC连
作为标题,如何计算从纪元1900到现在使用boost的持续时间? 编辑:很抱歉以前的问题太短。我将再次描述我的问题。 我有关于将生日另存为整数的问题。我创建了四个函数,用法如下: ptime转换为整数
前言 在Java中,有一个常被忽略 但 非常重要的关键字Synchronized今天,我将详细讲解 Java关键字Synchronized的所有知识,希望你们会喜欢 目录 1. 定义 J
详细 JVM 垃圾收集日志的时间戳是收集的开始还是结束? 2016-08-09T21:04:19.756-0400: 224890.317: [GC Desired survivor size 167
我在“Master-Detail”概念上苦苦挣扎,除了一点点(但很重要)的细微差别外,几乎所有东西都按预期工作。我应该在 Storyboard上更改什么以在详细信息 View (屏幕截图底部的右上角)
我希望能够显示表格的详细 View ,但不推送新屏幕,而只显示表格所在的详细 View 。 设置它的最佳方式是什么......如果真的可行的话? ---------------------------
我在我的博客中为我的帖子使用了详细 View ,每篇帖子都有评论,所以我想对它们进行分页,但我不知道该怎么做,因为我请求了帖子模型。我知道如何在功能 View 中执行此操作,但不知道如何在详细 Vie
在下面的代码中,与 pm 对齐,该行是否会 move 整个内存并将其分配给 pm,或者它只会 move p 指向的内存而不是整个数组? int main() { int*
1·下载 https://dev.mysql.com/downloads/mysql/ 2·安装服务 1)管理员运行cmd 2)D: 3)cd D:\mysql
今天以前一直用的SQL Server 2005做开发,偶尔也用MySQL,现入手公司项目,用到SQL Server 2008,于是乎必须安装它,免得出现其他很纠结的小问题,现将自己安装图解分享如下:
1. crontab命令选项 复制代码 代码如下: #crontab -u <-l, -r, -e> -u指定一个用
我们有一个 WPF 应用程序,它有一个主窗口/详细信息窗口,两者都是 WPF 数据网格。当您在上部数据网格中选择一行时,详细信息将显示在下部数据网格中。我想知道从 UI 的角度来看是否有任何关于如何处
在可视化 Perforce 客户端 (p4v) 中有一个选项: 显示文件操作的 p4 命令输出 启用后,在日志 Pane 中,我可以看到这样的详细日志记录: p4 sync /Users/az/ftp
在其他服务器上设置测试环境后,在几个API调用中出现错误。 99%肯定这是MySQL的事情,但是返回的错误根本没有帮助: global name 'sys' is not defined" 我已经导入
我正在维护一个通用的 iOS 应用程序,其开发已开始于 iOS 6。我正在为 iOS 7 更新 UI。现在我遇到了应用程序的 iPad 部分的奇怪问题。这部分遵循使用 UISplitViewContr
我希望我能正确描述这种情况。当它发生时很容易在屏幕上看到,但很难用语言解释,但我会尽力而为。 我有一个带有固定主视图 (UITableView) 和两个详细 View 之一的 UISplitViewC
我尝试在 eclipse 和 intelliJ 参数中使用垃圾收集记录器来配置简单的测试程序。尝试了不同类型的配置,但尚未创建日志文件。 -XX:+PrintGCDetails -XX:+PrintG
正如您所知,.cap 文件中的 java 小程序的输出文件格式必须通过智能卡读卡器/写卡器(如 ACR122 或任何其他读卡器)部署到 java 卡,而且我相信 java 卡与 java 卡之间的部署
我是一名优秀的程序员,十分优秀!