人气旺 发表于 2014-9-28 10:04:02

Tokumx 代替 Mongodb 群集部署

一, 配置环境:

系统: CentOS 7 x64

tokumx1 ip: 192.168.0.155
tokumx2 ip: 192.168.0.156
tokumx3 ip: 192.168.0.157

二, 部署前准备:

useradd -u 1002 tokumx

tar zxvf tokumx-1.5.1-linux-x86_64-main.tar.gz

mv tokumx-1.5.1-linux-x86_64 /opt/local/tokumx/

mkdir -p /opt/local/tokumx/data/shard
mkdir -p /opt/local/tokumx/data/logs
mkdir -p /opt/local/tokumx/data/config

chown -R tokumx:tokumx /opt/local/tokumx


三, 增加配置文件

vi /opt/local/tokumx/tokumx.conf
-----------------------------------------------------------------
port=27017
fork=true
logpath=/opt/local/tokumx/data/logs/shard.log
pidfilepath=/opt/local/tokumx/tokumx.pid
logappend=true
dbpath=/opt/local/tokumx/data/shard/
shardsvr=true
directio=true
maxConns=20000
replSet=shard1
oplogSize=5000
cacheSize=8G
expireOplogDays=15                  
--------------------------------------------------------------------


四, 启动tokumx 实例

启动之前需要关闭hugepages:
echo never > /sys/kernel/mm/transparent_hugepage/enabled

/opt/local/tokumx/bin/mongod -f /opt/local/tokumx/tokumx.conf


五, 初始化replica set

/opt/local/tokumx/bin/mongo


config={
"_id" : "shard1",
"members" : [
{"_id" : 0, "host" : "192.168.0.155:27017"},
{"_id" : 1, "host" : "192.168.0.156:27017"},
{"_id" : 2, "host" : "192.168.0.157:27017"}
]
}
rs.initiate(config)

然后查看集群运行情况:
rs.status()

固定 主服务器
cfg = rs.conf()
cfg.members.priority = 1
cfg.members.priority = 0.5
cfg.members.priority = 0.5
rs.reconfig(cfg)


页: [1]
查看完整版本: Tokumx 代替 Mongodb 群集部署