linux下安装redis
linux下安装redis首先需要安装gcc,它是用来编译redis的源文件的
1.安装gcc ,前提是切换root用户,途中会出现两次选择,都按输入y
[[email protected] zhongkai]# yum install gcc-c++
2.去redis官网下载redis软件 https://redis.io/
3.解压redis
[[email protected] zhongkai]# cd Documents/
[[email protected] Documents]# ls
redis-4.0.9.tar.gz
[[email protected] Documents]# tar zxvf redis-4.0.9.tar.gz
4.使用make命令编译
redis-4.0.9 redis-4.0.9.tar.gz
[[email protected] Documents]# cd redis-4.0.9/
[[email protected] redis-4.0.9]# make
5.进入解压的src目录
[[email protected] src]# make test
CC Makefile.dep
You need tcl 8.5 or newer in order to run the Redis test
make: *** [test] 错误 1
解决报错:
到这里会出现错误是很正常的,去下载tcl工具脚本语言,是Linux内的一种语言包
网址:http://downloads.sourceforge.net/tcl/tcl8.6.1-src.tar.gz
[[email protected] tcl8.6.1]#cd unix/
[[email protected] unix]#./cinfigure
[[email protected] unix]#cd make
[[email protected] unix]#cd make unstall
再执行 [[email protected] src]# make test
以下结果表示成功
安装:
[[email protected] src]# make PREFIX=/usr/local/redis install
以上显示表示安装成功
启动:
[[email protected] bin]# ./redis-server10783:C 15 May 15:00:58.821 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
10783:C 15 May 15:00:58.822 # Redis version=4.0.9, bits=64, commit=00000000, modified=0, pid=10783, just started
10783:C 15 May 15:00:58.822 # Warning: no config file specified, using the default config. In order to specify a config file use ./redis-server /path/to/redis.conf
10783:M 15 May 15:00:58.823 * Increased maximum number of open files to 10032 (it was originally set to 1024).
_._
_.-``__ ''-._
_.-`` `. `_. ''-._ Redis 4.0.9 (00000000/0) 64 bit
.-`` .-```. ```\/ _.,_ ''-._
( ' , .-` | `, ) Running in standalone mode
|`-._`-...-` __...-.``-._|'` _.-'| Port: 6379
| `-._ `._ / _.-' | PID: 10783
`-._ `-._ `-./ _.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' | http://redis.io
`-._ `-._`-.__.-'_.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' |
`-._ `-._`-.__.-'_.-' _.-'
`-._ `-.__.-' _.-'
`-._ _.-'
`-.__.-'