Hi Emmanuel,

All I want to do is to load balance/failover the database.

Basically, [EMAIL PROTECTED] and [EMAIL PROTECTED], each is
connecting to a postgresql backend locally. However,  the virtual database
test is only hosted by its local controller, rather than both of the
controllers. In addition, when I tried to test the cluster, by connecting to
jdbc:sequoia://192.168.5.1,192.168.5.2/test, and creating a new table, the
changes were only reflected on its local postgresql backend, rather than on
both postgresql backends.

Below are the configurations I used, where 192.168.5.1 and 192.168.5.2 refer
to two separate machines.

   1. [EMAIL PROTECTED]


   - controller.xml

<SEQUOIA-CONTROLLER>
    <Controller ipAddress="192.168.5.1" port="25322">
        <JmxSettings>
            <RmiJmxAdaptor port="1090"/>
        </JmxSettings>

        <VirtualDatabase configFile="postgresl-cluster-prod0.xml"
virtualDatabaseName="test" autoEnableBackends="true"/>
    </Controller>
</SEQUOIA-CONTROLLER>


   -      postgresl-cluster-prod0.xml

<SEQUOIA>

  <VirtualDatabase name="test">

   <Distribution hederaPropertiesFile="/hedera_appia.properties">
        <MessageTimeouts/>
   </Distribution>

  <Backup>
        <Backuper backuperName="postgres"
className="org.continuent.sequoia.controller.backup.backupers.PostgreSQLSplitPlainTextBackuper"
         options="dumpServer=192.168.5.1,encoding=UTF8,splitSize=500m"/>
  </Backup>

  <AuthenticationManager>
      <Admin>
        <User username="admin" password=""/>
      </Admin>
      <VirtualUsers>
        <VirtualLogin vLogin="" vPassword=""/>
      </VirtualUsers>
    </AuthenticationManager>

   <DatabaseBackend name="postgresql-prod0-test"
driver="org.postgresql.Driver" url="jdbc:postgresql://
192.168.5.1:5432/jmangotest" connectionTestStatement="select now()">
          <DatabaseSchema dynamicPrecision="table"/>
      <ConnectionManager vLogin=" " rLogin=" " rPassword=" ">
        <VariablePoolConnectionManager initPoolSize="20" minPoolSize="5"
maxPoolSize="0" idleTimeout="180" waitTimeout="0"/>
      </ConnectionManager>
    </DatabaseBackend>

   <RequestManager>
     <RequestScheduler>
          <RAIDb-1Scheduler level="passThrough"/>
     </RequestScheduler>


      <RequestCache>
         <MetadataCache/>
         <ParsingCache/>
         <ResultCache granularity="table" />
      </RequestCache>

      <LoadBalancer>
          <RAIDb-1>
            <WaitForCompletion policy="first"/>
            <RAIDb-1-LeastPendingRequestsFirst/>
          </RAIDb-1>
      </LoadBalancer>

      <RecoveryLog driver="org.postgresql.Driver" url="jdbc:postgresql://
192.168.5.1:5432/recovery" login=" " password=" ">
        <RecoveryLogTable/>
        <CheckpointTable/>
        <BackendTable/>
        <DumpTable/>
      </RecoveryLog>

    </RequestManager>

  </VirtualDatabase>

</SEQUOIA>

    2.  [EMAIL PROTECTED]


   - controller.xml

<SEQUOIA-CONTROLLER>
    <Controller ipAddress="192.168.5.2" port="25322">
        <JmxSettings>
            <RmiJmxAdaptor port="1090"/>
        </JmxSettings>

        <VirtualDatabase configFile="postgresl-cluster-prod1.xml"
virtualDatabaseName="test" autoEnableBackends="true"/>
    </Controller>
</SEQUOIA-CONTROLLER>

   - postgresl-cluster-prod1.xml


<SEQUOIA>

  <VirtualDatabase name="test">

   <Distribution hederaPropertiesFile="/hedera_appia.properties">
        <MessageTimeouts/>
   </Distribution>

  <Backup>
        <Backuper backuperName="postgres"
className="org.continuent.sequoia.controller.backup.backupers.PostgreSQLSplitPlainTextBackuper"
         options="dumpServer=192.168.5.2,encoding=UTF8,splitSize=500m"/>
  </Backup>

  <AuthenticationManager>
      <Admin>
        <User username="admin" password=""/>
      </Admin>
      <VirtualUsers>
        <VirtualLogin vLogin="sa" vPassword="passw0rd"/>
      </VirtualUsers>
    </AuthenticationManager>

   <DatabaseBackend name="postgresql-prod1-test"
driver="org.postgresql.Driver" url="jdbc:postgresql://
192.168.5.2:5432/jmangotest" connectionTestStatement="select now()">
          <DatabaseSchema dynamicPrecision="table"/>
      <ConnectionManager vLogin=" " rLogin=" " rPassword=" ">
        <VariablePoolConnectionManager initPoolSize="20" minPoolSize="5"
maxPoolSize="0" idleTimeout="180" waitTimeout="0"/>
      </ConnectionManager>
    </DatabaseBackend>

     <RequestManager>
     <RequestScheduler>
          <RAIDb-1Scheduler level="passThrough"/>
     </RequestScheduler>


      <RequestCache>
         <MetadataCache/>
         <ParsingCache/>
         <ResultCache granularity="table" />
      </RequestCache>

      <LoadBalancer>
          <RAIDb-1>
            <WaitForCompletion policy="first"/>
            <RAIDb-1-LeastPendingRequestsFirst/>
          </RAIDb-1>
      </LoadBalancer>

      <RecoveryLog driver="org.postgresql.Driver" url="jdbc:postgresql://
192.168.5.2:5432/recovery" login=" " password="">
        <RecoveryLogTable/>
        <CheckpointTable/>
        <BackendTable/>
        <DumpTable/>
      </RecoveryLog>

    </RequestManager>

  </VirtualDatabase>

</SEQUOIA>
_______________________________________________
Sequoia mailing list
[email protected]
https://forge.continuent.org/mailman/listinfo/sequoia

Reply via email to