|
NAMEpostgresql-relay - multiplex all your databases to one point of originSYNOPSISpostgresql-relay [options]DESCRIPTIONpostgresql-relay can be used to as a single point of origin for all your databases. Instead of having to remember (or modify in case of changes) all the names of your databases, on which machines and on which ports they are running, you only need to remember one machine and the name of the database. The postgresql-relay will then forward the connection to the proper database on the proper port of the proper server. No more changes in the hundreds of clients and scripts!Options are:
CONFIGURATION FILEEach line in the configuration file has five fields, seperated by colons:The first field is the incoming port for clients. For the easiest configuration on the client-side, keep this all the same (say port 5432 as the standard postgresql port). The second field is the name of the database the client wants to connect to. This doesn't have to be the name of the database on the server connecting to. The third field is the name of the host the database is located on. The fourth field is the port the database is listening on. The fifth field is the name of the database to connect to.
CONFIGURATION FILE EXAMPLES Say you have two databases, one named mail on the local machine on port 5444 and one named users on the machine foo on port 5445. The configuration file would then be: 5432:mail:localhost:5444:mail 5432:users:foo:5445:users With this configuration, Postgresql-relay will listen on port 5432 and forward connections to the mail and users databases. EXAMPLESStart the relay with a non-standard configuration file and keep it in the foreground:postgresql-relay -c /usr/local/etc/postgresql-relay.conf.test -f Now, in a different terminal, connect to to mail database: psql -h dbserver -p 5432 -U root mail FILESpostgresql-relay.conf, most likely in /usr/local/etc.SECURITYPostgresql-relay supports tcpwrappers. For access to postgresql-relay the daemon is called postgresql. For access to a database the daemon is called postgresql-dbname.In the following example, the localhost and the hosts in the 10/8 network have access to postgresql-relay, while only the localhost and the 10.10.10.0/8 network have access to the database 'fdc': postgresql : 10.0.0.0/255.0.0.0 : allow postgresql : 127.0.0.1 : allow postgresql : ALL : deny postgresql-mail : 10.10.10.0/255.255.255.0 : deny postgresql-mail : 127.0.0.1 : allow postgresql-mail : ALL : deny LOGGINGLogging goes to syslog, to the facility daemon.NOTESIt would be best practise if the name of the machine on which postgresql-relay is running would have an alias in DNS, so that even if the machine on which postgresql-relay is running changes, the scripts don't have to be updated. A recommended name is dbrelay.BUGSIf the communication protocol version is unknown, it should fail properly but this hasn't been tested.AUTHOREdwin Groothuis, edwin@mavetju.org (http://www.mavetju.org)SEE ALSOpsql(1)
Visit the GSP FreeBSD Man Page Interface. |