service postgresql-10 initdb
chkconfig postgresql-10 on
service postgresql-10 start
修改绑定地址
vim /var/lib/pgsql/10/data/postgresql.conf
listen_addresses = '*'
添加客户端IP放行(生产环境不建议放行0.0.0.0/0 范围太大了)
vim pg_hba.conf
host all all 0.0.0.0/0 md5
/etc/init.d/postgresql-10 restart
2、在pgsql里面创建用户及相关的库:
su - postgres
psql
create user gitlab with password '123456' ;
create database gitlab_ci_production;
create database gitlabhq_production;
alter database gitlab_ci_production owner to gitlab;
alter database gitlabhq_production owner to gitlab;
4、编写导出文件的yml,如下: [iyunv@localhost ~]# cat convert.yml 内容如下:
# if a socket is specified we will use that
# if tcp is chosen you can use compression
mysql:
hostname: localhost
port: 3306
socket: /tmp/mysql.sock
username: root
password: 123456
database: gitlab_ci_production
compress: false
destination:
# if file is given, output goes to file, else postgres
file:
postgres:
hostname: 192.168.2.100
port: 5432
username: gitlab
password: 123456
database: gitlab_ci_production
[iyunv@localhost ~]# cat convert2.yml 内容如下:
# if a socket is specified we will use that
# if tcp is chosen you can use compression
mysql:
hostname: localhost
port: 3306
socket: /tmp/mysql.sock
username: root
password: 123456
database: gitlabhq_production
compress: false
destination:
# if file is given, output goes to file, else postgres
file:
postgres:
hostname: 192.168.2.100
port: 5432
username: gitlab
password: 123456
database: gitlabhq_production