相干文章:
体系国产化替换方案(一)OpenEuler+OpenGauss-CSDN博客https://blog.csdn.net/qq_41057525/article/details/141804006?spm=1001.2014.3001.5501体系国产化替换方案(二)毕昇JDK-CSDN博客https://blog.csdn.net/qq_41057525/article/details/141817379?spm=1001.2014.3001.5501
一、卸载之前安装的openGauss
缘故起因是我还没试过这个版本行不行,需要重新安装新版本OpenGauss
- yum remove opengauss
- userdel opengauss
复制代码 二、安装软件
服务器版本信息
JDK 版本要求为:JDK11以上
软件包下载
软件包 | openGausshttps://opengauss.org/zh/download/archive/
openGauss_5.1.0 极简版 | https://opengauss.obs.cn-south-1.myhuaweicloud.com/5.1.0/x86/openGauss-5.1.0-CentOS-64bit.tar.bz2 | Datakit_5.1.0 | https://opengauss.obs.cn-south-1.myhuaweicloud.com/5.1.0/tools/Datakit/Datakit-5.1.0.tar.gz | PortalControl_5.1.0 | https://opengauss.obs.cn-south-1.myhuaweicloud.com/5.1.0/tools/centos7/PortalControl-5.1.0-x86_64.tar.gz | 2.1 安装opengauss
关闭防火墙
- systemctl stop firewalld
- systemctl disable firewalld
复制代码 创建用户并设置暗码
- useradd -m opengauss
- passwd opengauss
复制代码 创建文件夹
- mkdir -p /usr/local/opengauss
- cd /usr/local
复制代码 上传下载的openGauss安装包
解压缩
- tar -jxf openGauss-5.1.0-CentOS-64bit.tar.bz2 -C /usr/local/opengauss/
复制代码 给opengauss用户授权
- chown -R opengauss:opengauss /usr/local/opengauss/
复制代码 执行命令
- sysctl -w kernel.sem="250 85000 250 330"
复制代码 切换用户
执行脚本
- cd /usr/local/opengauss/simpleInstall/
- sh install.sh -w "数据库密码" &&source ~/.bashrc
复制代码
启动成功。
- cd /usr/local/opengauss/data/single_node
复制代码 修改文件 postgresql.conf
- listen_addresses = '*'
- max_connections = 1000
- wal_level = logical
复制代码
修改文件pg_hba.conf
添加以下设置
- host all all 0.0.0.0/0 sha256
- host replication all 0.0.0.0/0 sha256
复制代码
重启opengauss
- cd /usr/local/opengauss/bin
- gs_ctl restart -D $GAUSSHOME/data/single_node/ -Z single_node
复制代码
重启成功。
连接opengauss
创建用户
- create user testuser with password '密码';
复制代码
- grant all privileges to testuser;
复制代码
创建datakit数据库和迁移目标数据库testdb
- create database datakit;
- create database testdb with dbcompatibility='b';
复制代码
利用Data Studio连接
至此opengauss安装设置完成
2.2 安装Datakit
上传文件Datakit_5.1.0
创建文件夹
- mkdir -p /datakit/datakit5.1
复制代码 解压缩
- tar -zxvf Datakit-5.1.0.tar.gz -C /datakit/datakit5.1/
- cd /datakit/datakit5.1/
- #创建工作目录
- mkdir -p logs config ssl files
复制代码
执行ssl
- keytool -genkey -noprompt \
- -dname "CN=opengauss, OU=opengauss, O=opengauss, L=Beijing, S=Beijing, C=CN"\
- -alias opengauss\
- -storetype PKCS12 \
- -keyalg RSA \
- -keysize 2048 \
- -keystore /datakit/datakit5.1/ssl/keystore.p12 \
- -validity 3650 \
- -storepass 123456
复制代码
拷贝设置文件
- cp application-temp.yml ./config/
复制代码 修改设置文件
- vim ./config/application-temp.yml
复制代码- system:
- # File storage path
- defaultStoragePath: /datakit/datakit5.1/files
- # Whitelist control switch
- whitelist:
- enabled: false
- server:
- port: 9494
- ssl:
- key-store: /datakit/datakit5.1/ssl/keystore.p12
- key-store-password: 123456
- key-store-type: PKCS12
- enabled: true
- servlet:
- context-path: /
- logging:
- file:
- path: /datakit/datakit5.1/logs/
- spring:
- datasource:
- type: com.alibaba.druid.pool.DruidDataSource
- driver-class-name: org.opengauss.Driver
- url: jdbc:opengauss://opengauss IP:5432/datakit?currentSchema=public&batchMode=off
- username: testuser
- password: 密码
- druid:
- test-while-idle: false
- test-on-borrow: true
- validation-query: "select 1"
- validation-query-timeout: 10000
- connection-error-retry-attempts: 0
- break-after-acquire-failure: true
- max-wait: 6000
- keep-alive: true
- max-active: 30
- min-evictable-idle-time-millis: 600000
- management:
- server:
- port: 9494
复制代码 生存文件,进入
启动datakit
- nohup java -Xms2048m -Xmx4096m -jar openGauss-datakit-5.1.0.jar --spring.profiles.active=temp > ./logs/datakit.out 2>&1 &
复制代码
启动成功。访问https://ip:9494
第一次登陆需要修改暗码,登陆成功之后
三、数据迁移
3.1、检查Msql设置文件,大概需要添加一下设置
- log-bin=mysql-bin
- default_authentication_plugin=mysql_native_password
- character_set_server=utf8mb4
- enforce_gtid_consistency=on
- gtid_mode=on
复制代码 3.2、重启Mysql服务
3.3、页面新增MySQL数据源
3.4 页面新增openGauss数据源
3.5 页面新增服务器管理
3.6 添加用户
注意:添加用户是大概添加不成功,大概是暗码复杂度不敷,暗码最好是包含大小写英文字母、特殊符号和数字,长度大于12位。
3.7 创建数据迁移任务
3.8 登陆服务器,切换root账号
- chown -R testuser:testuser /datakit/
- echo "服务器IP centos79" >> /etc/hosts
复制代码 3.9 切换testuser 用户,新增一下内容
- vim /home/testuser/.bashrc
- export JAVA_HOME=/usr/local/bisheng-jdk-11.0.24
- export PATH=$JAVA_HOME/bin:$PATH
- export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib
- source /home/testuser/.bashrc
复制代码 3.10 回到页面,上传插件
3.11 登陆Data Studio
至此迁移完成。
吐槽一句:都是泪,踩了一遍又一遍的坑>~<
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。 |