ObjectWeb Consortium
Search ObjectWeb Mail Archive: 

Advanced Search - Powered by Google


Mail Archive Home | c-jdbc List | August 2006 Index

<--  Date Index  --> <--  Thread Index  -->

nested raidb1-0?


hello all!
I'd like to config the MySQL cluster with full mirroring and partitioning
pls help me get proper config xml files and example of getting connection 
from my application to it.
i tried to do it myself:
1. i've done 3 controllers -
<C-JDBC-CONTROLLER>
  <Controller port="25322">
    <Report/>
    <JmxSettings>
      <RmiJmxAdaptor port="1090"/>
    </JmxSettings>
    <VirtualDatabase configFile="cjdbc-RAIDb1.xml" virtualDatabaseName="vdb" 
autoEnableBackends="true" checkpointName="Initial_empty_recovery_log"/>
   </Controller>
</C-JDBC-CONTROLLER>

<C-JDBC-CONTROLLER>
  <Controller port="25323">
    <Report/>
    <JmxSettings>
      <RmiJmxAdaptor port="1091"/>
    </JmxSettings>
    <VirtualDatabase configFile="mysql-RAIDb0-1.xml" 
virtualDatabaseName="vdb1" autoEnableBackends="true"/>
    </Controller>
</C-JDBC-CONTROLLER>

<C-JDBC-CONTROLLER>
  <Controller port="25324">
    <Report/>
    <JmxSettings>
      <RmiJmxAdaptor port="1093"/>
    </JmxSettings>
    <VirtualDatabase configFile="mysql-RAIDb0-2.xml" 
virtualDatabaseName="vdb1" autoEnableBackends="true"/>
  </Controller>
</C-JDBC-CONTROLLER>

2. then get 3 xml files like follows - 
<C-JDBC>
  <VirtualDatabase name="vdb">
        ...
     <DatabaseBackend name="raidb0-3306" 
driver="org.objectweb.cjdbc.driver.Driver"
      url="jdbc:cjdbc://localhost:25323/vdb1"
      connectionTestStatement="values 1">
      <ConnectionManager vLogin="user" rLogin="user" rPassword="">
        <VariablePoolConnectionManager initPoolSize="10" minPoolSize="5"
          maxPoolSize="50" idleTimeout="30" waitTimeout="10"/>
      </ConnectionManager>

    </DatabaseBackend>
     <DatabaseBackend name="raidb0-3307" 
driver="org.objectweb.cjdbc.driver.Driver"
      url="jdbc:cjdbc://localhost:25324/vdb1"
      connectionTestStatement="values 1">
      <ConnectionManager vLogin="user" rLogin="user" rPassword="">
        <VariablePoolConnectionManager initPoolSize="10" minPoolSize="5"
          maxPoolSize="50" idleTimeout="30" waitTimeout="10"/>
      </ConnectionManager>
    </DatabaseBackend>

    <RequestManager>
      <RequestScheduler>
         <RAIDb-1Scheduler level="passThrough"/>
      </RequestScheduler>
...
<LoadBalancer>
         <RAIDb-1>
            <WaitForCompletion policy="first"/>
            <RAIDb-1-LeastPendingRequestsFirst/>
         </RAIDb-1>
      </LoadBalancer>
        <RecoveryLog driver="org.gjt.mm.mysql.Driver"
        url="jdbc:mysql://localhost:3306/backup" login="niki" 
password="niki71">
        <RecoveryLogTable tableName="dblogtable"/>
        <CheckpointTable tableName="dbcheckpointtable"/>
        <BackendTable tableName="backendtable"/>
        <DumpTable tablesColumnName="tables1"/>
        </RecoveryLog>
    </RequestManager>

  </VirtualDatabase>

</C-JDBC>

<C-JDBC>
  <VirtualDatabase name="vdb1">
