源码编译装redis
1、下载包
![在这里插入图片描述](https://img-blog.csdnimg.cn/20201024163725735.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3h4MDB4eHh4MA==,size_16,color_FFFFFF,t_70#pic_center)
![进入官网找到redis-5.0.9](https://img-blog.csdnimg.cn/20201024163725751.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3h4MDB4eHh4MA==,size_16,color_FFFFFF,t_70#pic_center)
[root@ZZQVM1 ~]
[root@ZZQVM1src]
[root@ZZQVM1 src]
2、解压
[root@ZZQVM1 src]
3、安装(无需编译-已经有Makefile文件)
[root@ZZQVM1 src]
[root@ZZQVM1 redis-5.0.9]
00-RELEASENOTES deps README.md runtest-moduleapi tests
BUGS INSTALL redis.conf runtest-sentinel utils
CONTRIBUTING Makefile runtest sentinel.conf
COPYING MANIFESTO runtest-cluster src
(1) 更改文件安装目录
[root@ZZQVM1 redis-5.0.9]
(2)修改以下加粗内容:
PREFIX?=/usr/local/redis
(3)安装
[root@ZZQVM1 redis-5.0.9]
[root@ZZQVM1 redis-5.0.9]
4、完成安装启动:
[root@ZZQVM1 redis-5.0.9]
_._
_.-``__ ''-._
_.-`` `. `_. ''-._ Redis 5.0.9 (00000000/0) 64 bit
.-`` .-```. ```\/ _.,_ ''-._
( ' , .-` | `, ) Running in standalone mode
|`-._`-...-` __...-.``-._|'` _.-'| Port: 6379
| `-._ `._ / _.-' | PID: 14681
`-._ `-._ `-./ _.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' | http://redis.io
`-._ `-._`-.__.-'_.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' |
`-._ `-._`-.__.-'_.-' _.-'
`-._ `-.__.-' _.-'
`-._ _.-'
`-.__.-'
14681:M 10 Oct 2020 13:37:49.221
14681:M 10 Oct 2020 13:37:49.221
14681:M 10 Oct 2020 13:37:49.221
14681:M 10 Oct 2020 13:37:49.221
[root@ZZQVM1 redis-5.0.9]
daemonize yes
[root@ZZQVM1 redis-5.0.9]
[root@ZZQVM1 redis-5.0.9]
(1)让redis自己管理内存
[root@ZZQVM1 ~]
(2)启动麻烦:进去源码安装目录,初始化启动脚本
[root@ZZQVM1 redis-5.0.9]
build-static-symbols.tcl hashtable redis_init_script.tpl
cluster_fail_time.tcl hyperloglog redis-sha1.rb
corrupt_rdb.c install_server.sh releasetools
create-cluster lru speed-regression.tcl
generate-command-help.rb redis-copy.rb whatisdoing.sh
graphs redis_init_script
[root@ZZQVM1 redis-5.0.9]
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] /usr/local/redis/6379.conf
Please select the redis log file name [/var/log/redis_6379.log] /usr/local/redis/6379.log
Please select the data directory for this instance [/var/lib/redis/6379] /usr/local/redis/6379
Please select the redis executable path [] /usr/local/redis/bin/redis-server
Selected config:
Port : 6379
Config file : /usr/local/redis/6379.conf
Log file : /usr/local/redis/6379.log
Data dir : /usr/local/redis/6379
Executable : /usr/local/redis/bin/redis-server
Cli Executable : /usr/local/redis/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!
/var/run/redis_6379.pid exists, process is already running or crashed
Installation successful
[root@ZZQVM1 redis-5.0.9]
[root@ZZQVM1 redis-5.0.9]
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp6 0 0 :::111 :::* LISTEN
tcp6 0 0 :::22 :::* LISTEN
[root@ZZQVM1 redis-5.0.9]
Starting Redis server...
[root@ZZQVM1 redis-5.0.9]
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 1449/mysqld
tcp 0 0 127.0.0.1:6379 0.0.0.0:* LISTEN 14894/redis-server
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 858/rpcbind
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1139/sshd
tcp6 0 0 :::111 :::* LISTEN 858/rpcbind
tcp6 0 0 :::22 :::* LISTEN 1139/sshd
5、恭喜已完成redis源码编译安装
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)