一、系统环境优化 1.1 关闭SElinux # 修改配置文件cat /etc/selinux/config | grep -i SELINUXSELINUX=disabled# 关闭SELINUXsetenforce 0 1.2 内
# 修改配置文件cat /etc/selinux/config | grep -i SELINUXSELINUX=disabled# 关闭SELINUXsetenforce 0
vi /etc/sysctl.conf 添加# panweidbnet.ipv4.tcp_max_tw_buckets = 10000net.ipv4.tcp_tw_reuse = 1net.ipv4.tcp_keepalive_time = 30net.ipv4.tcp_keepalive_probes = 9net.ipv4.tcp_keepalive_intvl = 30net.ipv4.tcp_retries1 = 5net.ipv4.tcp_syn_retries = 5net.ipv4.tcp_synack_retries = 5net.ipv4.tcp_retries2 = 12vm.overcommit_memory = 0net.ipv4.tcp_rmem = 8192 250000 16777216net.ipv4.tcp_wmem = 8192 250000 16777216net.core.wmem_max = 21299200net.core.rmem_max = 21299200net.core.wmem_default = 21299200net.core.rmem_default = 21299200net.ipv4.ip_local_port_range = 26000 65535kernel.sem = 250 6400000 1000 25600net.core.somaxconn = 65535net.ipv4.tcp_syncookies = 1net.core.netdev_max_backlog = 65535net.ipv4.tcp_max_syn_backlog = 65535net.ipv4.tcp_fin_timeout = 60kernel.shmall = 1073741824 kernel.shmmax = 751619276800 net.ipv4.tcp_sack = 1net.ipv4.tcp_timestamps = 1vm.extfrag_threshold = 500vm.overcommit_ratio = 90vm.swappiness = 0# 生效sysctl -p注意事项:
vi /etc/security/limits.conf 添加# panweidb* soft nofile 1000000* hard nofile 1000000* soft nproc 655360* hard nproc 655360* soft memlock unlimited* hard memlock unlimited* soft core unlimited* hard core unlimited* soft stack unlimited* hard stack unlimited
groupadd -g 1101 dbgrpuseradd -g dbgrp -u 1101 -m ommecho 'O2********1!'|passwd --stdin omm创建目录mkdir -p /opt/panweidb
注意事项:1)libnsl 包在BCLinux8.2 系统中需要安装。Centos7 环境和 BC-Linux7.6、BC-Linux7.8环境中不用安装yum -y install libaio-devel flex bison ncurses-devel glibc-devel patch redhat-lsb-core readline-devel python3 expect* bzip2 libnsl GCc gcc-c++ zlib-devel ncurses-devel expect
检查python3下载地址:https://www.python.org/ftp/python/3.6.9/Python-3.6.9.tgz# 检查 python3 版本,如果为 Python 3.6.9 则满足要求,如果不满足则需进行编译安装python3 --version[root@work2 yum.repos.d]# python3 --versionPython 3.6.8[root@work2 yum.repos.d]# # 从下载安装包tar -zxf Python-3.6.9.tgzcd Python-3.6.9./configure --prefix=/opt/python/Python-3.6.9 --enable-shared --enable-optimizations --with-sslmake -j 12 && make installln -s /opt/python/Python-3.6.9/bin/python3 /usr/bin/python3ln -s /opt/python/Python-3.6.9/bin/python3.6-config /usr/bin/python3-configcp /opt/python/Python-3.6.9/lib/libpython3.6m.so.1.0 /usr/lib64chmod -R 755 /usr/lib64/libpython3.6m.so.1.0ln -s /usr/lib64/libpython3.6m.so.1.0 /usr/lib64/libpython3.6m.socat >> /etc/profile <<-EOFexport Python_HOME=/opt/python/Python-3.6.9export PATH=$PYTHON_HOME/bin:$PATHEOFsource /etc/profile
使用omm用户登录到openGauss包安装的主机,解压openGauss压缩包到安装目录(假定安装目录为/opt/panweidb/soft,请用实际值替换)。
tar -xf PanWeiDB_1.0.0_CentOS7_x86.tar.gztar -jxf PanWeiDB-1.0.0-CentOS-64bit.tar.bz2 -C /opt/panweidb/soft
假定解压包的路径为/opt/panweidb/soft,进入解压后目录下的simpleInstall。
cd /opt/panweidb/soft/simpleInstall
执行install.sh脚本安装openGauss。
sh install.sh -w "强密码" && source ~/.bashrc
上述命令中,-w是指初始化数据库密码(gs_initdb指定),安全需要必须设置。
安装执行完成后,使用ps和gs_ctl查看进程是否正常。
ps ux | grep gaussdbgs_ctl query -D /opt/panweidb/soft/data/single_node
执行ps命令,显示类似如下信息:
[omm@work2 simpleInstall]$ ps ux | grep gaussdbomm 1576 4.5 2.7 3029804 444624 ? Ssl 11:13 0:04 /opt/panweidb/soft/bin/gaussdb -D /opt/panweidb/soft/data/single_nodeomm 2591 0.0 0.0 110492 904 pts/1 S+ 11:15 0:00 grep --color=auto gaussdb[omm@work2 simpleInstall]$ gs_ctl query -D /opt/panweidb/soft/data/single_node[2023-05-24 11:16:55.542][3360][][gs_ctl]: gs_ctl query ,datadir is /opt/panweidb/soft/data/single_node HA state: local_role : NORMal static_connections : 0 db_state : Normal detail_information : Normal Senders info: No information Receiver info: No information [omm@work2 simpleInstall]$ 连接数据库[omm@work2 ~]$ gsql -d postgresgsql ((PanWeiDB(openGauss) 1.0.0 build 9a7e96bc) compiled at 2022-10-15 20:54:36 commit 0 last mr )Non-SSL connection (SSL connection is recommended when requiring high-security)Type "help" for help.PanWeiDB=#
a.创建用户USERCREATE USER testza IDENTIFIED BY 'she********sa';b. 使用如下命令创建一个新的表空间testzaq_tbs,并将表空间escspdb_tbs授权给用户testzaq CREATE TABLESPACE testza_tbs OWNER testza RELATIVE LOCATION 'tablespace/testza_tbs1';c. 使用如下命令创建一个新的数据库escspdb,放在使用escspdb_tbs表空间中。CREATE DATABASE testza WITH TABLESPACE = testza_tbs;d.授权用户testza访问数据库testzagrant all privileges on database testza to testza;e.使用以下命令为数据库设置默认的模式搜索路径。ALTER DATABASE testza SET search_path TO pa_catalog,public;f.使用如下命令修改数据库表空间ALTER DATABASE testza SET TABLESPACE testza_tbs;g.测试数据库连接gsql -d testza -U testza -W 'she********sa' -r
在PostgreSQL数据库目录下的编辑postgresql.conf,修改passWord_encryption_type 为1,同时支持md5和sha256
password_encryption_type = 1
在PostgreSQL数据库目录下的postgresql.conf文件更改此项参数,并且重启数据库生效
listen_addresses = '*'
host all all 10.1.161.184/32 sha256
参考:单节点服务器安装单节点服务器安装 创建用户组dbgroup。groupadd dbgroup 创建用户组dbgroup下的普通用户omm,并设置普通用户omm的密码,密码建议设置为omm@123。useradd -g dbgroup omm passwd omm 使用omm用户登录到openGauss包安装的主机,解压openGauss压缩包到安装目录(假定安装目录为/opt/software/openGauss,请用实际值替换)。tar -jxf openGauss-x.x.x-操作系统-64bit.tar.bz2 -C /opt/software/openGauss 假定解压包的路径为/opt/software/openGauss,进入解压后目录下的simpleInstall。cd /opt/software/openGauss/simpleInstall 执行install.sh脚本安装openGauss。sh install.sh -w xxxx 上述命令中,-w是指初始化数据库密码(gs_initdb指定),安全需要必须设置。安装执行完成后,使用ps和gs_ctl查看进程是否正常。ps ux | grep gaussdb gs_ctl query -D /opt/software/openGauss/data/single_node 执行ps命令,显示类似如下信息:omm 24209 11.9 1.0 1852000 355816 pts/0 Sl 01:54 0:33 /opt/software/openGauss/bin/gaussdb -D /opt/software/openGauss/single_node omm 20377 0.0 0.0 119880 1216 pts/0 S+ 15:37 0:00 grep --color=auto gaussdb 执行gs_ctl命令,显示类似如下信息:gs_ctl query ,datadir is /opt/software/openGauss/data/single_node HA state: local_role : Normal static_connections : 0 db_state : Normal detail_information : Normal Senders info: No information Receiver info: No information https://docs.opengauss.org/zh/docs/5.0.0/docs/GettingStarted/单节点服务器安装.html
来源地址:https://blog.csdn.net/qyq88888/article/details/130849041
--结束END--
本文标题: 磐维数据库panweidb单节点服务器在centos7.9安装(研发环境)
本文链接: https://lsjlt.com/news/395912.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0