单节点部署试玩Dynomite

说明

dynomite使用netflix开源的一个开源将非分布式的缓存系统改造成分布式的缓存系统,根据亚马逊的Dynamo进行设计,是一个高可用,高性能,支持跨数据中副本的分布式存储代理层。根据Dynomite的拓扑图,我们创建一个单DC单Rack单个服务节点的dynomite存储层,后端存储使用的是redis。

安装redis

wget http://download.redis.io/releases/redis-3.2.3.tar.gz
tar zxf redis-3.2.3.tar.gz
cd redis-3.2.3
make install

启动redis

创建redis.conf,内容如下:

port 6379
protected-mode no

启动redis-server:

nohup ./redis-server redis.conf &

安装dynomite

$ yum install -y git autoconf automake libtool openssl-devel net-tools
$ git clone git@github.com:Netflix/dynomite.git
$ git checkout master
$ cd dynomite
$ autoreconf -fvi
$ ./configure --enable-debug=log
$ make
$ src/dynomite -h

创建工作目录

$ mkdir -p /home/vagrant/dynomite-test/dynomite/bin
$ mkdir -p /home/vagrant/dynomite-test/dynomite/conf
$ mkdir -p /home/vagrant/dynomite-test/dynomite/log

在conf目录下创建node1.yml文件并写入以下内容:

dyn_o_mite:
  datacenter: dc1
  rack: rack1
  dyn_listen: 192.168.100.100:8101
  data_store: 0
  listen: 192.168.100.100:8102
  dyn_seed_provider: simple_provider
  servers:
  - 192.168.100.100:6379:1
  tokens: 0
  pem_key_file: /apps/dynomite/conf/dynomite.pem

启动Dynomite

./bin/dynomite -c conf/node1.yml -o log/node1.log -d

使用redis-cli测试

./redis-cli -h 192.168.100.100 -p 8102
192.168.100.100:8102> set ca California
OK
192.168.100.100:8102> set ca California
OK
192.168.100.100:8102> get ca
"California"
192.168.100.100:8102> set ca California2
OK
192.168.100.100:8102> get ca
"California2"
192.168.100.100:8102> exit

参考

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>