一、银河麒麟V10 服务器版
银河麒麟V10 服务器版,听说基于 RHEL 8。但我感觉就是CentOS
银河麒麟V10 桌面版 ,听说混合 Debian/Ubuntu 。
下载开源版:https://www.openkylin.top
下载收费版:国产操作系统、麒麟操作系统------麒麟软件官方网站
注意1:版本不止有服务器版本,还有桌面版本。
注意2:使用不同的CPU芯片,安装不同的镜像

二、openGuass单点安装
0、简介
GaussDB 应该只有云平台,所以这里使用开源版本openGauss_6.0.1(极简版)
下载开源版:openGauss官方网站 | openGauss主页 | openGauss社区官网
注意1:GaussDB的前身是PostgreSQL,所以当他是PostgreSQL就行。

1、常见报错(先处理再安装)
① 无法修改limit值

解决办法:
**root**@localhost simpleInstall\]$ vim /home/ye/.bashrc  #### ② 找不到 " libreadline.so.6 "  **解决方法** > \[root@localhost lib64\]# cd /lib64/ > > \[root@localhost lib64\]# find libreadline.so.\* > > libreadline.so.8 > > libreadline.so.8.0 > > \[root@localhost lib64\]# ln -s libreadline.so.8 libreadline.so.6 > > # 使用find命令 > > \[root@localhost lib64\]# find libreadline.so.\* > > libreadline.so.6 > > libreadline.so.8 > > libreadline.so.8.0 > > # 也可以用list命令验证 > > \[root@localhost lib64\]# ll \|grep libreadline.so > > lrwxrwxrwx 1 root root 16 7月 3 15:00 libreadline.so.6 -\> libreadline.so.8 > > lrwxrwxrwx 1 root root 18 2月 22 2022 libreadline.so.8 -\> libreadline.so.8.0 > > -rwxr-xr-x 1 root root 326680 2月 22 2022 libreadline.so.8.0 #### ③ 找不到 " libnsl "  1. **解决方法:** > \[root@localhost openGauss\]# yum install libnsl ### 2、单节点安装 #### ① 创建组、用户 > # 创建组 > > groupadd dbgroup > > # 创建ye用户 > > useradd -g dbgroup ye > > # 设置数据库密码 > > passwd ye #### ② 创建数据库安装路径、并授权 /opt:适合独立、封闭的第三方软件。(所以这里我推荐放在opt) /usr/local:适合手动编译安装的开源工具或本地定制软件。 > # 创建数据库安装路径 > > mkdir -p /opt/openGauss > > # 为omm用户授权安装路径权限 > > chown -R ye:dbgroup /opt/openGauss #### ③ 下载openGauss-Server-6.0.1 > \[ye@localhost openGauss\]$ wget [https://opengauss.obs.cn-south-1.myhuaweicloud.com/6.0.1/CentOS7/x86/openGauss-Server-6.0.1-CentOS7-x86_64.tar.bz2](https://opengauss.obs.cn-south-1.myhuaweicloud.com/6.0.1/CentOS7/x86/openGauss-Server-6.0.1-CentOS7-x86_64.tar.bz2 "https://opengauss.obs.cn-south-1.myhuaweicloud.com/6.0.1/CentOS7/x86/openGauss-Server-6.0.1-CentOS7-x86_64.tar.bz2") #### ④ 使用普通用户解压 > tar -jxvf openGauss-Server-6.0.1-CentOS7-x86_64.tar.bz2 -C /opt/openGauss/ #### ⑤ 执行安装脚本(install.sh) > cd /opt/openGauss/simpleInstall > > sh install.sh -w "xxxx" -p 5432 \&\&source \~/.bashrc > > * -w:初始化数据库密码(gs_initdb指定),因安全需要,此项必须设置。 ### **3、单节点卸载** ```bash 1. 查询服务器上openGauss数据库的进程,并记录下进程号。 ps ux | grep gaussdb 2. 使用kill命令停止进程。 kill -9 进程号 3. 删除数据库目录。 rm -rf /opt/software/openGauss/data/single_node 4. 删除安装目录。 rm -rf /opt/software/openGauss ``` ### 4、使用 #### ① Linux环境 注意:以下指令不用用root,需要切换ye用户才可以用 ##### # 查看状态 gs_ctl status -D /opt/openGauss/data/single_node/ ##### # 启动 gs_ctl start -D /opt/openGauss/data/single_node/ ##### # 重启 gs_ctl restart -D /opt/openGauss/data/single_node/ ##### # 停止 gs_ctl stop -D /opt/openGauss/data/single_node/ ##### **# 登录** \[ye@localhost openGauss\]$ gsql -d postgres -U **ye** -p 5432 注意:**默认用户是当前安装用户,并且无密码** > **# 查看有几个数据库** > > openGauss=# select datname from pg_database; > > datname > > ----------- > > template1 > > school > > finance > > template0 > > postgres > > (5 rows) > > **# 创建新用户 (建议修改MD5认证后再建立,否则后面还需要改一次)** > > openGauss=# create user testuser with password 'root@123'; > > CREATE ROLE > > **# 更改用户密码(建议修改MD5认证后再建立,不急)** > > openGauss=# alter role testuser identified by '新密码' replace '旧密码'; > > ALTER ROLE > > **# 退出** > > openGauss=# \\q #### ② window环境 - Navicat ##### # 关闭防火墙 > \[root@localhost single_node\]# vim /etc/selinux/config > > SELINUX=disabled > > \[root@localhost single_node\]# reboot > > systemctl status firewalld > > **# 相关命令** > > systemctl start firewalld.service # 立即启动 > > systemctl stop firewalld.service # 立即停止 > > systemctl disable firewalld.service # 禁止开机启动 > > systemctl enable firewalld.service # 允许开机启动 ##### # 运行外部访问openGauss > cd /opt/openGauss/data/single_node 步骤 1: 编辑 pg_hba.conf > 你需要确保有一个规则允许从外部 IP 地址连接到数据库。例如,如果你想允许所有 IP 地址的访问,可以添加如下行: > > host all all 0.0.0.0/0 md5 > > 或者,如果你只想允许特定 IP 地址或 IP 地址范围,可以指定具体的 IP 地址,例如: > > host all all 192.168.1.0/24 md5 > > 这里 md5 表示使用 MD5 加密的密码进行认证。你也可以使用 trust(不推荐,因为这可能会带来安全风险),或者 scram-sha-256(推荐)。 步骤 2: 编辑 postgresql.conf > 修改监听地址:找到 listen_addresses 参数,并确保它设置为 '\*' 以允许所有 IP 地址连接,或者指定一个 IP 地址: > > listen_addresses = '\*' > > password_encryption_type = 0 ##### # 重新修改密码 > 由于旧密码不是MD5加密,所以需要重新修改密码,否则报认证方式不支持"**authertication method 11 not supported**" > > openGauss=# alter role testuser identified by '新密码' replace '旧密码'; > > NOTICE: The encrypted password contains MD5 ciphertext, which is not secure. > > ALTER ROLE  ##### # 授权管理员权限 > openGauss=# GRANT ALL PRIVILEGES TO testuser;  ## 三、JDK yum update(可选)确保所有软件包都是最新 > yum list\|grep jdk > yum install java-1.8.0-openjdk.x86_64 > > \[root@dev-host software\]# java -version > > openjdk version "1.8.0_442" ## 四、tomcat > yum install tomcat > > sudo systemctl daemon-reload > > sudo systemctl start tomcat > > sudo systemctl enable tomcat ## 五、Linux常用指令 ### 0、查看端口:netstat -tuln  ## 六、安装PostgreSql 由于openGauss安装太麻烦,所以可以考虑直接用yum一键安装rpm包 ### 方法一:官网下载,YUM安装 [PostgreSQL: Linux downloads (Red Hat family)](https://www.postgresql.org/download/linux/redhat/ "PostgreSQL: Linux downloads (Red Hat family)") > sudo yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm > > sudo yum install -y postgresql17-server > > sudo /usr/pgsql-17/bin/postgresql-17-setup initdb > > sudo systemctl enable postgresql-17 > > sudo systemctl start postgresql-17 ### 方法二:软件库,YUM安装 > \[ye@dev-host \~\]$ yum list\|grep postgresql-server > > postgresql-server.x86_64 10.5-23.p04.ky10 ks10-adv-os > > \[root@dev-host domo\]# yum install -y postgresql-server >