0℃
2022年06月28日
⁄ PostgreSQL
⁄ 被围观 4,041次+
说明:
1、PostgreSQL 使用 pg_dump 和 pg_dumpall 进行数据库的逻辑备份,使用 psql 和 pg_restore 导入数据;
2、pg_dump 可以选择一个数据库或者部分表进行备份,pg_dumpall是对整个数据库集群进行备份;
3、psql恢复SQL文本格式的数据备份,pg_restore恢复自定义格式的数据备份。
数据库用户:dbuser
数据库:testdb
数据表:new_test,tb_test,testdb
数据库安装路径:/usr/local/pgsql/bin/
mkdir -p /data/backup #创建备份文件存放目录
chown postgres.postgres -R /data/backup
su - postgres
一、Post...
PostgreSQL阅读全文
0℃
2022年06月26日
⁄ PostgreSQL
⁄ 被围观 1,769次+
操作系统:CentOS-7.6
主节点:192.168.21.100
从节点:192.168.21.101
PostgreSQL版本:postgresql-11.13.tar.gz
下载地址:https://ftp.postgresql.org/pub/source/v11.13/postgresql-11.13.tar.gz
PostgreSQL数据库的主从同步是一种高可用解决方案,可以实现读写分离。
一、基础配置
在主从服务器上都进行操作
1、防火墙配置
CentOS 7.x 8.x 默认使用的是firewall作为防火墙,这里改为iptables防火墙。
1.1、关闭firewall:
systemctl stop firewalld.service #停止firewall
systemctl disable firewalld.serv...
PostgreSQL, 主从同步阅读全文
0℃
2022年06月04日
⁄ PostgreSQL
⁄ 被围观 1,732次+
PostgreSQL是一个功能非常强大的、源代码开放的关系型数据库,PostgreSQL被业界誉为“最先进的开源数据库”,主要面向企业复杂查询SQL的OLTP业务场景, 支持NoSQL数据类型(hstore/JSON/XML)
一、防火墙配置
CentOS 7.x 8.x 默认使用的是firewall作为防火墙,这里改为iptables防火墙。
1、关闭firewall:
systemctl stop firewalld.service #停止firewall
systemctl disable firewalld.service #禁止firewall开机启动
systemctl mask firewalld
systemctl stop firewalld
yum remove firewalld
2、安装iptables防...
PostgreSQL, 数据库阅读全文