CeonterOS6.7 64位安装 redis-3.0.7.tar.gz

1.准备工作(jdk不能少)

[root@cnpc001share]# 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@cnpc001share]# tar -zxvf redis-3.0.7.tar.gz

[root@cnpc001share]# ls

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

[root@cnpc001share]# cd redis-3.0.7

4.编译

[root@cnpc001 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@cnpc001redis-3.0.7]#

5.测试编译(可选)

[root@cnpc001redis-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@cnpc001redis-3.0.7]#  yum -y  install tcl

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

 

6.安装到指定目录

[root@cnpc001redis-3.0.7]# pwd

/usr/local/share/redis-3.0.7

[root@cnpc001redis-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@cnpc001redis-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@cnpc001 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@cnpc001redis-3.0.7]# cd bin/

[root@cnpc001 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@cnpc001redis-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

 

新打开一个ssh查看是否启动成功

[root@cnpc001 ~]# ps-ef | grep redis

root      6546 2968  0 01:10 pts/0    00:00:00 ./bin/redis-server *:6379   

root      6579 6557  0 01:12 pts/1    00:00:00 grep redis

 

启动成功

 

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值