码迷,mamicode.com
首页 > 其他好文 > 详细

安装新版REDIS

时间:2016-07-28 15:38:39      阅读:271      评论:0      收藏:0      [点我收藏+]

标签:

 

 

http://redis.io/

 

# wget http://download.redis.io/redis-stable.tar.gz

 

tar zxvf redis-stable.tar.gz -C /usr/local/

 

cd /usr/local/redis

 

make  MALLOC=libc

 

==========================================================

To force compiling against libc malloc, use: 

    % make MALLOC=libc 

To compile against jemalloc on Mac OS X systems, use: 

    % make MALLOC=jemalloc

 

分配器allocator,libc 并不是默认的 分配器, 默认的是 jemalloc, 因为 jemalloc 被证明 有更少的 fragmentation problems 比libc。

=======================================================================

make MALLOC=libc

 

cd src

 

yum -y install tcl    //提示缺这玩意

 

make test  //这里执行了2次,不知道为什么,但是都是按照提示来的,直到出现下面界面

 

  167 seconds - integration/replication

  172 seconds - integration/replication-psync

  145 seconds - unit/obuf-limits

 

\o/ All tests passed without errors!

 

Cleanup: may take some time... OK

# cd 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!

#

# /usr/local/bin/redis-server  /etc/redis/6379.conf

# netstat -nlt

Active Internet connections (only servers)

Proto Recv-Q Send-Q Local Address           Foreign Address         State     

tcp        0      0 127.0.0.1:6379          0.0.0.0:*               LISTEN    

# cd /usr/local/bin/

# ls

redis-benchmark  redis-check-aof  redis-check-rdb  redis-cli  redis-sentinel  redis-server

# ./redis-cli

 

127.0.0.1:6379> help

redis-cli 3.2.1

To get help about Redis commands type:

      "help @<group>" to get a list of commands in <group>

      "help <command>" for help on <command>

      "help <tab>" to get a list of possible help topics

      "quit" to exit

 

To set redis-cli perferences:

      ":set hints" enable online hints

      ":set nohints" disable online hints

Set your preferences in ~/.redisclirc

127.0.0.1:6379>

127.0.0.1:6379> exit

# more  /etc/redis/6379.conf |grep requirepass   //默认密码没有启用的,可以参见

 

# If the master is password protected (using the "requirepass" configuration

# requirepass foobared

 

安装新版REDIS

标签:

原文地址:http://www.cnblogs.com/iamqiu/p/5714655.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!