Redis安装

Redis安装 redis-2.8.19

可以参考官网的quickstart:http://redis.io/topics/quickstart

建立目录 mkdir redis_7000

解压缩到目录redis_7000, tar -xzvf redis-2.8.19 -C redis_7000

进入目录redis_7000/redis-2.8.19,

把当前目录下的所有文件以及子目录移动到当前目录的父目录,mv * ../

删除redis-2.8.19目录,rm -rf redis-2.8.19。

回到目录redis_7000,执行make,此时,在当前目录的src目录中多了redis-server文件。

At this point you can try if your build works correctly by typing make test, but this is an optional step. After the compilation the src directory inside the Redis distribution is populated with the different executables that are part of Redis:

  • redis-server is the Redis Server itself.

  • redis-sentinel is the Redis Sentinel executable (monitoring and failover).

  • redis-cli is the command line interface utility to talk with Redis.

  • redis-benchmark is used to check Redis performances.

  • redis-check-aof and redis-check-dump are useful in the rare event of corrupted data files.

It is a good idea to copy both the Redis server and the command line interface in proper places, either manually using the following commands:

sudo cp src/redis-server /usr/local/bin/

sudo cp src/redis-cli /usr/local/bin/

Or just using make install.

以上是官网的解释,所以可以不执行make install

不着急,先修改一下配置文件。拷贝一个redis.conf 的副本,保存为7000.conf,打开7000.conf,修改两个参数,分别为:

port——设置redis启动端口

# Accept connections on the specified port, default is 6379.
# If port 0 is specified Redis will not listen on a TCP socket.
port 7000

daemonize——设置redis以守护进程方式启动

# By default Redis does not run as a daemon. Use 'yes' if you need it.
# Note that Redis will write a pid file in /var/run/redis.pid when daemonized.
daemonize yes

现在启动redis服务器,

[root@121 redis_7000]# ./src/redis-server 7000.conf

打开客户端,

[root@121 redis_7000]# ./src/redis-cli -p 7000
127.0.0.1:7000>

ok,在7000端口上启动成功了。这是一种比较简单的安装方式。

========END========

转载于:https://my.oschina.net/xinxingegeya/blog/389155

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值