RedisInsight installation and use (Redis monitoring tool)

1. Introduction to RedisInsight

RedisInsight is an intuitive and efficient Redis GUI management tool. It can monitor Redis memory, connection number, hit rate and uptime, and can use on the interface to interact CLIwith connected Redis (RedisInsight has built-in support for Redis modules) : Official Portal


Features provided by RedisInsight:

  • The only GUI tool that supports Redis Cluster;
  • You can search keys, view and edit data based on Browserthe interface;
  • Supports connections based SSL/TLSon , and can also perform memory analysis on the interface;

2. RedisInsight installation and use

1. Physical installation

1) Download RedisInsightthe package : Portal

[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

insert image description here
2) Configure RedisInsightthe environment variables

[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

annotation:

  • REDISINSIGHT_PORTRedisInsight: configured listening port ( default:8001)
  • REDISINSIGHT_HOSTRedisInsight: configured IP address ( default:0.0.0.0)
  • LOG_DIR: RedisInsightThe log storage path ( default:REDISINSIGHT_HOST_DIR)
  • REDISINSIGHT_HOST_DIR: RedisInsightThe data storage path ( default:~/.redisinsight)

3) Start the RedisInsightservice

[root@Redis ~]# nohup /usr/local/redisinsight/redisinsight-linux64-1.4.0 &		// 后台运行
[root@Redis ~]# ps aux | grep redis												// 查看进程是否存在

insert image description here

2. Kubernetes installation

1) Create a RedisInsight yamlfile :

[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: {
    
    }

2) Start RedisInsight

[root@Redis ~]# kubectl apply -f redisinsight.yaml

insert image description here

3. Basic use of RedisInsight

Install Redis (if it is installed, you can skip it directly)

[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

insert image description here
1) Access the management interface of RedisInsight through the configured IP and port:
insert image description here
insert image description here
insert image description here
insert image description here
2) You can see various information of Redis here:
insert image description here
3) At the same time, RedisInsight can also operate on the interface:
insert image description here
4) You can also check Redis on the interface Memory used for analysis:
insert image description here

Guess you like

Origin blog.csdn.net/weixin_46902396/article/details/120807629