CentOS 7 安装 postgreSQL 9.4
2016-06-09 11:22
507 查看
CentOS 7仓库中的postgresql软件包太老,我们希望从postgresql 官方获取支持,尤其是关于postgresql 集群方面的支持,比如pgpool 。
安装postgresql 9.4yum install https://download.postgresql.org/pub/repos/yum/9.4/redhat/rhel-7-x86_64/pgdg-centos94-9.4-2.noarch.rpm
yum install postgresql-9.4-server
初始化数据库mkdir -p /data/pgsql
chmod 755 /data
chmod 755 /data/pgsql
chown -R postgres:postgres /data/pgsql
sudo -u postgres /usr/pgsql-9.4/bin/initdb -D /data/pgsql --encoding='UTF8' --locale='zh_CN.UTF-8' --lc-collate='zh_CN.UTF-8' --lc-ctype='zh_CN.UTF-8'
创建文件/etc/systemd/system/postgresql-9.4.service ,touch /etc/systemd/system/postgresql-9.4.service内容如下
.include /usr/lib/systemd/system/postgresql-9.4.service [Service] Environment=PGPORT=5432 Environment=PGDATA=/data/pgsql启动postgresqlsystemctl daemon-reload systemctl enable postgresql-9.4 systemctl start postgresql-9.4
设置postgres用户密码psql -U postgres
alter user postgres with password '123456';
主要的性能参数
shared_buffers = 4GB #物理内存的1/4左右,不超过8G work_mem = 32MB #work_mem * max_connections 不超过物理内存 max_connections = 500 #最大连接数 maintenance_work_mem = 256MB effective_cache_size = 8GB #能够使用的最大缓存,建议物理内存1/2 fsync = on #是否强制刷写硬盘,on开启可防止数据丢失,off关闭,性能会更好。阅读更多
相关文章推荐
- centos环境源码安装postgresql9.4
- 阿里云centos postgresql9.4源码安装 精简步骤、问题解答
- Centos6.5 下安装PostgreSQL9.4数据库
- centos6.5 安装postgresql9.4
- CentOS安装postgresql 9.4
- CentOS安装PostgreSQL 9.4
- 阿里云ECS(CentOS)上安装PostgreSQL9.4
- CentOS 7 安装 postgreSQL 9.4
- CentOS下安装postgresql 9.4
- centos6.5 安装postgresql9.4
- CentOS 6.6通过yum 安装PostgreSQL 9.4
- postgresql 9.4 在linux(Centos)环境的安装步骤详解
- centos 下源码安装postgresql 9.4
- centos 操作系统 安装 postgresql-9.4 postgresql-9.3
- CentOS7下安装PostgreSQL 9.4 与 phpPgAdmin
- CentOS下安装postgresql 9.4
- CentOS实验十四:安装PostgreSQL
- centos 下最新的postgresql的yum安装
- 在CentOS上安装PostgreSQL9.4.5
- Centos5下Postgresql9.0.7的源码安装与配置