Tag Archives: redis

redis报错槽被占用 ERR Slot 741 is already busy (Redis::CommandError)

该错误是因为原来的节点非空,如果已经备份了数据,并且需要重新创建集群,可以尝试以下操作: 1清空数据 flushall 2重置节点 cluster reset

Posted in reids | Tagged | Leave a comment

redis报错节点非空[ERR] Node is not empty. Either the node already knows other nodes

如果重新创建集群,需要先清空数据,否则集群创建失败,具体方法如下: 1)、将需要新增的节点下aof、rdb等本地备份文件删除; 2)、同时将新Node的集群配置文件删除,即:删除你redis.conf里面cluster-config-file所在的文件; 3)、再次添加新节点如果还是报错,则登录新Node,./redis-cli–h x –p对数据库进行清除: 192.168.xx.xx:7001> flushdb #清空当前数据库

Posted in reids | Tagged | Leave a comment

创建Redis集群(重新修改)

创建Redis集群 为6台主机安装并运行redis服务 # yum -y install gcc gcc-c++ # tar -zxvf redis-4.0.8.tar.gz # cd redis-4.0.8/ # make # make install # ./utils/install_server.sh • 调整配置文件 # vim /etc/redis/redis.conf bind IP地址 //只写物理接口IP地址 daemonize yes //守护进程方式运行 port xxxx //端口号不要使用默认的6379 cluster-enabled yes//启用集群 cluster-config-file nodes-xxxx.conf//指定集群信息文件 … Continue reading

Posted in reids | Tagged | Leave a comment

Redis绑定IP后报 bind: Cannot assign requested address 异常解决方法

Redis绑定IP后报 bind: Cannot assign requested address 异常解决方法 今天在研究Redis安全设置,提到bind IP地址,然后就在redis.conf文件中的bind项后加入了客户端的IP,以为是绑定了IP的机器才能访问Redis,修改完成后重启,报错了: Creating Server TCP listening socket 192.168.1.55:6379: bind: Cannot assign requested address 提示监听192.168.1.55地址的6379端口错误,无法分配请求地址! 报着疑问,百度了一下,发现原来是我理解错了bind关键字的意义,原来的作用是绑定本机IP和地址 这个是知乎上的解答:http://www.zhihu.com/question/27220050/answer/38463570 redis.conf中的原文解释: # By default Redis listens for connections from all the network interfaces # available on the … Continue reading

Posted in reids | Tagged | Leave a comment

安装redis make报错 zmalloc.h:50:31: 错误:jemalloc/jemalloc.h:没有那个文件或目录

原因分析: 在redis的解压包下有个README文件,打开这个文件 有这个一段话。 llocator ——— Selecting a non-default memory allocator when building Redis is done by setting the `MALLOC` environment variable. Redis is compiled and linked against libc malloc by default, with the exception of jemalloc being the default on Linux … Continue reading

Posted in reids | Tagged | Leave a comment

Redis的基本安装

redis基本安装 Remode Dlctionary Server(远程字典服务器) 使用C语言编写的,遵守BSD的开源软件 是一款高性能的(Key/Values)分布式内存数据库 并支持数据持久化的NoSQL数据库服务软件 中文网站www.redis.cn 特点 支持数据持久化,可写入硬盘 安装 安装源码包 确认gcc gcc-c++已经安装 [root@51 redis-4.0.8]# rpm -q gcc gcc-c++ gcc-4.8.5-16.el7.x86_64 gcc-c++-4.8.5-16.el7.x86_64 直接编译,已配置好 [root@51 redis-4.0.8]# make cd src && make all make[1]: 进入目录“/root/soft/redis/redis-4.0.8/src” CC Makefile.dep make[1]: 离开目录“/root/soft/redis/redis-4.0.8/src” make[1]: 进入目录“/root/soft/redis/redis-4.0.8/src” rm … Continue reading

Posted in reids | Tagged | Leave a comment

Redis基本操作

redis操作 string 字符串 127.0.0.1:6351> set strmul abcdefj OK 127.0.0.1:6351> get strmul “abcdefj” 127.0.0.1:6351> getrange strmul 1 3 “bcd” 127.0.0.1:6351> getrange strmul 0 2 “abc” 127.0.0.1:6351> set num 123456789 OK 127.0.0.1:6351> getrange num 5 5 “6” 127.0.0.1:6351> getrange num 5 6 … Continue reading

Posted in reids | Tagged | Leave a comment

Redis cluster 集群配置

redis集群 搭建61-66的环境:安装redis 端口号6351-6356 删除127.0.0.1 添加192.168.4.61-66 完成后确认服务已启动,且有两个端口,其中一个10000+的就是集群时用的端口 IP 规划 • redis 服务器 ip 地址及端口规划 – redisA 192.168.4.51 6351 – redisB 192.168.4.52 6352 – redisC 192.168.4.53 6353 – redisD 192.168.4.54 6354 – redisE 192.168.4.55 6355 – redisF 192.168.4.56 6356 [root@61 ~]# /etc/init.d/redis_6351 … Continue reading

Posted in reids | Tagged | Leave a comment

Redis cluster 官方文档-Redis cluster tutorial

转载自https://redis.io/topics/cluster-tutorial#redis-cluster-tutorial Redis cluster tutorial This document is a gentle introduction to Redis Cluster, that does not use complex to understand distributed systems concepts. It provides instructions about how to setup a cluster, test, and operate it, without going into the … Continue reading

Posted in reids | Tagged | Leave a comment