文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>voldemort 集群环境搭建

voldemort 集群环境搭建

时间:2010-05-28  来源:liukaiyi



伏地魔 下载 0.8 : http://github.com/voldemort/voldemort/downloads
官方的 quickstart :  http://project-voldemort.com/quickstart.php

服务器 : 1 - 47,2 - 62,0 - 207  ( 对等,无主从 )

voldemort 安装到 :
1,2,0 - /data/tools/voldemort-0.80.2/


测试 1 : NWR : 311  ( NWR  是什么 ?
  N - the replication factor (how many copies of each key-value pair we store)
  R - the number of reads required
  W- the number of writes we block fo
)
测试 1 -> 测试结果 :
  1. 正常启动
1,0,2 > /bin/bash /data/tools/voldemort-0.80.2/bin/voldemort-server.sh /data/tools/voldemort-0.80.2/config/test_config1
  # 路由 取值(成功)
  2. 1 > put "m2test" "liukaiyi"
     # version(服务器ID:数据在此服务器版本号)
     . 0> get "m2test"
            version(1:1): "liukaiyi"
     . 2 > get "m2test"
            version(1:1): "liukaiyi"
  # 强行关闭 47 - 1 服务器
  # N3 (0,2)其他服务器能取到备份值 , (非1)非原始存储 支持修改能成功。
  # 但 1 服务器从新开启 , 原来在非原始存储修改数据,不在 使用 在 nrw 311 下
  3. 1 server > 关闭
       . 重新连接 0 > get "m2test" #能取到值 同步 成功
       . 重新连接 2 > get "m2test" #能取到值 同步 成功
       #在 0 中写入
      . 0 > put "m2test" "lky"
      . 2 > get "m2test"
            version(1:1,2:1): "liukaiyi"
      #注意 这里 重新 开启 1 服务器 :
      0,1,2 > get "m2test"  #  version(1:1): "liukaiyi"

   # 修改  NWR 322
   0 > put "t1" "1"
         version(1:1): "liukaiyi"
   1 >  关闭 服务器 1
   2 > put "t1" "2"
         version(1:1,2:1): "lky"
   0 >  get "t1"
         version(1:1,2:1): "lky"
   1 > 服务器开启 get "t1" 
         version(1:1,2:1): "lky"


测试 1 (具体)-> 具体配置 :
配置文件:stores.xml
47,62,207 /data/tools/voldemort-0.80.2/config/test_config1/config/stores.xml

<stores>
  <!-- Note that "test" store requires 2 reads and writes,
     so to use this store you must have both nodes started and running -->
  <store>
    <name>test</name>
    <persistence>bdb</persistence>
    <routing>client</routing>

    <replication-factor>3</replication-factor>
    <required-reads>1</required-reads>
    <required-writes>1</required-writes>


    <key-serializer>
      <type>string</type>
    </key-serializer>
    <value-serializer>
      <type>string</type>
    </value-serializer>
    <retention-days>1</retention-days>
  </store>
</stores>




配置文件:cluster.xml
47,207,62 /data/tools/voldemort-0.80.2/config/test_config1/config/cluster.xml

<cluster>
        <name>mycluster</name>
        <server>
                <id>0</id>
                <host>192.*.*.207</host>
                <http-port>8081</http-port>
                <socket-port>6666</socket-port>
                <partitions>0, 1</partitions>
        </server>
        <server>
                <id>1</id>
                <host>192.*.*.47</host>
                <http-port>8082</http-port>
                <socket-port>6667</socket-port>
                <partitions>2, 3</partitions>
        </server>
        <server>
                <id>2</id>
                <host>192.*.*.62</host>
                <http-port>8083</http-port>
                <socket-port>6668</socket-port>
                <partitions>4, 5</partitions>
        </server>
</cluster>



配置文件:server.properties
/data/tools/voldemort-0.80.2/config/test_config1/config/server.properties

# The ID of *this* particular cluster node
# 这里特别注意 根据 cluster.xml <host> 对应 <id>
# 0 - 207 , 1 - 47 , 2 - 62
node.id=1
         
max.threads=100

############### DB options ######################
http.enable=true
socket.enable=true
jmx.enable=true

# BDB
bdb.write.transactions=false
bdb.flush.transactions=false
bdb.cache.size=100MB

# Mysql
mysql.host=localhost
mysql.port=1521
mysql.user=root
mysql.password=3306
mysql.database=test


相关阅读 更多 +
排行榜 更多 +
辰域智控app

辰域智控app

系统工具 下载
网医联盟app

网医联盟app

运动健身 下载
汇丰汇选App

汇丰汇选App

金融理财 下载