<DatabaseBackend name="db0" driver="org.gjt.mm.mysql.Driver"
      url="jdbc:mysql://localhost:3306/stat0"
      connectionTestStatement="select 1">
      <DatabaseSchema dynamicPrecision="column"/>
      <ConnectionManager vLogin="user" rLogin="niki" rPassword="niki71">
        <VariablePoolConnectionManager initPoolSize="10" minPoolSize="5"
          maxPoolSize="50" idleTimeout="30" waitTimeout="10"/>
      </ConnectionManager>
    </DatabaseBackend>

    <DatabaseBackend name="db1" driver="org.gjt.mm.mysql.Driver"
      url="jdbc:mysql://localhost:3306/stat1"
      connectionTestStatement="select 1">
      <DatabaseSchema dynamicPrecision="column"/>
      <ConnectionManager vLogin="user" rLogin="niki" rPassword="niki71">
        <VariablePoolConnectionManager initPoolSize="10" minPoolSize="5"
          maxPoolSize="50" idleTimeout="30" waitTimeout="10"/>
      </ConnectionManager>
    </DatabaseBackend>

    <DatabaseBackend name="db2" driver="org.gjt.mm.mysql.Driver"
      url="jdbc:mysql://localhost:3306/stat2"
      connectionTestStatement="select 1">
      <DatabaseSchema dynamicPrecision="column"/>
      <ConnectionManager vLogin="user" rLogin="niki" rPassword="niki71">
        <VariablePoolConnectionManager initPoolSize="10" minPoolSize="5"
          maxPoolSize="50" idleTimeout="30" waitTimeout="10"/>
      </ConnectionManager>
    </DatabaseBackend>

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

      <LoadBalancer>
        <RAIDb-0/>       
      </LoadBalancer>  
       
      </RequestManager>

  </VirtualDatabase>

</C-JDBC>

 and
<C-JDBC>
  <VirtualDatabase name="vdb1">
<DatabaseBackend name="db0" driver="org.gjt.mm.mysql.Driver"
      url="jdbc:mysql://localhost:3307/stat0"
      connectionTestStatement="select 1">
      <ConnectionManager vLogin="user" rLogin="root" rPassword="niki">
        <VariablePoolConnectionManager initPoolSize="10" minPoolSize="5"
          maxPoolSize="50" idleTimeout="30" waitTimeout="10"/>
      </ConnectionManager>
    </DatabaseBackend>

    <DatabaseBackend name="db1" driver="org.gjt.mm.mysql.Driver"
      url="jdbc:mysql://localhost:3307/stat1"
      connectionTestStatement="select 1">
      <ConnectionManager vLogin="user" rLogin="root" rPassword="niki">
        <VariablePoolConnectionManager initPoolSize="10" minPoolSize="5"
          maxPoolSize="50" idleTimeout="30" waitTimeout="10"/>
      </ConnectionManager>
    </DatabaseBackend>

    <DatabaseBackend name="db2" driver="org.gjt.mm.mysql.Driver"
      url="jdbc:mysql://localhost:3307/stat2"
      connectionTestStatement="select 1">
      <ConnectionManager vLogin="user" rLogin="root" rPassword="niki">
        <VariablePoolConnectionManager initPoolSize="10" minPoolSize="5"
          maxPoolSize="50" idleTimeout="30" waitTimeout="10"/>
      </ConnectionManager>
    </DatabaseBackend>

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

<LoadBalancer>
        <RAIDb-0/>
      </LoadBalancer>  
       
      </RequestManager>

  </VirtualDatabase>

</C-JDBC>

Then from my application I get connection as
Class.forName("org.objectweb.cjdbc.driver.Driver");
Connection conn = 
DriverManager.getConnection("jdbc:cjdbc://localhost:25322/vdb?user=user");

I want(if possible) to get one connection to update/insert records into both 
ends of the vdb named "vdb" and select records from any end, but they are not 
of MySQL type(they are cjdbc).
If i use
Connection conn = 
DriverManager.getConnection("jdbc:cjdbc://localhost:25323,localhost:25324/vdb1?user=user");
I can select but not full mirroring in all ends when update/insert

Thanks, in advance
            



<--  Date Index  --> <--  Thread Index  -->

Reply via email to:

Powered by MHonArc.

Copyright © 1999-2005, ObjectWeb Consortium | contact | webmaster.