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========