Ubuntu 15.10 下Redis Cluster使用
1 Redis Standalone安装
可以参考这篇博文:http://www.cnblogs.com/_popc/p/3684835.html
2 Redis Cluster安装
2.1 环境介绍:
Ubuntu 15.10,9台电脑,3 master,6 slave
2.2 环境准备:
安装ruby
sudo apt-get install ruby
安装Redis Ruby驱动
sudo gem install redis
2.3 修改配置文件
通用配置文件:redis-common.conf
#GENERAL
daemonize yes
tcp-backlog
timeout
tcp-keepalive
loglevel notice
databases
logfile "/home/hadoop/software/cloud/redis-3.0.4/data/redis/redis.log"
dir /home/hadoop/software/cloud/redis-3.0./working_directory
slave-serve-stale-data yes
#slave只读
slave-read-only yes
#not use default
repl-disable-tcp-nodelay yes
slave-priority
#打开aof持久化
appendonly yes
#每秒一次aof写
appendfsync everysec
#关闭在aof rewrite的时候对新的写操作进行fsync
no-appendfsync-on-rewrite yes
auto-aof-rewrite-min-size 64mb
lua-time-limit
#打开redis集群
cluster-enabled yes
#节点互连超时的阀值
cluster-node-timeout
cluster-migration-barrier
slowlog-log-slower-than
slowlog-max-len
notify-keyspace-events ""
hash-max-ziplist-entries
hash-max-ziplist-value
list-max-ziplist-entries
list-max-ziplist-value
set-max-intset-entries
zset-max-ziplist-entries
zset-max-ziplist-value
activerehashing yes
client-output-buffer-limit normal
client-output-buffer-limit slave 256mb 64mb
client-output-buffer-limit pubsub 32mb 8mb
hz
aof-rewrite-incremental-fsync yes
个性化配置文件:redis-6379.conf
#包含通用配置
include /home/hadoop/software/cloud/redis-3.0./redis-common.conf
#监听tcp端口
port
#最大可用内存
maxmemory 10240m
#内存耗尽时采用的淘汰策略:
# volatile-lru -> remove the key with an expire set using an LRU algorithm
# allkeys-lru -> remove any key accordingly to the LRU algorithm
# volatile-random -> remove a random key with an expire set
# allkeys-random -> remove a random key, any key
# volatile-ttl -> remove the key with the nearest expire time (minor TTL)
# noeviction -> don't expire at all, just return an error on write operations
maxmemory-policy allkeys-lru
#aof存储文件
appendfilename "appendonly-6379.aof"
#rdb文件,只用于动态添加slave过程
dbfilename dump-.rdb
#cluster配置文件(启动自动生成)
cluster-config-file nodes-.conf
#部署在同一机器的redis实例,把auto-aof-rewrite搓开,防止瞬间fork所有redis进程做rewrite,占用大量内存
auto-aof-rewrite-percentage -
2.4 每台机器启动redis-server
redis-server redis-.conf
2.5 创建集群
src/redis-trib.rb create --replicas 192.168.1.100: 192.168.1.101: 192.168.1.106: 192.168.1.107: 192.168.1.108: 192.168.1.109: 192.168.1.103: 192.168.1.104: 192.168.1.105:
2.6 进入Redis命令行测试
redis-cli -c -p
3 Redis Cluster 命令
参考:http://blog.51yip.com/nosql/1726.html
4 参考文献
4.1 http://hot66hot.iteye.com/blog/2050676/
4.2 http://blog.chinaunix.net/uid-7374279-id-4470290.html
Ubuntu 15.10 下Redis Cluster使用的更多相关文章
- Ubuntu 15.10 下Tachyon安装
1 系统环境 Ubuntu 15.10, Java 1.7, Hadoop 2.6.0 HA, Spark-1.4.0 三台机器 spark-1423-0001: Master, Worker spa ...
- Ubuntu 15.10 下Scala 操作Redis Cluster
1 前言 Redis Standalone,Redis Cluster的安装在前面介绍过,地址:http://www.cnblogs.com/liuchangchun/p/5063477.html,这 ...
- Ubuntu 16.04 下Redis Cluster集群搭建
实际操作如下: 准备工作 版本:4.0.2 下载地址:https://redis.io/download 离线版本:(链接: https://pan.baidu.com/s/1bpwDtOr 密码: ...
- Ubuntu 16.04下Redis Cluster集群搭建(官方原始方案)
前提:先安装好Redis,参考:http://www.cnblogs.com/EasonJim/p/7599941.html 说明:Redis Cluster集群模式可以做到动态增加节点和下线节点,使 ...
- Ubuntu 15.10下的WebStorm-11.0.3完美破解
由于最新的JetBrains 发布了最新版本的IntelliJ IDEA的各个版本,而且更换了注册机的使用方式,这就导致了之前对WebStorm的破解方法不能在使用了.所以我们就必须另寻他法咯.如题, ...
- Ubuntu 15.10下droidbox安装使用
DroidBox是一个动态分析Android代码的的分析工具.其目前的安装环境为:Linux/Unix/MacOSX 下面是安装步骤 一. 安装Android SDK 并添加环境变量 export P ...
- Ubuntu 15.10下Qt5的安装实战
写照篇博客的目的就是因为最近要使用Qt,但是由于本人的系统是Ubuntu的,而网上大部分的讲解全是基于Windows的,所以就花费一些时间总结了一下我的安装过程,当然也是也为了能帮助到更多的博友. 第 ...
- 求助下 Ubuntu 15.10(64 位)下安装 pyspider 下的问题 - V2EX
https://www.v2ex.com/t/279405 求助下 Ubuntu 15.10(64 位)下安装 pyspider 下的问题 - V2EX pip 更新到最新 sudo apt inst ...
- ubuntu 15.10 64bit 下 steam无法启动
首先查看steam日志,在/tmp/dumps/下,以“用户名_output.txt”命名. $ cat /tmp/dumps/liuxu_output.txt Running Steam on ub ...
随机推荐
- 异常处理——java基础
Evernote Export 异常处理 异常处理的套路模板: try//创建异常处理{ throw new();//抛出异常 //一旦有异常, 抛出异常后,后面的语句不再执行 语句;{ …… ...
- WCF分布式4:客户端访问寄宿在IIS中的WCF服务
部署过程比较简单,新建一个站点,指向服务的物理路径,设置一个端口.即可. 新建的站点对应一个应用程序池,设置应用程序池中的.NET版本为4.0 写一个测试客户端,访问IIS中的WCF服务,可能会出现, ...
- 微信小程序:首页设置方法(开发模式,使用模式)与其他相关设置
小程序开发并不愉快,许多必建的文件不会自动生成,页面之间的跳转没有快捷键,开发者工具显示区域受限……如果谁有对应的解决办法求告知…… 开始的时候每次保存代码,页面都会刷洗重新渲染一次,而且自动跳回首页 ...
- Python 内编写类的各种技巧和方法
Python 内编写类的各种技巧和方法 简介 有关 Python 内编写类的各种技巧和方法(构建和初始化.重载操作符.类描述.属性访问控制.自定义序列.反射机制.可调用对象.上下文管理.构建描述符对象 ...
- ip代理简单方法
requests.post(url-url,headers=headers,data=data,proxies={'https':'192.165.1.56:8000'}
- 两种语言实现设计模式(C++和Java)(二:单例模式)
本篇介绍单例模式,可以说是使用场景最频繁的设计模式了.可以根据实例的生成时间,分为饿汉模式和懒汉模式 懒汉模式:饿了肯定要饥不择食.所以在单例类定义的时候就进行实例化. 饿汉模式:故名思义,不到万不得 ...
- Could not find method google() for arguments [] on repository container,rn 集成react-native-camera 出现此错误的解决方法
(1) app/build.gradle android { compileSdkVersion buildToolsVersion "25.0.2" } compile (pro ...
- java多线程、线程池及Spring配置线程池详解
1.java中为什么要使用多线程使用多线程,可以把一些大任务分解成多个小任务来执行,多个小任务之间互不影像,同时进行,这样,充分利用了cpu资源.2.java中简单的实现多线程的方式 继承Thread ...
- Pytorch 报错总结
目前在学习pytorch,自己写了一些例子,在这里记录下来一些报错及总结 1. RuntimeError: Expected object of type torch.FloatTensor but ...
- wireshark 无线抓包
1)抓取无线网卡的数据包(类似有线,仅抓取本网卡的数据包,适用与windows,linux) 1. 打开菜单项“Capture”下的子菜单“Capture Options”选项: 2. 找到设置面 ...