- 论坛徽章:
- 0
|
[root@localhost ~]# vi /usr/local/amoeba/conf/amoeba.xml
<?xml version="1.0" encoding="gbk"?>
<!DOCTYPE amoeba:configuration SYSTEM "amoeba.dtd">
<amoeba:configuration xmlns:amoeba="http://amoeba.meidusa.com/">
<server>
<!-- proxy server掳?亩丝?-->
<property name="port">8066</property>
<!-- proxy server掳??P -->
<property name="ipAddress">192.168.18.119</property>
<!-- proxy server net IO Read thread size -->
<property name="readThreadPoolSize">100</property>
<!-- proxy server client process thread size -->
<property name="clientSideThreadPoolSize">80</property>
<!-- mysql server data packet process thread size -->
<property name="serverSideThreadPoolSize">100</property>
<!-- socket Send and receive BufferSize(unit:K) -->
<!-- 露?芒证碌?没搂? -->
<property name="user">root</property>
<!-- 露?芒证碌??毛->
<property name="password">justdoit</property>
<!-- query timeout( default: 60 second , TimeUnit:second) -->
<property name="queryTimeout">60</property>
</server>
<!--
每赂枚nectionManager露录陆芦?为一赂枚??拢
manager赂潞?Connection IO露?麓/??录矛
-->
<connectionManagerList>
<!--
default value is avaliable Processors
<property name="processors">5</property>
-->
</connectionManager>
</connectionManagerList>
<dbServerList>
<!--
一台mysqlServer ?要??一赂枚l拢卢
?鹿没 平碌鹊?ysql?要陆酶adBalance拢卢
平台?戮颅?鹿漏一赂枚懈潞?戮霉f碌?bjectPool拢潞com.meidusa.amoeba.mysql.server.MultipleS
录??盲???录??virtual="true",赂?ool 虏禄????factoryConfig
禄貌约潞写一赂枚ectPool隆拢
-->
<dbServer name="server1">
<!-- PoolableObjectFactory实?? -->
<factoryConfig class="com.meidusa.amoeba.mysql.net.MysqlServerConnectionFactory">
<property name="manager">defaultManager</property>
<!-- ?实mysql?戮菘芒驴?-->
<property name="port">3306</property>
<!-- ?实mysql?戮菘芒 -->
<property name="ipAddress">192.168.18.117</property>
<property name="schema">test</property>
<!-- ??碌?陆mysql碌?没搂? -->
<property name="user">root</property>
<!-- ??碌?陆mysql碌??毛->
<property name="password">justdoit</property>
</factoryConfig>
<!-- ObjectPool实?? -->
<poolConfig class="com.meidusa.amoeba.net.poolable.PoolableObjectPool">
<property name="maxActive">200</property>
<property name="maxIdle">200</property>
<property name="minIdle">10</property>
<property name="minEvictableIdleTimeMillis">600000</property>
<property name="timeBetweenEvictionRunsMillis">600000</property>
<property name="testOnBorrow">true</property>
<property name="testWhileIdle">true</property>
</poolConfig>
</dbServer>
<dbServer name="server2">
<!-- PoolableObjectFactory实?? -->
<factoryConfig class="com.meidusa.amoeba.mysql.net.MysqlServerConnectionFactory">
<property name="manager">defaultManager</property>
<!-- ?实mysql?戮菘芒驴?-->
<property name="port">3306</property>
<!-- ?实mysql?戮菘芒 -->
<property name="ipAddress">192.168.18.118</property>
<property name="schema">test</property>
<!-- ??碌?陆mysql碌?没搂? -->
<property name="user">root</property>
<!-- ??碌?陆mysql碌??毛->
<property name="password">justdoit</property>
</factoryConfig>
<!-- ObjectPool实?? -->
<poolConfig class="com.meidusa.amoeba.net.poolable.PoolableObjectPool">
<property name="maxActive">200</property>
<property name="maxIdle">200</property>
<property name="minIdle">10</property>
<property name="minEvictableIdleTimeMillis">600000</property>
<property name="timeBetweenEvictionRunsMillis">600000</property>
<property name="testOnBorrow">true</property>
<property name="testWhileIdle">true</property>
</poolConfig>
</dbServer>
<dbServer name="master" virtual="true">
<poolConfig class="com.meidusa.amoeba.server.MultipleServerPool">
<!-- 赂潞?戮霉? 1=ROUNDROBIN , 2=WEIGHTBASED , 3=HA-->
<property name="loadbalance">1</property>
<!-- 虏?毛pool赂潞?戮霉poolName?卤铆露潞潞欧指卯->
<property name="poolNames">server1</property>
</poolConfig>
</dbServer>
<dbServer name="slave" virtual="true">
<poolConfig class="com.meidusa.amoeba.server.MultipleServerPool">
<!-- 赂潞?戮霉? 1=ROUNDROBIN , 2=WEIGHTBASED , 3=HA-->
<property name="loadbalance">1</property>
<!-- 虏?毛pool赂潞?戮霉poolName?卤铆露潞潞欧指卯->
<property name="poolNames">server1,server2</property>
</poolConfig>
</dbServer>
</dbServerList>
<queryRouter class="com.meidusa.amoeba.mysql.parser.MysqlQueryRouter">
<property name="ruleConfig">${amoeba.home}/conf/rule.xml</property>
<property name="functionConfig">${amoeba.home}/conf/functionMap.xml</property>
<property name="ruleFunctionConfig">${amoeba.home}/conf/ruleFunctionMap.xml</property>
<property name="LRUMapSize">1500</property>
<property name="defaultPool">master</property>
<property name="writePool">master</property>
<property name="readPool">slave</property>
<property name="needParse">true</property>
</queryRouter>
</amoeba:configuration> |
|