RedisInsight 是一款官方提供的 Redis 可视化操作工具,专门为那些痛恨命令行,或者在海量数据中苦苦挣扎的开发者设计。它不仅支持基本的 CRUD 操作,还能帮你检测性能瓶颈、优化数据结构,甚至支持复杂数据的可视化展示。不懂 Redis 的也能轻松上手!
关于Redisinsight的简要概述这里不做过多介绍,参见官方文档https://redis.io/docs/latest/develop/tools/insight/
安装指南
1.前往官网redis.com/redis-enterprise/redis-insight/
2.下载适配的操作系统版本(支持 Windows、MacOS 和 Linux)。
3.安装完成后,启动应用并连接你的 Redis 数据库即可。
使用 Docker 部署: 执行以下命令:
docker run -d --name redisinsight -p 5540:5540 redis/redisinsight:latest -v redisinsight:/data打开浏览器访问 http://localhost:5540。
Redis Insight 还提供了一个位于 http://localhost:5540/api/health/ 的健康检查端点,用于监控正在运行的容器的健康状况。
创建deployment和service
# Redis Insight service with name 'redisinsight-service'
apiVersion: v1
kind: Service
metadata:
name: redisinsight-service # name should not be 'redisinsight'
# since the service creates
# environment variables that
# conflicts with redisinsight
# application's environment
# variables `RI_APP_HOST` and
# `RI_APP_PORT`
spec:
type: LoadBalancer
ports:
- port: 80
targetPort: 5540
selector:
app: redisinsight
---
# Redis Insight deployment with name 'redisinsight'
apiVersion: apps/v1
kind: Deployment
metadata:
name: redisinsight #deployment name
labels:
app: redisinsight #deployment label
spec:
replicas: 1 #a single replica pod
selector:
matchLabels:
app: redisinsight #which pods is the deployment managing, as defined by the pod template
template: #pod template
metadata:
labels:
app: redisinsight #label for pod/s
spec:
containers:
- name: redisinsight #Container name (DNS_LABEL, unique)
image: redis/redisinsight:latest #repo/image
imagePullPolicy: IfNotPresent #Installs the latest Redis Insight version
volumeMounts:
- name: redisinsight #Pod volumes to mount into the container's filesystem. Cannot be updated.
mountPath: /data
ports:
- containerPort: 5540 #exposed container port and protocol
protocol: TCP
volumes:
- name: redisinsight
emptyDir: {} # node-ephemeral volume https://kubernetes.io/docs/concepts/storage/volumes/#emptydir
kubectl apply -f redisinsight.yaml
kubectl get svc redisinsight-serviceVS Code 版插件:搜索 VS Code 扩展 "RedisInsight",安装后可以直接在编辑器中使用。