harbor配置外部postgresql数据库(以harborv2.3.0为例)
harbor配置外部postgresql数据库
以harborv2.3.0为例
一、安装postgersql13.3
下载地址: https://www.postgresql.org/ftp/source/
1、安装依赖
yum install -y readline-devel zlib-devel make openssl-devel gcc
2、源码安装
tar -xf postgresql-13.3.tarcd postgresql-13.3./configure --prefix=/usr/local/pgsql makemake install
3、创建postgres用户
groupadd postgresuseradd -g postgres postgres
4、创建数据目录并授权
mkdir /usr/local/pgsql/datachown postgres:postgres /usr/local/pgsql/data
5、切换到postgres用户
su - postgres
6、初始化
/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
7、启动
/usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data -l /usr/local/pgsql/data/logfile start
二、配置postgres
1、进入数据库
su - postgres/usr/local/pgsql/bin/psql
2、创建表结构
postgres=# create database registry;postgres=# create database notaryserver;postgres=# create database notarysigner;
3、开启远程访问
vim postgresql.conf #listen_addresses修改为*listen_addresses = '*'vim pg_hba.conf #在IPv4 local connections处添加如下一行# IPv4 local connections:
host all all 0.0.0.0/0 trust
4、重启postgresql
/usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data -l /usr/local/pgsql/data/logfile restart
三、修改harbor.yml
1、vim harbor.yml
external_database:harbor:host: 192.168.56.42port: 5432db_name: registryusername: postgrespassword:ssl_mode: disablemax_idle_conns: 50max_open_conns: 100notary_signer:host: 192.168.56.42port: 5432db_name: notarysignerusername: postgrespassword:ssl_mode: disablenotary_server:host: 192.168.56.42port: 5432db_name: notaryserverusername: postgrespassword:ssl_mode: disable
2、安装
./install.sh
本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!
