零基础学习openGauss入门技术部署篇【华为根技术】
1、 去官网下载
https://opengauss.org/zh/download/
2、 将压缩包上传到linux服务器
3、 创建用户目录,及解压压缩包到用户目录
由于压缩包解压之后,就是数据库文件,所以要建立一个mygaosi.
[root@server1 ~]# mkdir -p /app/tools/mygaosi
[root@server1 ~]# tar -xzf openGauss-Lite-6.0.1-CentOS7-x86_64.tar.gz -C /app/tools/mygaosi/
4、 关闭防火墙和配置 SELinux 为 disabled
[root@server1 ~]# systemctl stop firewalld
firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
Active: inactive (dead)
Docs: man:firewalld(1)
[root@server1 ~]# #查看临时selinux,权限
[root@server1 ~]# getenforce
# 临时禁用 SELinux(无需重启)
$ sudo setenforce 0
# 修改 SELinux 配置文件(重启后生效)
$ sudo vi /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled
#重启指令
reboot
5、 数据库需要特定的用户来进行安装,所以必须提前创建用户
useradd -m -s /bin/bash gauss
passwd gauss
su - gauss
o useradd:创建一个新的系统用户 gauss,设置默认 shell 为 /bin/bash。
o passwd:为用户 gauss 设置登录密码。
o su - gauss:切换到 gauss 用户(必须用非 root 用户管理 openGauss)。
6、 进入到gauss用户目录下之后的操作
#gauss用户进行安装,安装到gauss目录下
#提前建立gauss的用户目录,su - gauss之后
#/home/gauss
#创建一个目录
mkdir /home/gauss/openGauss/
[gauss@server1 ~]$ cd /app/tools/mygaosi/
[gauss@server1 mygaosi]$ echo 'gaussdb@123' | sh ./install.sh --mode single -D /home/gauss/openGauss/data -R /home/gauss/openGauss/install --start
touch: 无法创建"/app/tools/mygaosi/install.log": 权限不够
error: failed to create the log file.
再次执行之
[gauss@server1 mygaosi]$ echo 'gaussdb@123' | sh ./install.sh --mode single -D /home/gauss/openGauss/data -R /home/gauss/openGauss/install --start
the maximum number of SEMMNI is not correct, please change it (/proc/sys/kernel/sem)), ensure that the value of fourth sem is greater than 320.
还是进入到root那个窗口,给内存设置值增加超过320,第4个参数
[root@server1 ~]# sysctl -w kernel.sem="250 85000 250 330"
kernel.sem = 250 85000 250 330
7、 开始执行,这次就OK了
说明:install.sh:安装脚本。
--mode single:单节点模式安装。
-D ~/openGauss/data:指定数据库数据目录。
-R ~/openGauss/install:指定安装目录。
--start:安装完成后自动启动数据库服务。
密码要求:
必须是 8-32 个字符。
包含以下四种字符中的至少三种:
大写字母(如 A-Z)
小写字母(如 a-z)
数字(如 0-9)
特殊字符(如 @, #, ! 等)
重点:如果密码不符合要求,将导致安装失败或无法远程连接。
8、 查看进程、端口号
• 检查 gaussdb 服务是否已经启动。如果没有运行,可手动启动服务。
# 启动数据库服务。
$ gs_ctl start -D /home/gauss/openGauss/data/
# 重启数据库服务(修改配置文件后通常需要重启)。
$ gs_ctl restart -D /home/gauss/openGauss/data/
9、 进入到库中
gsql -d postgres -p 5432 -r
- 点赞
- 收藏
- 关注作者
评论(0)