第一步执行
docker run -itd --net shadownet --privileged=true --ip 172.18.0.20 -d -p 7003:7003 -p 7004:7004 -p 7005:7005 -p 17003:17003 -p 17004:17004 -p 17005:17005 centos /bin/bash
第二步执行
tar -zxvf redis-3.2.4
进入redis-3.2.4目录进行编译
make && make install
redis-trib.rb 复制到 /usr/local/bin 目录下
在redis3.2.4目录下创建集群节点目录 cluster 然后在里边创建3个节点目录 7003 7004 7005
将 redis.conf 拷贝到这三个目录中
修改redis.conf配置文件
启动redis
创建集群
yum -y
install
ruby ruby-devel rubygems rpm-build
gem
install
redis
再次执行上面的创建集群命令
启动会遇上
The TCP backlog setting of511 cannot be enforced because /proc/sys/net/core/somaxconn is set tothe lower value of 128.
echo "net.core.somaxconn = 551" > /etc/sysctl.conf
具体见:http://skly-java.iteye.com/blog/2167400
java程序调用:
Could not get a resource from the pool
你需要为172.18.0.0网段添加网关
具体见:http://blog.csdn.net/lvshaorong/article/details/69950694
http://blog.csdn.net/lvshaorong/article/details/69950694
http://blog.csdn.net/wh211212/article/details/52817923
http://skly-java.iteye.com/blog/2167400