赞
踩
@echo offtitle Sequoia RAIDb-1 demoecho ******************************************************echo ******************************************************echo ** **echo ** Please press a key when hsqldb servers are ready **echo ** **echo ******************************************************echo ******************************************************SET SEQUOIA_HOME="d:\sql\sequoia":begincd "%SEQUOIA_HOME%\bin"echo "Waiting for mysql servers to finish start up" echo "Starting Controller"start /B controller.bat -f ..\config\controller\controller-mysqlserver.xml:end
<?xml version="1.0" encoding="UTF-8" ?><!DOCTYPE SEQUOIA-CONTROLLER PUBLIC "-//Continuent//DTD SEQUOIA-CONTROLLER 2.10.10//EN" "http://sequoia.continuent.org/dtds/sequoia-controller-2.10.10.dtd"><SEQUOIA-CONTROLLER> <Controller ipAddress="127.0.0.1" port="25322"> <JmxSettings> <RmiJmxAdaptor port="1090"/> </JmxSettings> <VirtualDatabase configFile="mysqlserver-raidb1-distribution.xml" virtualDatabaseName="myDB" autoEnableBackends="true" checkpointName="Initial_empty_recovery_log"/> </Controller></SEQUOIA-CONTROLLER>
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE SEQUOIA PUBLIC "-//Continuent//DTD SEQUOIA 2.10.10//EN" "http://sequoia.continuent.org/dtds/sequoia-2.10.10.dtd"><SEQUOIA> <VirtualDatabase name="myDB"> <Distribution> <MessageTimeouts/> </Distribution> <Backup> <Backuper backuperName="Octopus" className="org.continuent.sequoia.controller.backup.backupers.OctopusBackuper" options="zip=true"/> </Backup> <AuthenticationManager> <Admin> <User username="admin" password=""/> </Admin> <VirtualUsers> <VirtualLogin vLogin="user" vPassword=""/> </VirtualUsers> </AuthenticationManager> <DatabaseBackend name="localhost1" driver="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost:3306/clusterdb" connectionTestStatement="select now()"> <ConnectionManager vLogin="user" rLogin="root" rPassword="zyx808"> <VariablePoolConnectionManager initPoolSize="10" minPoolSize="5" maxPoolSize="50" idleTimeout="30" waitTimeout="10"/> </ConnectionManager> </DatabaseBackend> <DatabaseBackend name="localhost2" driver="com.mysql.jdbc.Driver" url="jdbc:mysql://192.168.61.133:3306/clusterdb" connectionTestStatement="select now()"> <ConnectionManager vLogin="user" rLogin="test1" rPassword="abc"> <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="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost:3306/clusterdb" login="root" password="zyx808"> <RecoveryLogTable tableName="RECOVERY" logIdColumnType="BIGINT NOT NULL" vloginColumnType="VARCHAR(20) NOT NULL" sqlColumnName="sqlsrc" sqlColumnType="TEXT NOT NULL" sqlParamColumnType="TEXT" extraStatementDefinition=",PRIMARY KEY (log_id)"/> <CheckpointTable tableName="CHECK_POINT" checkpointNameColumnType="VARCHAR(127) NOT NULL"/> <BackendTable tableName="BACKEND" databaseNameColumnType="VARCHAR(50) NOT NULL" backendNameColumnType="VARCHAR(50) NOT NULL" checkpointNameColumnType="VARCHAR(127) NOT NULL"/> <DumpTable tableName="SEQUOIA_DUMP" dumpNameColumnType="TEXT NOT NULL" dumpDateColumnType="DATETIME" dumpPathColumnType="TEXT NOT NULL" dumpFormatColumnType="TEXT NOT NULL" checkpointNameColumnType="TEXT NOT NULL" backendNameColumnType="TEXT NOT NULL" tablesColumnType="TEXT NOT NULL"/> </RecoveryLog> </RequestManager> </VirtualDatabase></SEQUOIA>
<!--Total order protocol stack using the SEQUENCER protocolVersion: $Id: sequencer.xml,v 1.1 2006/06/26 13:08:47 emmanuel Exp $--><config> <UDP bind_addr="192.168.61.114" mcast_port="45566" mcast_addr="228.8.8.9" tos="16" ucast_recv_buf_size="20000000" ucast_send_buf_size="640000" mcast_recv_buf_size="25000000" mcast_send_buf_size="640000" loopback="false" discard_incompatible_packets="true" max_bundle_size="64000" max_bundle_timeout="30" use_incoming_packet_handler="true" use_outgoing_packet_handler="false" ip_ttl="2" down_thread="false" up_thread="false" enable_bundling="true"/> <PING timeout="2000" down_thread="false" up_thread="false" num_initial_members="3"/> <MERGE2 max_interval="10000" down_thread="false" up_thread="false" min_interval="5000"/> <FD_SOCK down_thread="false" up_thread="false"/> <!--VERIFY_SUSPECT timeout="1500" down_thread="false"/--> <pbcast.NAKACK max_xmit_size="60000" use_mcast_xmit="false" gc_lag="0" retransmit_timeout="100,200,300,600,1200,2400,4800" down_thread="false" up_thread="false" discard_delivered_msgs="true"/> <UNICAST timeout="300,600,1200,2400,3600" down_thread="false" up_thread="false"/> <pbcast.STABLE stability_delay="1000" desired_avg_gossip="50000" down_thread="false" up_thread="false" max_bytes="400000"/> <VIEW_SYNC avg_send_interval="60000" down_thread="false" up_thread="false" /> <pbcast.GMS print_local_addr="true" join_timeout="3000" down_thread="false" up_thread="false" join_retry_timeout="2000" shun="true" handle_concurrent_startup="true" /> <SEQUENCER down_thread="false" up_thread="false" /> <FC max_credits="2000000" down_thread="false" up_thread="false" min_threshold="0.10"/> <!-- FRAG2 frag_size="60000" down_thread="false" up_thread="true"/ --> <!-- pbcast.STATE_TRANSFER down_thread="false" up_thread="false"/--></config>
import java.sql.Connection;import java.sql.DriverManager;import java.sql.PreparedStatement;import java.sql.ResultSet;import java.sql.Statement;public class GenerateSampleData { public void generate() { Connection conn = null; Statement stmt = null; ResultSet rs=null; try { Class.forName("org.continuent.sequoia.driver.Driver").newInstance(); String url = "jdbc:sequoia://localhost:25322/myDB"; conn = DriverManager.getConnection(url, "user", ""); try { stmt = conn.createStatement(); stmt.executeUpdate("insert into user(id,name) values(9,'c')"); System.out.println("Update Record Success."); } catch (Exception ex) { ex.printStackTrace(); } finally { try { if(rs!=null) rs.close(); if (stmt != null) stmt.close(); if (conn != null) conn.close(); } catch (Exception e) { e.printStackTrace(); } } } catch (Exception e) { e.printStackTrace(); } } /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub GenerateSampleData g = new GenerateSampleData(); g.generate(); }}
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。