下载源码
[root@gitlab ~]# cd /opt/ [root@gitlab opt]# wget http://download.redis.io/releases/redis-6.0.5.tar.gz
安装组件
[root@gitlab opt]# yum groupinstall 'Development Tools' -y epel-release [root@gitlab opt]# tar zxf redis-6.0.5.tar.gz -C /usr/local/ [root@gitlab ~]# wget http://downloads.sourceforge.net/tcl/tcl8.6.1-src.tar.gz [root@gitlab ~]# tar xzvf tcl8.6.1-src.tar.gz -C /usr/local/ [root@gitlab ~]# cd /usr/local/tcl8.6.1/unix/ [root@gitlab unix]# ./configure [root@gitlab unix]# make [root@gitlab unix]# make install
编译安装
[root@gitlab redis]# yum -y install gcc make
[root@gitlab redis]# yum -y install centos-release-scl
[root@gitlab redis]# yum -y install devtoolset-9-gcc devtoolset-9-gcc-c++ devtoolset-9-binutils
[root@gitlab redis]# scl enable devtoolset-9 bash
[root@gitlab redis]# echo "source /opt/rh/devtoolset-9/enable" >> /etc/profile
[root@gitlab opt]# cd /usr/local/
[root@gitlab local]# ll
总用量 4
drwxr-xr-x. 2 root root 6 4月 11 2018 bin
drwxr-xr-x. 2 root root 6 4月 11 2018 etc
drwxr-xr-x. 2 root root 6 4月 11 2018 games
drwxr-xr-x. 2 root root 6 4月 11 2018 include
drwxr-xr-x. 2 root root 6 4月 11 2018 lib
drwxr-xr-x. 2 root root 6 4月 11 2018 lib64
drwxr-xr-x. 2 root root 6 4月 11 2018 libexec
drwxrwxr-x. 7 root root 4096 6月 9 18:19 redis-6.0.5
drwxr-xr-x. 2 root root 6 4月 11 2018 sbin
drwxr-xr-x. 5 root root 49 6月 29 20:50 share
drwxr-xr-x. 2 root root 6 4月 11 2018 src
[root@gitlab local]# mv redis-6.0.5 redis
[root@gitlab local]# cd redis
[root@gitlab redis]# make
Hint: It's a good idea to run 'make test' ;)
make[1]: 离开目录“/usr/local/redis/src”
[root@gitlab redis]# echo $?
0
[root@gitlab redis]# make test
[root@gitlab redis]# make install PREFIX=/usr/local/redis
[root@gitlab redis]# mkdir -p /data/redis
修改配置
[root@gitlab ~]# cd /usr/local/redis/ [root@gitlab redis]# mkdir -p /usr/local/redis/logs [root@gitlab redis]# touch /usr/local/redis/logs/redis.log [root@gitlab redis]# vim /etc/redis.conf #bind 127.0.0.1 注释掉,外网可以访问 protected-mode no 关闭保护模式 daemonize yes 开启守护进程模式 logfile "/usr/local/redis/logs/redis.log" 日志存放位置 dir /data/redis 数据存放位置 requirepass www.centoscn.vip 密码
- 启动服务
[root@gitlab redis]# pwd /usr/local/redis [root@gitlab redis]# redis-server ./redis.conf
- 测试
继续阅读
- 我的QQ
- QQ扫一扫
-
- 我的头条
- 头条扫一扫
-
评论