I haven't written anything for a long time. I have been reading some open-source things. I have posted the installation and configuration of ipvs on linux and the reference for using dblink for readers and their reference in the future. 1. Download the source code: postgresql-9.3.2.tar.gz2, create your scluster group, and user: groupaddjavassuseraddpostgres-dhomepostgres
I haven't written anything for a long time. I have been reading some open-source things. I have posted the installation and configuration of ipvs on linux and the reference for using dblink for readers and their reference in the future. 1. Download the source code: postgresql-9.3.2.tar.gz 2. Create ipvs cluster group and user: groupadd postgres useradd postgres-d/home/postgres
I haven't written anything for a long time. I have been reading some open-source things. Next I will post the installation and configuration of ipvs on linux and the reference for using dblink for readers and their future reference:
1, download source code: postgresql-9.3.2.tar.gz
2. Create the ipvs cluster group and users:
Groupadd postgres
Useradd s-d/home/postgres-g postgres
Mkdir-p/usr/local/pgsql
Mkdir-p/use/local/pgsql/data
Chown-R postgres. postgres/usr/local/pgsql
Passwd ipvs
Su-postgres
Cd
Vi bash_profile
Export PGHOME =/usr/local/pgsql
Export PGDATA =/usr/local/pgsql/data
Export PATH = $ PATH:/usr/local/pgsql/bin
.. Bash_profile
3. Upload the source code file to the database server:
/Usr/local/pgsql/postgresql-9.3.2.tar.gz
Cd/usr/local/pgsql
Tar zxf postgresql-9.3.2.tar.gz
4. Configure and install the database:
Cd/usr/local/plsql/postgresql-9.3.2
Configure
Make
Su-
Make install
5. initialize the database:
/Usr/local/pgsql/bin/initdb-D/usr/local/pgsql/data
6. configuration parameter file:
Cd/usr/local/pgsql/data
Vi postgresql. conf
-- Listener and Port
7. Configure logon security rules:
Vi pg_hba.conf
8. log on to ipvs and change the password:
Psql S postgres
Alter user Login s password 'test ';
9. Configure dblink:
Cd/usr/local/pgsql/postgresql-9.3.2/contrib/dblink
Make
Su
Make install
Psql S postgres
Create extension dblink;
Select * from pg_extension;
10. Create and use dblink
Psql test
Select dblink_connect ('test _ dblink', 'dbname = s host = 192.168.109.10 port = 1921 user = s password = test ');
Select * from dblink ('test _ dblink', 'select c1, c3 from ttt') as t1 (c1 integer, c2 varchar );
Select dblink_disconnect ('test _ dblink ');
Select dblink_get_connections ();