Redis 官方可视化工具,高颜值,功能太强大!
RedisInsight 安装与使用
1. 物理安装
[root@Redis ~]# ls
anaconda-ks.cfg redisinsight-linux64-1.11.0
[root@Redis ~]# mkdir /usr/local/redisinsight
[root@Redis ~]# mv redisinsight-linux64-1.11.0 /usr/local/redisinsight/redisinsight-1.11.0
[root@Redis ~]# chmod +x /usr/local/redisinsight/redisinsight-1.11.0
[root@Redis ~]# echo "export REDISINSIGHT_HOST=192.168.1.1" >> ~/.bash_profile
[root@Redis ~]# echo "export REDISINSIGHT_HOST_DIR=/usr/local/redisinsight/.redisinsight" >> ~/.bash_profile
[root@Redis ~]# source ~/.bash_profile
REDISINSIGHT_PORT:配置 RedisInsight 的监听端口(default:8001) REDISINSIGHT_HOST:配置 RedisInsight 的 IP 地址(default:0.0.0.0) LOG_DIR:配置 RedisInsight 的日志存放路径(default:REDISINSIGHT_HOST_DIR) REDISINSIGHT_HOST_DIR:配置 RedisInsight 的数据存放路径(default:~/.redisinsight)
[root@Redis ~]# nohup /usr/local/redisinsight/redisinsight-linux64-1.4.0 & // 后台运行
[root@Redis ~]# ps aux | grep redis // 查看进程是否存在
2. Kubernetes 安装
[root@Redis ~]# vim redisinsight.yaml
apiVersion: v1
kind: Service
metadata:
name: redisinsight-service
spec:
type: NodePort
ports:
- port: 80
targetPort: 8001
nodePort: 31888
selector:
app: redisinsight
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: redisinsight
labels:
app: redisinsight
spec:
replicas: 1
selector:
matchLabels:
app: redisinsight
template:
metadata:
labels:
app: redisinsight
spec:
containers:
- name: redisinsight
image: redislabs/redisinsight:1.7.0
imagePullPolicy: IfNotPresent
volumeMounts:
- name: db
mountPath: /db
ports:
- containerPort: 8001
protocol: TCP
volumes:
- name: db
emptyDir: {}
[root@Redis ~]# kubectl apply -f redisinsight.yaml
3. RedisInsight 基本使用
[root@Redis ~]# wget https://download.redis.io/releases/redis-6.2.6.tar.gz
[root@Redis ~]# tar zxf redis-6.2.6.tar.gz
[root@Redis ~]# cd redis-6.2.6
[root@Redis redis-6.2.6]# make PREFIX=/usr/local/redis install
[root@Redis redis-6.2.6]# sed -i '/^bind 127.0.0.1/s/127.0.0.1/192.168.1.1/g' redis.conf # 修改监听 IP
[root@Redis redis-6.2.6]# sed -i '/protected-mode/s/yes/no/g' redis.conf # 关闭保护模式
[root@Redis redis-6.2.6]# sed -i '/daemonize/s/no/yes/g' redis.conf # 开启后台运行
[root@Redis redis-6.2.6]# sed -i '/requirepass/s/foobared/123123/g' redis.conf # 配置密码
[root@Redis redis-6.2.6]# sed -i '/requirepass 123123/s/^#//g' redis.conf # 将密码前的 # 删除
[root@Redis redis-6.2.6]# cp redis.conf /usr/local/redis/
[root@Redis redis-6.2.6]# /usr/local/redis/bin/redis-server /usr/local/redis/redis.conf # 启动 Redis
最近热文阅读:
1、不好意思, Maven 该换了! 2、面试官 | Spring Boot 项目如何统一结果,统一异常,统一日志? 3、基于SpringBoot+MyBatis+Vue的音乐网站 4、聊聊接口优化的几种方法 5、面试官 | Spring Boot 项目如何统一结果,统一异常,统一日志? 6、为什么不建议使用ON DUPLICATE KEY UPDATE? 7、Java8 Stream,过分丝滑! 8、8 种最坑SQL语法,工作中踩过吗? 9、Java 语言“坑爹” TOP 10 10、你还不明白如何解决分布式Session?看这篇就够了! 关注公众号,你想要的Java都在这里
评论