sonar 加载mysql_SonarQube 中mysql数据库迁移到postgres数据库

本文档详细介绍了如何将SonarQube的MySQL数据库迁移到Postgres,包括在CentOS6上安装MySQL和Postgres的过程,配置数据库连接,以及使用mysql-migrator工具进行数据迁移的步骤。
摘要由CSDN通过智能技术生成

在CentOS6 安装mysql数据

关键点删除并清理旧版本的mysql数据库

rpm -ev --nodeps 命令保证删除旧版数据库软件

手工清理配置文件和service启动脚本

遗留问题: 完全删除后,仍感觉旧版的mysql对新装的仍然有影响 -- 没有继续解决

新装版本,如果切换数据目录 即 datadir ,还有权限等问题。

sonarqube需要配置的地方不多,需要关心的是数据库用户名密码和数据库连接字符串启用

启动sonarqube不能使用 root用户

安装postgres数据库在centos6上

安装没遇到什么问题,只是需要注意安装文件的顺序,文件间有依赖关系;

初始化和启动(postgres 数据库首次启动需要初始化):

a. 初始化运行指定数据保存目录(注意给指定目录合适的权限 700) -D /usr/local/postgres/data

b. 通过service启动,service postgres-9.6 start

数据迁徙前的准备

需要配置postgres的远程访问配置,通过修改配置文件

vi /var/lib/pgsql/9.6/data/postgresql.conf

#listen_addresses = '*'

vi /var/lib/pgsql/9.6/data/pg_hba.conf

# IPv4 local connections:

host all all 0.0.0.0/0 trust

# IPv6 local connections:

host all all ::1/128 ident

# Allow replication connections from localhost, by a user with the

# replication privilege.

#local replication postgres peer

#host replication postgres 127.0.0.1/32 ident

#host replication postgres ::1/128 ident

host all all 0.0.0.0/0 ident

通过修改sonarqube中的配置文件sonar.xml,开启postgres连接,然后启动sonarqube

使用sonarqube提供的 mysql-migrate工具进行数据迁徙

定义两个配置文件 source target , 分别填写mysql的连接信息和postgres的连接信息

https://github.com/SonarSource/mysql-migrator

./mysql-migrator -source source.properties -target target.properties

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值