随笔分类 - redis
摘要:环境:Os:Centos 7Python:3.6.5 IP:192.168.1.134 1.安装rdbtools [root@localhost ~]# pip3 install rdbtools Collecting rdbtools Downloading https://files.pytho
阅读全文
摘要:redis版本:4.0 #!/bin/bash find_key="activity:xdm:v2:core:task:13" ##主节点1 找到后进行删除 cnt01=`/usr/local/services/redis/bin/redis-cli -h 192.168.1.100 -p 7001
阅读全文
摘要:redis版本:4.0 1.查看前10条慢查询192.168.1.100:6379> slowlog get 20 1) 1) (integer) 466 2) (integer) 1627875243 3) (integer) 13006 ##执行时间 单位微妙 4) 1) "scan" 2) "
阅读全文
摘要:(error) CROSSSLOT Keys in request don’t hash to the same slot 解决办法: /usr/local/services/redis/bin/redis-cli -h 192.168.1.1 -p 7001 -a ptest KEYS "test
阅读全文
摘要:环境: OS:Centos 7 redis版本:4.0.15 背景:原来是2个节点组成的3主3从的集群,现在想修改为3个节点组成的3组3从的集群原来的集群部署拓扑:192.168.56.111:7001192.168.56.111:7002192.168.56.111:7003 192.168.56
阅读全文
摘要:安装ruby1.下载编译安装[root@localhost soft]# wget http://cache.ruby-lang.org/pub/ruby/2.4/ruby-2.4.1.tar.gz[root@localhost soft]# tar zxvf ruby-2.4.1.tar.gz[r
阅读全文
摘要:1.先执行一条官方 https://rvm.io/ 复制来的长命令(...C0E3空格7D2B...) [root@redis126 ~]# gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB
阅读全文
摘要:1.查看多少key/usr/local/services/redis/bin/redis-cli -h 192.168.1.100 -p 6379 -a testtest KEYS "*STOCK*"|wc -l2.导出key到文件/usr/local/services/redis/bin/redi
阅读全文
摘要:1.生成key 192.168.1.50:6379> set name1 hxlOK192.168.1.50:6379> set name2 hxl02OK192.168.1.50:6379> set name3 hxl03OK192.168.1.50:6379> get name1"hxl"192
阅读全文
摘要:环境:redis版本:4.0.14os:Centos7主: 192.168.1.85:8001从: 192.168.1.85:8002哨兵:192.168.1.85:89991.主节点安装部署[root@localhost src]# cd /soft/redis-4.0.14/src[root@l
阅读全文
摘要:1.主节点安装部署[root@localhost redis-4.0.14]# cd src[root@localhost src]# make PREFIX=/opt/redis-master-slave/master install[root@localhost src]# cp redis-t
阅读全文
摘要:cat /tmp/redis-command.txt|/usr/bin/redis-cli -h localhost -p 6379 -a 123456EXPIRE TEST:A_CODE-201018 4406400EXPIRE TEST:A_CODE-201019 4492800EXPIRE T
阅读全文
摘要:1.创建数据库(192.168.1.14)create database db_cachecloud;grant all privileges on db_cachecloud.* to cachecloud@'%' identified by 'cachecloud';2.进行安装[root@no
阅读全文
摘要:环境: OS:Centos 7 1.下载安装介质redis-shake-1.6.19.tar.gz 下载地址: https://github.com/tair-opensource/RedisShake/tags 2.解压安装tar -xvf redis-shake-1.6.19.tar.gz3.修
阅读全文
摘要:环境: OS:Centos 7 添加redis开机自动启动1.添加redis服务vi /usr/lib/systemd/system/redis.service文件内容如下:[Unit]Description=redisAfter=network.targetAfter=syslog.target[
阅读全文
摘要:环境OS:Centos 7db:4.0.14 需要安装gccyum install gcc-c++ -y 问题1:make[1]: 进入目录“/soft/redis-4.0.14/src” CC adlist.oIn file included from adlist.c:34:0:zmalloc.
阅读全文
摘要:环境OS:Centos 7db:4.0.14主 从192.168.1.118:7001 192.168.1.85:8001192.168.1.118:7002 192.168.1.85:8001192.168.1.118:7003 192.168.1.85:8001 说明:需要提前安装好ruby和r
阅读全文
摘要:redis备份恢复方法 1.采用aof恢复方法若appendonly设置为no的情况下,在每个节点上执行bgrewriteaof命令生成一个aof文件若appendonly已经为yes的话,在data目录会自动生成有aof文件我这里是appendonly设置为no的,所以在每个节点上执行如下命令./
阅读全文
摘要:环境:OS:Centos 7Redis: 3.2.11主 从192.168.1.118:7001 192.168.1.118:8001192.168.1.118:7002 192.168.1.118:8002192.168.1.118:7003 192.168.1.118:8003 1.1 下载re
阅读全文