My servers setting:
Server1 : lb_1, cluster_1
Server2 : cluster_2, rep_1
----------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------
Load Balance server conf:pglb.conf
<Cluster_Server_Info>
<Host_Name> cluster_1 </Host_Name>
<Port> 5432 </Port>
<Max_Connect> 3 </Max_Connect>
</Cluster_Server_Info>
<Cluster_Server_Info>
<Host_Name> cluster_2 </Host_Name>
<Port> 5432 </Port>
<Max_Connect> 3 </Max_Connect>
</Cluster_Server_Info>
<Host_Name> lb_1 </Host_Name>
<Backend_Socket_Dir> /tmp </Backend_Socket_Dir>
<Receive_Port> 5433 </Receive_Port>
<Recovery_Port> 6101 </Recovery_Port>
<Max_Cluster_Num> 128 </Max_Cluster_Num>
<Use_Connection_Pooling> no
</Use_Connection_Pooling>
<LifeCheck_Timeout> 3s </LifeCheck_Timeout>
<LifeCheck_Interval> 15s </LifeCheck_Interval>
#<Connection_Life_Time> 0s
</Connection_Life_Time>
<Log_File_Info>
<File_Name> /tmp/pglb.log </File_Name>
<File_Size> 1M </File_Size>
<Rotate> 3 </Rotate>
</Log_File_Info>
-------------------------------------------------------------------------------------------
cluster_1 conf:
<Replicate_Server_Info>
<Host_Name> rep_1 </Host_Name>
<Port> 8001 </Port>
<Recovery_Port> 8101
</Recovery_Port>
</Replicate_Server_Info>
<Host_Name> cluster_1 </Host_Name>
<Recovery_Port> 7001
</Recovery_Port>
<Rsync_Path> /usr/bin/rsync
</Rsync_Path>
<Rsync_Option> ssh -1
</Rsync_Option>
<Rsync_Compress> yes
</Rsync_Compress>
<Rsync_Timeout> 10min
</Rsync_Timeout>
<Rsync_Bwlimit> 0KB
</Rsync_Bwlimit>
<Pg_Dump_Path> /usr/bin/pg_dump
</Pg_Dump_Path>
#<Ping_Path> /bin/ping </Ping_Path>
<When_Stand_Alone> read_only
</When_Stand_Alone>
<Replication_Timeout> 1min
</Replication_Timeout>
<LifeCheck_Timeout> 3s
</LifeCheck_Timeout>
<LifeCheck_Interval> 11s
</LifeCheck_Interval>
---------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------
cluster_2 conf:
<Replicate_Server_Info>
<Host_Name> rep_1 </Host_Name>
<Port> 8001 </Port>
<Recovery_Port> 8101
</Recovery_Port>
</Replicate_Server_Info>
<Host_Name> cluster_2 </Host_Name>
<Recovery_Port> 7001
</Recovery_Port>
<Rsync_Path> /usr/bin/rsync
</Rsync_Path>
<Rsync_Option> ssh -1
</Rsync_Option>
<Rsync_Compress> yes
</Rsync_Compress>
<Rsync_Timeout> 10min
</Rsync_Timeout>
<Rsync_Bwlimit> 0KB
</Rsync_Bwlimit>
<Pg_Dump_Path> /usr/bin/pg_dump
</Pg_Dump_Path>
#<Ping_Path> /bin/ping </Ping_Path>
<When_Stand_Alone> read_only
</When_Stand_Alone>
<Replication_Timeout> 1min
</Replication_Timeout>
<LifeCheck_Timeout> 3s
</LifeCheck_Timeout>
<LifeCheck_Interval> 11s
</LifeCheck_Interval>
----------------------------------------------------------------------------------------------
replicator_1 conf
<Cluster_Server_Info>
<Host_Name> cluster_1 </Host_Name>
<Port> 5432 </Port>
<Recovery_Port> 7001
</Recovery_Port>
</Cluster_Server_Info>
<Cluster_Server_Info>
<Host_Name> cluster_2 </Host_Name>
<Port> 5432 </Port>
<Recovery_Port> 7001
</Recovery_Port>
</Cluster_Server_Info>
<LoadBalance_Server_Info>
<Host_Name> lb_1 </Host_Name>
<Recovery_Port> 6101
</Recovery_Port>
</LoadBalance_Server_Info>
<Host_Name> rep_1 </Host_Name>
<Replication_Port> 8001
</Replication_Port>
<Recovery_Port> 8101
</Recovery_Port>
<RLOG_Port> 8301 </RLOG_Port>
<Response_Mode> normal
</Response_Mode>
<Use_Replication_Log> no
</Use_Replication_Log>
<Replication_Timeout> 1min
</Replication_Timeout>
<LifeCheck_Timeout> 3s
</LifeCheck_Timeout>
<LifeCheck_Interval> 15s
</LifeCheck_Interval>
<Log_File_Info>
<File_Name> /tmp/pgreplicate.log </File_Name>
<File_Size> 1M </File_Size>
<Rotate> 3 </Rotate>
</Log_File_Info>
---------------------------------------------------------------------------------------------------
I just configured like this.
And my index.php has pg_connect(host=cluter_1's full dns port = 5432
dbname=database user=user)
and I stopped the database in cluster_1.
And try to connect to database in cluster_2 through index.php.
But I can't.
I think load balance server should have that request and find out the
cluster_1 is down and sepearate and use database 2 from cluster_2.
And I set log file like the above but nothing is written there.
Am I missing something?
thanks,
On Wed, May 28, 2008 at 10:30 PM, <[EMAIL PROTECTED]> wrote:
> Hi,
>
> The load balncer has current session numbers of each cluster db.
> The maximum session number of each cluster db is defined in "pglb.conf".
> Then, load balancer consider the load as "(connected sessions)/(max
> sessions)".
> It is consider neither connecting times nor cpu load.
> It is using just number of sessions.
>
> About the pg_connect error.
> Can you let us know the debug messages of replication server.
> Probably, we can find something in the debug log.
>
> Regards,
> --------------
> At.Mitani
>
> -- original message --
> From: Chahyeon Rhee<[EMAIL PROTECTED]>
> To: <[email protected]>
> Sent: Wed, 28 May 2008 17:03:31 -0600
> Subject: [Pgcluster-general] concept of load balance server
>
> >Hi!
> >I am setting up load balance and cluster db1 in server 1
> >and replicator and cluster db2 in server 2.
> >I just tested replication and restoration.
> >Now, I would like to test load balance. But, I am little bit confused.
> >What I am thinking is that I think if client request some then they will
> go
> >to some page in server 1.
> >Which is starting point. So I used pg_connect(host=server1 port=5433
> dbname=
> >... )
> >What I am thinking is if that connection go to load balance server in port
> >5433 then load balance server will determine which is lower load from
> >server1 and server 2. Server 1 and server 2 has port 5432. And the
> selected
> >database will be used for that service.
> >Is that right ?
> >If not, please give me any advice.
> >Also when I am doing like this, I am getting this error message *
> >Warning*: pg_connect()
> >[function.pg-connect<
> http://seo.gkmc.utah.edu/cha_test/pgcluster/function.pg-connect>]:
> >Unable to connect to PostgreSQL server: server closed the connection
> >unexpectedly This probably means the server terminated abnormally before
> or
> >while processing the request.
> >
> >If you know about this, please give me some help.
> >
> >Thanks,
> >
> >_______________________________________________
> >Pgcluster-general mailing list
> >[email protected]
> >http://pgfoundry.org/mailman/listinfo/pgcluster-general
> >
>
> _______________________________________________
> Pgcluster-general mailing list
> [email protected]
> http://pgfoundry.org/mailman/listinfo/pgcluster-general
>
_______________________________________________
Pgcluster-general mailing list
[email protected]
http://pgfoundry.org/mailman/listinfo/pgcluster-general