Redis服务搭建
一、服务搭建
1、安装gcc套装
yum install cpp
yum install binutils
yum install glibc
yum install glibc-kernheaders
yum install glibc-common
yum install glibc-devel
yum install gcc
yum install make
yum -y install gcc automake autoconf libtool make
2、升级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
echo "source /opt/rh/devtoolset-9/enable" >>/etc/profile
3、下载安装redis包
- 进入官网找到下载地址https://redis.io/download
- 下载redis包:wget http://download.redis.io/releases/redis-5.0.7.tar.gz
- 解压并安装Redis:tar -zvxf redis-5.0.7.tar.gz
- 移动redis目录: mv /root/redis-5.0.7 /usr/local/redis
- 编译:make
- 安装:make PREFIX=/usr/local/redis install
4、配置redis并启动
- redis.conf配置以下内容
daemonize:yes
bind:0.0.0.0
protected-mode:no
requirepass:123456
- 启动redis
/usr/local/redis/bin/redis-server ./redis.conf
二、开机自启动配置