redis(一)

redis(一)

CentOS安装redis

 Centos7安装redis

安装前所需检查

  1. yum 是否安装

  2. wget 是否安装

  3. gcc是否安装

  4. 升级gcc

    yum -y install centos-release-scl

    yum -y install devtoolset-9-gcc devtoolset-9-gcc-c++ devtoolset-9-binutils

    scl enable devtoolset-9 bash

  5. 配置环境变量

    export REDIS_HOME=/opt/安装目录

    export PATH: P A T H : PATH: PATH:REDIS_HOME/bin

  6. 注释 utils/install__server.sh 以下类容

    #bail if this system is managed by systemd
    #_pid_1_exe="KaTeX parse error: Expected 'EOF', got '#' at position 28: … /proc/1/exe)" #̲if [ "{_pid_1_exe##*/}" = systemd ]
    #then

    #echo “This systems seems to use systemd.”

    #echo “Please take a look at the provided example service unit files in this directory, and adapt and install them. Sorry!”

    #exit 1

    #fi
    #unset _pid_1_exe

所用命令

  1. yum命令

    yum install 工具名

    yum list(检查安装项)

  2. wget 下载链接

  3. redis命令

    make

    make distclean

    make install PREPIX=安装目录

    service redis start

    service redis stop

    service redis restart

  4. source /etc/profile (环境变量立即生效)

  5. firewall命令

    添加:

    firewall-cmd --zone=public --add-port=80/tcp --permanent (–permanent永久生效,没有此参数重启后失效)

    重新载入:

    firewall-cmd --reload

    查看:

    firewall-cmd --zone=public --query-port=80/tcp

    删除:

    firewall-cmd --zone=public --remove-port=80/tcp --permanent

开始安装

  1. wget http://download.redis.io/releases/redis-6.0.6.tar.gz

  2. cd redis-6.0.6

  3. make

  4. make install PREPIX=/opt/redis_server

  5. cd uitls

  6. ./install_server.sh

  7. 开放,开启,重启 防火墙

  8. etc/6379.conf

    设置密码 requirepass

    注释 bin 127.0.0.1

    设置 appendonly yes;

    设置 daemonize yes.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值