目录
正常Redis部署流程
#预安装环境
[root@localhost ~]# yum -y install gcc gcc-c++ make
#编译安装
[root@localhost ~]# tar zxvf redis-5.0.7.tar.gz -C /opt/
[root@localhost ~]# cd /opt/redis-5.0.7
[root@localhost redis-5.0.7]# make
[root@localhost redis-5.0.7]# make PREFIX=/usr/local/redis install
[root@localhost redis-5.0.7]# ln -s /usr/local/redis/bin/* /usr/local/bin/
#安装Redis
[root@localhost ~]# cd /opt/redis-5.0.7/utils/
[root@localhost utils]# ./install_server.sh '//一直按回车'
Welcome to the redis service installer
This script will help you easily set up a running redis server
Please select the redis port for this instance: [6379]
Selecting default: 6379
Please select the redis config file name [/etc/redis/6379.conf]
Selected default - /etc/redis/6379.conf
Please select the redis log file name [/var/log/redis_6379.log]
Selected default - /var/log/redis_6379.log
Please select the data directory for this instance [/var/lib/redis/6379]
Selected default - /var/lib/redis/6379
Please select the redis executable path [/usr/local/bin/redis-server]
Selected config:
Port : 6379
Config file : /etc/redis/6379.conf
Log file : /var/log/redis_6379.log
Data dir : /var/lib/redis/6379
Executable : /usr/local/bin/redis-server
Cli Executable : /usr/local/bin/redis-cli
Is this ok? Then press ENTER to go on or Ctrl-C to abort.
Copied /tmp/6379.conf => /etc/init.d/redis_6379
Installing service...
Successfully added to chkconfig!
Successfully added to runlevels 345!
Starting Redis server...
Installation successful!
#配置文件
[root@localhost utils]# vim /etc/redis/6379.conf
...
bind 127.0.0.1 20.0.0.10 '//70行'
...
port 6379 '//93行'
...
daemonize yes '//137行'
...
pidfile /var/run/redis_6379.pid '//159行'
...
loglevel notice '//167行'
...
logfile /var/log/redis_6379.log '//172行'
...
[root@localhost utils]# /etc/init.d/redis_6379 restart '//重启'
#登录Reids数据库
[root@localhost utils]# redis-cli -h 20.0.0.10 -p 6379
20.0.0.10:6379> '//quit退出'
一、make[2]: cc: Command not found
异常原因
没有安装gcc
解决方案
yum install gcc-c++
二、zmalloc.h:51:31: error: jemalloc/jemalloc.h: No such file or directory
异常原因
一些编译依赖或原来编译遗留出现的问题
解决方案
make distclean。清理一下,然后再make。