您的位置:首页 > 数据库 > Redis

【Redis】Redis安装及常见问题

2018-01-21 12:07 429 查看
1、解压:tar -zxvf redis-3.0.0.tar.gz

2、ll

3、cd redis-3.0.0

编译时必须有makefile



4、make

[root@localhost redis-3.0.0]# make
cd src && make all
make[1]: 进入目录“/usr/java/redis-3.0.0/src”
CC adlist.o
In file included from adlist.c:34:0:
zmalloc.h:50:31: 致命错误:jemalloc/jemalloc.h:没有那个文件或目录
编译中断。
make[1]: *** [adlist.o] 错误 1
make[1]: 离开目录“/usr/java/redis-3.0.0/src”
make: *** [all] 错误 2


解决:make MALLOC=libc

参考链接:http://blog.csdn.net/honchou56/article/details/53994708

5、make install PREFIX=/usr/local/redis

安装,设置安装路径(PREFIX)

6、cd /usr/local/redis/bin路径下执行:./redis-server

按ctrl+c退出

7、将redis.conf复制到当前目录下

[root@localhost bin]# cp /usr/java/redis-3.0.0/redis.conf .

[root@localhost bin]# ll

总用量 3316

-rw-r–r–. 1 root root 18 1月 20 18:43 dump.rdb

-rwxr-xr-x. 1 root root 289504 1月 20 18:33 redis-benchmark

-rwxr-xr-x. 1 root root 25165 1月 20 18:33 redis-check-aof

-rwxr-xr-x. 1 root root 56012 1月 20 18:33 redis-check-dump

-rwxr-xr-x. 1 root root 417979 1月 20 18:33 redis-cli

-rw-r–r–. 1 root root 41403 1月 20 18:53 redis.conf

lrwxrwxrwx. 1 root root 12 1月 20 18:33 redis-sentinel -> redis-server

-rwxr-xr-x. 1 root root 2546423 1月 20 18:33 redis-server

8、编辑conf:vim redis.conf

改为yes,在后台运行



9、进程是否启动:

ps aux|grep redis

10、链接服务器:

./redis-cli
ping
如果指定ip和端口号:./redis-cli -h 192.168.25.100 -p 6379


总结:

redis安装,希望能帮到您!

感谢您的阅读!
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  Redis