-
Notifications
You must be signed in to change notification settings - Fork 11
/
README
114 lines (78 loc) · 3.33 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
PgBouncer
=========
Lightweight connection pooler for PostgreSQL.
Homepage:
http://wiki.postgresql.org/wiki/PgBouncer
Downloads, bugtracking:
https://github.com/pgbouncer/pgbouncer
Building
---------
GNU Make 3.81+ is required for building.
PgBouncer uses libevent for low-level socket handling.
Libevent needs to be at least version 1.3b. Preferably 2.x as
Libevent 2.x has proper async DNS implementation.
When this is installed just run:
$ ./configure --prefix=/usr/local --with-libevent=libevent-prefix
$ make
$ make install
If the OS does not have libevent available as package, it can be
downloaded from http://monkey.org/~provos/libevent/
DNS lookup support
------------------
Starting from PgBouncer 1.4, it does hostname lookups at connect
time instead just once at config load time. This requires proper
async DNS implementation. Following list shows supported backends
and their probing order:
.DNS backends
[options="header"]
|===========================================================================================
| backend | parallel | EDNS0 (1) | /etc/hosts | SOA lookup (2) | note
| udns | yes | yes | no | yes | ipv4-only
| evdns, libevent 2.x | yes | no | yes | no |
| getaddrinfo_a, glibc 2.9+ | yes | yes (3) | yes | no | N/A on non-linux
| getaddrinfo, libc | no | yes (3) | yes | no | N/A on win32, requires pthreads
| evdns, libevent 1.x | yes | no | no | no | buggy
|===========================================================================================
1. EDNS0 is required to have more then 8 addresses behind one hostname.
2. SOA lookup is needed to re-check hostnames on zone serial change
3. To enable EDNS0, add `options edns0` to /etc/resolv.conf
`./configure` also has flags `--enable-evdns` and `--disable-evdns` which
turn off automatic probing and force use of either `evdns` or `getaddrinfo_a()`.
Building from GIT
-----------------
Building PgBouncer from GIT requires that you fetch libusual
submodule and generate the header and config files before
you can run configure:
$ git clone git://git.postgresql.org/git/pgbouncer.git
$ cd pgbouncer
$ git submodule init
$ git submodule update
$ ./autogen.sh
$ ./configure ...
$ make
$ make install
Additional packages required: autoconf, automake, libtool,
autoconf-archive, asciidoc 8.x, xmlto.
Building for WIN32
------------------
At the moment only build env tested is MINGW32 / MSYS. Cygwin
and Visual $ANYTHING are untested. Libevent 2.x is required
for DNS hostname lookup.
Then do the usual:
$ ./configure ...
$ make
If cross-compiling from Unix:
$ ./configure --host=i586-mingw32msvc ...
Running on WIN32
----------------
Running from command-line goes as usual, except -d (daemonize),
-R (reboot) and -u (switch user) switches will not work.
To run pgbouncer as a Windows service, you need to configure
`service_name` parameter to set name for service. Then:
$ pgbouncer -regservice config.ini
To uninstall service:
$ pgbouncer -unregservice config.ini
To use Windows Event Log, set "syslog = 1" in config file.
But before you need to register pgbevent.dll:
$ regsvr32 pgbevent.dll
To unregister it, do `regsvr32 /u pgbevent.dll`.