Ubuntu服务器初始化
SSH Key ssh-keygen -t ed25519 -C "your_email@example.com" 安装Nginx sudo apt install nginx nginx 配置模板 server { listen 80; listen [::]:80; listen 443 ssl http2; listen [::]:443 ssl http2; ssl_certificate /usr/local/nginx/ssl/cert.pem; ssl_certificate_key /usr/local/nginx/ssl/key.pem; ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; ssl_ciphers TLS13-AES-256-GCM-SHA384:TLS13-CHACHA20-POLY1305-SHA256:TLS13-AES-128-GCM-SHA256:TLS13-AES-128-CCM-8-SHA256:TLS13-AES-128-CCM-SHA256:EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5; ssl_prefer_server_ciphers on;
postgres13 主从复制
环境 主服务器 地址: 172.24.89.190 从服务器 地址: 172.24.89.191 两台服务器都已经安装了postgres,且版本均为13。安装过程
Postgres Check(约束)
键表的约束 -- 使用check 关键字进行字段约束 create table users ( id int primary key, name varchar not null, age int default 20 check (age > 0 and age <=150), created_at timestamp with time zone
PostgreSql13 安装配置与远程连接
源码安装(Centos) # 以下命令需要在root用户下执行 wget https://ftp.postgresql.org/pub/source/v13.0/postgresql-13.0.tar.bz2 # 源码下载 tar xjvf postgresql-13.0.tar.bz2 # 解压至当前文件夹 cd postgresql-13.0