国产数据库-达梦
- 一、环境详情
- 二、Centos7 参数优化(所有节点)
- 三、创建gbase用户(所有节点)
- 四、 安装部署,只在node1 安装即可同步
- 五、数据库卸载
- 六、数据库连接与使用
当前安装 在指定版本环境下 测试,仅供参考
一、环境详情
-  软件版本 软件 版本 下载地址 Centos 7 CentOS Linux release 7.9.2009 (Core) x86 清华镜像站: link 南大通用 GBase8a_MPP_Cluster-License-9.5.3.14-redhat7.3-x86_64.tar.bz2 兼容mysql 百度网盘 提取码:1234 南大通用官网:下载 
-  节点分配 节点 IP 角色 node1 192.168.162.221 主机 node2 192.168.162.222 备机 node3 192.168.162.223 备机 
二、Centos7 参数优化(所有节点)
- 关闭防火墙
- 关闭防火墙: systemctl stop firewalld
- 禁止开机自启: systemctl disable firewalld
-  修改系统最大进程数和最大文件打开数 vim /etc/security/limits.conf修改以下内容: * soft nofile 65536 * hard nofile 131072 * soft nproc 2048 * hard nproc 4096
-  修改进程数据限制 vim /etc/security/limits.d/90-nproc.conf 修改以下内容: * soft nproc 1024 * soft nproc 2048查看优化信息 ulimit -a
-  查看 RemoveIPC 参数值是否为 yes loginctl show-session | grep RemoveIPC systemctl show systemd-logind | grep RemoveIPC如果为 yes,则需要修改;如果为 no,则无需继续执行后续步骤 vim /etc/systemd/logind.conf将 RemoveIPC 参数值设置为 no,键入“:wq”保存并退出 vim /usr/lib/systemd/system/systemd-logind.service将 RemoveIPC 参数值设置为 no,键入“:wq”保存并退出。 
 重新加载配置文件,执行以下命令:systemctl daemon-reload systemctl restart systemd-logind
-  关闭 SELINUX sestatus如果系统提示以下信息,说明 selinux 已被禁用: 
 SELinux status: disabled否则执行以下命令 sudo vim /etc/selinux/config# disabled - No SELinux policy is loaded. SELINUX=disabled
-  同步时间 NTP 服务 
-  配置系统内核参数 sudo vim /etc/sysctl.conf #增加以下内容: kernel.sem = 40960 2048000 40960 20480#执行生效命令: sysctl -p
三、创建gbase用户(所有节点)
- 用户创建groupadd gbase useradd -m -d /home/gbase gbase -g gbase passwd gbase
- 添加普通用户至 sudoer 列表root ALL=(ALL) ALL gbase ALL=(ALL) NOPASSWD:ALL
- 在所有节点创建 gbase 用户免密登录mkdir ~/.ssh chmod 700 ~/.ssh cd /home/gbase/,ssh ssh-keygen -t rsa ssh-copy-id gbase@192.162.168.221 ssh-copy-id gbase@192.162.168.222 ssh-copy-id gbase@192.162.168.223
四、 安装部署,只在node1 安装即可同步
-  创建数据库目录 
 登录 gbase 用户mkdir -p /home/gbase/gbase_db
-  创建上传目录 mkdir -p /home/gbase/gbase_package
-  上传文件 
 上传 GBase8sV8.8_S3.0.0B69_centos7.8_x86_64.tar.gz 到 /home/gbase/gbase_package
-  解压 cd /home/gbase/gbase_package tar xvf GBase8sV8.8_S3.0.0B69_centos7.8_x86_64.tar.gz tar xvf GBase8sV8.8_S3.0.0B69_CentOS_x86_64_om.tar.gz
-  编辑 yml 文件 cp /home/gbase/gbase_package/gbase.yml /home/gbase/ vim /home/gbase/gbase.yml//填入以下信息,注意yml格式 gha_server:- gha_server1:host: 192.168.162.221port: 20001- gha_server2:host: 192.168.162.222port: 20001 dcs:- host: 192.168.162.221port: 2379- host: 192.168.162.222port: 2379- host: 192.168.162.223port: 2379 datanode:- dn1:- dn1_1:host: 192.168.162.221agent_host: 192.168.162.221role: primaryport: 15432agent_port: 8005work_dir: /home/gbase/data/dn1/dn1_1- dn1_2:host: 192.168.162.222agent_host: 192.168.162.222role: standbyport: 15432agent_port: 8006work_dir: /home/gbase/data/dn1/dn1_2- dn1_3:host: 192.168.162.223agent_host: 192.168.162.223role: standbyport: 15432agent_port: 8006work_dir: /home/gbase/data/dn1/dn1_3 env:# cluster_type allowed values: multiple-nodes, single-inst, default is multiple-nodescluster_type: single-instpkg_path: /home/gbase/gbase_packageprefix: /home/gbase/gbase_dbversion: V8.8_S3.0.0B69user: gbaseport: 22third_ssh: false # constant: # virtual_ip: 100.0.1.254/24
-  安装命令 cd /home/gbase/gbase_package/script ./gha_ctl install -p /home/gbase/ -c gbase
-  查看状态命令 gha_ctl monitor all -l http://192.168.162.221:2379 -H
-  启停数据库 //启动 ./gha_ctl start all -l http://192.168.162.221:2379//停止 ./gha_ctl stop all -l http://192.168.162.221:2379
五、数据库卸载
- 卸载./gha_ctl uninstall -c gbase8s -l http://192.168.162.221:2379
- 卸载完成后删除 DCS./gha_ctl destroy dcs -l http://192.168.162.221:2379
六、数据库连接与使用
- 本地连接
 修改密码gsql -d dbname -p port <-U user_name> <-h hostip > gsql -d postgres -p 15432ALTER ROLE user_name IDENTIFIED BY '新密码' ALTER ROLE gbase IDENTIFIED BY 'casic@123456'
- 远程连接 
 使用 navicat ,创建连接选择 PostGreSQL 配置