您的位置:首页 > 数据库 > Redis

CentOS 6.7 Linux系统下 安装redis3.0.7

2017-09-06 17:13 501 查看
1.准备工作(先安装jdk,再安装redis,这里不做讲解)

   [root@DHC share]# yum -y install gcc gcc-C++libstdc++-devel

2.下载安装文件

到官网http://redis.io/ 下载最新stable版 

Redis-3.0.7.tar.gz

wgethttp://download.redis.io/releases/redis-3.0.7.tar.gz

3.解压文件

[root@DHC share]# tar -xvf
redis-3.0.7.tar.gz

[root@DHC share]# ls

applications  info Java  man  redis-3.0.7 redis-3.0.7.tar.gz

[root@DHC share]# cd redis-3.0.7

4.编译

[root@DHC redis-3.0.7]# make        (如果make不成功使用make MALLOC=libc)

cd src &&make all

make[1]: Enteringdirectory `/usr/local/share/redis-3.0.7/src'

rm -rf redis-serverredis-sentinel redis-cli redis-benchmark redis-check-dump redis-check-aof *.o*.gcda *.gcno *.gcov redis.info lcov-html

(cd ../deps&& make distclean)

……………………

   CC redis-check-aof.o

    LINK redis-check-aof

 

Hint: It's a goodidea to run 'make test' ;)

 

make[1]: Leavingdirectory `/usr/local/share/redis-3.0.7/src'

[root@DHC redis-3.0.7]#

5.测试编译(可选)

[root@DHC redis-3.0.7]# make test

cd src &&make test

make[1]: Enteringdirectory `/usr/local/share/redis-3.0.7/src'

You need tcl 8.5 ornewer in order to run the Redis test

make[1]: *** [test]Error 1

make[1]: Leavingdirectory `/usr/local/share/redis-3.0.7/src'

make: *** [test]Error 2

(出错了 安装tcl)

[root@DHC redis-3.0.7]#  yum -y  install tcl

然后再执行 make test 就不错报了

 

6.安装到指定目录

[root@DHC redis-3.0.7]# pwd

/usr/local/share/redis-3.0.7

[root@DHC redis-3.0.7]# ls

00-RELEASENOTES  BUGS CONTRIBUTING  COPYING  deps INSTALL  Makefile  MANIFESTO README  redis.conf  runtest runtest-cluster runtest-sentinel sentinel.conf  src  tests utils

[root@DHC redis-3.0.7]# make PREFIX=/usr/local/share/redis-3.0.7 install

cd src &&make install

make[1]: Enteringdirectory `/usr/local/share/redis-3.0.7/src'

 

Hint: It's a goodidea to run 'make test' ;)

 

    INSTALL install

    INSTALL install

    INSTALL install

    INSTALL install

    INSTALL install

make[1]: Leavingdirectory `/usr/local/share/redis-3.0.7/src'

[root@DHC redis-3.0.7]# ls(多出个bin目录)

00-RELEASENOTES  bin  BUGS CONTRIBUTING  COPYING  deps INSTALL  Makefile  MANIFESTO README  redis.conf  runtest runtest-cluster runtest-sentinel sentinel.conf  src  tests utils

 

[root@DHC redis-3.0.7]# cd bin/

[root@DHC bin]#ll

total 15468

-rwxr-xr-x. 1 rootroot 4589147 Feb 19 01:06 redis-benchmark

-rwxr-xr-x. 1 rootroot   22185 Feb 19 01:06 redis-check-aof

-rwxr-xr-x. 1 rootroot   45403 Feb 19 01:06redis-check-dump

-rwxr-xr-x. 1 rootroot 4698362 Feb 19 01:06 redis-cli

lrwxrwxrwx. 1 rootroot      12 Feb 19 01:06 redis-sentinel-> redis-server

-rwxr-xr-x. 1 rootroot 6471327 Feb 19 01:06 redis-server

7.启动服务

[root@DHC redis-3.0.7]# ./bin/redis-server redis.conf

6546:M 19 Feb01:10:36.132 * Increased maximum number of open files to 10032 (it wasoriginally set to 1024).

                _._                                                 

           _.-``__ ''-._                                            

      _.-``   `.  `_.  ''-._           Redis 3.0.7 (00000000/0) 64 bit

  .-`` .-```. ```\/    _.,_ ''-._                                  

 (   '      ,       .-` | `,    )     Running in standalone mode

 |`-._`-...-` __...-.``-._|'` _.-'|     Port: 6379

 |   `-._   `._    /    _.-'    |     PID: 6546

  `-._   `-._  `-./  _.-'   _.-'                                  

 |`-._`-._   `-.__.-'    _.-'_.-'|                                 

 |   `-._`-._        _.-'_.-'    |          http://redis.io       

  `-._   `-._`-.__.-'_.-'    _.-'                                  

 |`-._`-._   `-.__.-'    _.-'_.-'|                                 

 |   `-._`-._        _.-'_.-'    |                                 

  `-._   `-._`-.__.-'_.-'    _.-'                                  

      `-._   `-.__.-'    _.-'                                      

          `-._        _.-'                                          

              `-.__.-'                                              

 

6546:M 19 Feb01:10:36.158 # WARNING: The TCP backlog setting of 511 cannot be enforcedbecause /proc/sys/net/core/somaxconn is set to the lower value of 128.

6546:M 19 Feb01:10:36.160 # Server started, Redis version 3.0.7

6546:M 19 Feb01:10:36.160 # WARNING overcommit_memory is set to 0! Background save may failunder low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to/etc/sysctl.conf and then reboot or run the command 'sysctlvm.overcommit_memory=1' for
this to take effect.

6546:M 19 Feb01:10:36.160 # WARNING you have Transparent Huge Pages (THP) support enabled inyour kernel. This will create latency and memory usage issues with Redis. Tofix this issue run the command 'echo never >/sys/kernel/mm/transparent_hugepage/enabled'
as root, and add it to your/etc/rc.local in order to retain the setting after a reboot. Redis must berestarted after THP is disabled.

6546:M 19 Feb 01:10:36.161 * The server is now readyto accept connections on port 6379

 

启动成功
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: