yum 安装redis

yum方式安装

yum install -y https://repo.ius.io/ius-release-el7.rpm https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
yum install redis5 lrzsz mlocate psmisc iftop dstat httpd-tools net-tools -y

docker-compose方式部署

mkdir -p /data/jumpserver-redis
cat >/data/jumpserver-redis/docker-compose.yml <<'EOF'
version: '3'

services:
  redis:
    image: 'redis:6.2'
    container_name: 'redis'
    restart: always
    ports:
     - 6379:6379
    command:
      --appendonly yes
      --requirepass "rkto1kjQXuRJKSQ%"
    privileged: true  
    volumes:
      - /data/jumpserver-redis/data:/data
    logging:
        driver: "json-file"
        options:
            max-size: "200m"
            max-file: "10"

cat >/data/jumpserver-redis/start.sh <<'EOF'
#!/bin/bash

docker-compose -f /data/jumpserver-redis/docker-compose.yml up -d
docker ps -a| grep redis
exit 0
EOF

cat >/data/jumpserver-redis/stop.sh <<'EOF'
#!/bin/bash

docker-compose -f /data/jumpserver-redis/docker-compose.yml down
docker ps -a| grep redis
exit 0
EOF
chmod +x /data/jumpserver-redis/*.sh
bash /data/jumpserver-redis/start.sh

 

posted @ 2021-08-07 11:26  缺个好听的昵称  阅读(329)  评论(0编辑  收藏  举报