上述文件位于src目录下。
我习惯性的执行了make install,貌似我需要的可执行文件,安装到了/usr/local/bin:
引用
# make install
cd src && make install
make[1]: Entering directory `/opt/software/redis-2.4.16/src'
MAKE hiredis
make[2]: Entering directory `/opt/software/redis-2.4.16/deps/hiredis'
make[2]: Nothing to be done for `static'.
make[2]: Leaving directory `/opt/software/redis-2.4.16/deps/hiredis'
MAKE linenoise
make[2]: Entering directory `/opt/software/redis-2.4.16/deps/linenoise'
make[2]: “linenoise_example”是最新的。
make[2]: Leaving directory `/opt/software/redis-2.4.16/deps/linenoise'
MAKE hiredis
make[2]: Entering directory `/opt/software/redis-2.4.16/deps/hiredis'
make[2]: Nothing to be done for `static'.
make[2]: Leaving directory `/opt/software/redis-2.4.16/deps/hiredis'
LINK redis-benchmark
LINK redis-cli
Hint: To run 'make test' is a good> mkdir -p /usr/local/bin
cp -pf redis-server /usr/local/bin
cp -pf redis-benchmark /usr/local/bin
cp -pf redis-cli /usr/local/bin
cp -pf redis-check-dump /usr/local/bin
cp -pf redis-check-aof /usr/local/bin
make[1]: Leaving directory `/opt/software/redis-2.4.16/src'
这样,就不用我拷贝文件了。 意外收获!
此外,还会得到一个默认的配置文件——redis.conf。
最好,把它拷贝到固定的目录下,例如:/etc/redis/目录下!
Shell代码
mkdir /etc/redis
cp redis.conf /etc/redis
然后,我们就可以在任何路径下,直接启动Redis了! 三、运行
运行Redis:
Shell代码
redis-server /etc/redis/redis.conf
引用
[1958] 13 Aug 16:18:24 * Server started, Redis version 2.4.16
[1958]13 Aug 16:18:24 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
[1958] 13 Aug 16:18:24 * The server is now ready to accept connections on port 6379
[1958] 13 Aug 16:18:24 - 0 clients connected (0 slaves), 717544 bytes in use 四、测试
通过客户端命令redis-cli访问Redis
引用
# redis-cli
redis> set name zlex
OK
redis> get name
"zlex"
进行数据测试:
Shell代码