PostgreSQLpgBouncer installation Configuration

Source: Internet
Author: User
PostgreSQLpgBouncer installation configuration: pgfoundry. orgfr? Group_id1000258release_id19811. Installation Procedure: $. configure -- prefixusrlocal -- with-libeventlibevent-prefix $ make $ makeinstall monkey.org ~

PostgreSQL pgBouncer installation configuration: http://pgfoundry.org/frs? Group_id = 1000258release_id = 1981 1. installation Steps: $. /configure -- prefix =/usr/local -- with-libevent = libevent-prefix $ make install if there is no libevent, then http://monkey.org /~

PostgreSQL pgBouncer installation Configuration

: Http://pgfoundry.org/frs? Group_id = 1000258 & release_id = 1981

1. installation steps:

$./Configure -- prefix =/usr/local -- with-libevent = libevent-prefix

$ Make

$ Make install

If there is no libevent, then the http://monkey.org /~ Provos/libevent/download

Libevent installation:

$./Configure & make

$ Make verify

# Make install use the root user for Installation

Tail-1f config. log

Configure: exit 0 0 indicates that the installation is successful, and 1 indicates that the installation fails.

2. Create a configuration file:

Mkdir-p $ PGDATA/pgbouncer

S @ readerlogdb-> more config. ini

[Databases]

Testdb = host = 127.0.0.1 port = 1931 dbname = testdb user = testuser password = testuser

[Pgbouncer]

Listen_port= 1688

Listen_addr = 127.0.0.1

Auth_type = md5

Auth_file =/opt/pgdata/pg_root/pgbouncer/user.txt

Logfile =/opt/pgdata/pg_root/pgbouncer. log

Pidfile =/opt/pgdata/pg_root/pgbouncer. pid

Pool_mode = Transaction

Admin_users = pgbouncer_admin

Stats_users = pgbouncer_guest

3. Add User Information

More user.txt

"Testuser" "testuser"

"Pgbouncer_admin" "pgbouncer_admin"

4. Start pgbouncer

Pgbouncer-d/opt/pgdata/pg_root/pgbouncer/config. ini

5. Test the connection

Psql-h 127.0.0.1-p 1688-d testdb-U testuser # testuser connects to testdb

Psql-h 127.0.0.1-p 1688-d pgbouncer-U pgbouncer_admin # Use pgbouncer to manage the user's access to its own database pgbouncer

6. View related information

Pgbouncer = # show help;

NOTICE: Console usage

DETAIL:

Show help | CONFIG | DATABASES | POOLS | CLIENTS | SERVERS | VERSION

Show stats | FDS | SOCKETS | ACTIVE_SOCKETS | LISTS | MEM

SHOW DNS_HOSTS | DNS_ZONES

SET key = arg

RELOAD

PAUSE [ ]

RESUME [ ]

KILL

SUSPEND

SHUTDOWN

Show config; # view related configurations

Show stats;

Show lists; # view connection information, such as the number of databases and number of idle connections

Show pools; # view the connection information in the pool

Show databases; # view related databases

Show clients; # view connections

If the configuration file is modified, reload is required to reload

Pgbouncer = # reload;

RELOAD

There are three connection methods, which have been described before and are not described in detail. The preceding parameters are described in detail in the doc directory of the source installation package.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.