CentOS 7倉庫中的postgresql軟件包太老,我們希望從postgresql 官方獲取支持,尤其是關(guān)于postgresql 集群方面的支持,比如pgpool 。
創(chuàng)新互聯(lián)專注為客戶提供全方位的互聯(lián)網(wǎng)綜合服務(wù),包含不限于成都網(wǎng)站制作、網(wǎng)站設(shè)計、外貿(mào)網(wǎng)站建設(shè)、榆陽網(wǎng)絡(luò)推廣、微信小程序開發(fā)、榆陽網(wǎng)絡(luò)營銷、榆陽企業(yè)策劃、榆陽品牌公關(guān)、搜索引擎seo、人物專訪、企業(yè)宣傳片、企業(yè)代運(yùn)營等,從售前售中售后,我們都將竭誠為您服務(wù),您的肯定,是我們最大的嘉獎;創(chuàng)新互聯(lián)為所有大學(xué)生創(chuàng)業(yè)者提供榆陽建站搭建服務(wù),24小時服務(wù)熱線:13518219792,官方網(wǎng)址:www.muchs.cn
安裝postgresql 9.4
yum 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
初始化數(shù)據(jù)庫
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'
創(chuàng)建文件/etc/systemd/system/postgresql-9.4.service ,
touch /etc/systemd/system/postgresql-9.4.service
內(nèi)容如下
.include /usr/lib/systemd/system/postgresql-9.4.service [Service] Environment=PGPORT=5432 Environment=PGDATA=/data/pgsql
啟動postgresql
systemctl daemon-reload systemctl enable postgresql-9.4 systemctl start postgresql-9.4
設(shè)置postgres用戶密碼
psql -U postgres
alter user postgres with password '123456';
主要的性能參數(shù)
shared_buffers = 4GB #物理內(nèi)存的1/4左右,不超過8G work_mem = 32MB #work_mem * max_connections 不超過物理內(nèi)存 max_connections = 500 #最大連接數(shù) maintenance_work_mem = 256MB effective_cache_size = 8GB #能夠使用的最大緩存,建議物理內(nèi)存1/2 fsync = on #是否強(qiáng)制刷寫硬盤,on開啟可防止數(shù)據(jù)丟失,off關(guān)閉,性能會更好。
網(wǎng)站題目:CentOS7安裝postgreSQL9.4
網(wǎng)站URL:http://www.muchs.cn/article40/jsodho.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站策劃、做網(wǎng)站、網(wǎng)站營銷、手機(jī)網(wǎng)站建設(shè)、動態(tài)網(wǎng)站、網(wǎng)站排名
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)