博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
pgbouncer centos7.4 install
阅读量:6832 次
发布时间:2019-06-26

本文共 2722 字,大约阅读时间需要 9 分钟。

编辑器原因 ‘-#’符号需要去掉‘-’

-# yum install -y deltarpm

-# yum install -y openssl-devel zlib-devel readlinie-devel gcc-c++ libevent-devel
-# ./configure --prefix=/opt/pgbouncer/1.8.1
-# make
-# make install

-# cd /opt/pgbouncer/1.8.1/

-# mkdir log etc run tmp
-# ls
bin etc log run share tmp
-#
-# cp share/doc/pgbouncer/pgbouncer.ini etc/
-# cp share/doc/pgbouncer/userlist.txt etc/
-#

-# vi /opt/pgbouncer/1.8.1/etc/pgbouncer.ini

-#### modify ####
[databases]
-#### total_pool_size = pool_size + reserve_pool_size ####
testdb = port=5432 dbname=testdb pool_size=2 user=testuser password=testuser

[pgbouncer]

logfile = /opt/pgbouncer/1.8.1/log/pgbouncer.log
pidfile = /opt/pgbouncer/1.8.1/run/pgbouncer.pid
listen_addr = 0.0.0.0
unix_socket_dir = /opt/pgbouncer/1.8.1/tmp
auth_type = md5
auth_file = /opt/pgbouncer/1.8.1/etc/userlist.txt
admin_users = pgbadmin
pool_mode = transaction
server_reset_query = RESET ALL
server_reset_query_always = 1
ignore_startup_parameters = extra_float_digits
max_client_conn = 1000
default_pool_size = 2
min_pool_size = 1
reserve_pool_size = 1
pkt_buf = 8192
listen_backlog = 65535

-# vi /opt/pgbouncer/1.8.1/etc/userlist.txt

"pgbadmin" "pgbouncer"

"user01" "user01"

日志配置

-# vi pgbouncer

/opt/pgbouncer/1.8.1/log/pgbouncer.log
{
missingok
nocompress
notifempty
sharedscripts
create 0640 postgres postgres
daily
rotate 10
postrotate
/bin/kill -HUP cat /opt/pgbouncer/1.8.1/run/pgbouncer.pid 2>/dev/null 2> /dev/null || true
endscript
}
-#

启动脚本

-# vi /usr/lib/systemd/system/pgbouncer.service

-##### file content start ####
-# It's not recommended to modify this file in-place, because it will be
-# overwritten during package upgrades. If you want to customize, the
-# best way is to create a file "/etc/systemd/system/pgbouncer.service",
-# containing
-# .include /lib/systemd/system/pgbouncer.service
-# ...make your changes here...
-# For more info about custom unit files, see
-#

[Unit]

Description=A lightweight connection pooler for PostgreSQL
After=syslog.target
After=network.target

[Service]

Type=forking

User=postgres

Group=postgres

-# Path to the init file

Environment=BOUNCERCONF=/opt/pgbouncer/1.8.1/etc/pgbouncer.ini

PIDFile=/opt/pgbouncer/1.8.1/run/pgbouncer.pid

-# Where to send early-startup messages from the server

-# This is normally controlled by the global default set by systemd
-# StandardOutput=syslog

ExecStart=/opt/pgbouncer/1.8.1/bin/pgbouncer -d -q ${BOUNCERCONF}

ExecReload=/usr/bin/kill -HUP $MAINPID
KillSignal=SIGINT

-# Give a reasonable amount of time for the server to start up/shut down

TimeoutSec=300

[Install]

WantedBy=multi-user.target
-##### content end ####

-# chmod +x /usr/lib/systemd/system/pgbouncer.service

转载于:https://blog.51cto.com/heyiyi/2118290

你可能感兴趣的文章
Linux 添加启动项 rc.local
查看>>
npoi设置Excel边框
查看>>
Java提高篇(二六)-----hashCode
查看>>
如何用zabbix创建自定义监控项
查看>>
PHP json_encode Unicode 解决办法
查看>>
Andriod Studio 解决问题 Failed to resolve: com.android.support:appcompat-v7:28.+
查看>>
IOException XX sessions: java.io.EOFException
查看>>
Solr服务的搭建
查看>>
谈一谈SQL Server中的执行计划缓存(下)
查看>>
centos系统实现hadoop安装配置《二》
查看>>
linux JVM内存分析(二) 实战JVM调优
查看>>
(三)spring cloud微服务分布式云架构 - Spring Cloud集成项目简介
查看>>
scrapy爬虫时HTTPConnectionPool(host:XX)Max retries exceeded with url 解决方法
查看>>
随机漫步
查看>>
解决vue在ie中不能使用的问题
查看>>
如何使用 CSS Grid 快速而又灵活的布局
查看>>
scrolltop的兼容问题
查看>>
磁盘格式化,磁盘挂载,手动增加swap空间
查看>>
2.23/2.24/2.25 find命令
查看>>
4.26 Alias 4.27-29 php编译安装 4.30 编译安装Nginx
查看>>