1、基础安装与部署
机型2c_4g_20hd
1.1 yum源安装(安装完成之后解释一下各个路径位置)
| 路径说明 | yum方式安装 | 编译安装[可自己修改] |
|---|---|---|
| 数据目录 | /var/lib/pgsql/10/data | /pgdata/10/data |
| 包目录 | /usr/pgsql-10/bin/ | /opt/pg10/ |
1.1.1yum安装步骤
进入官网找到下载源地址,选择对应的系统
更正一下,此处yum安装12版本
下载地址:https://www.postgresql.org/download/linux/redhat/
sudo yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
sudo yum install -y postgresql12-server
sudo /usr/pgsql-12/bin/postgresql-12-setup initdb
sudo systemctl enable postgresql-12
sudo systemctl start postgresql-12
执行完以上操作,yum方式安装pg10已经完成,安装时候自动生成了postgres用户,以下检测一下是否可用
[root@localhost ~]# ps -ef|grep pg
postgres 2292 1 0 01:08 ? 00:00:00 /usr/pgsql-10/bin/postmaster -D /var/lib/pgsql/10/data/
root 10139 1953 0 01:09 pts/0 00:00:00 grep --color=auto pg
[root@localhost ~]# /usr/pgsql-10/bin/psql
psql: FATAL: role "root" does not exist
[root@localhost ~]# su - postgres
-bash-4.2$ psql
psql (10.21

最低0.47元/天 解锁文章
1454

被折叠的 条评论
为什么被折叠?



