Home > Database > Mysql Tutorial > Nosql之Redis: 在centos下安装

Nosql之Redis: 在centos下安装

WBOY
Release: 2016-06-07 16:29:53
Original
957 people have browsed it

通过wget下载到lamp目录: [root@localhost home]# mkdir lamp [root@localhost lamp]# wget http://redis.googlecode.com/files/redis-2.4.18.tar.gz 解压 [root@localhost lamp]# tar zxvf redis-2.4.18.tar.gz [root@localhost lamp]# cd redis-2.4.18 编

通过wget下载到lamp目录:
[root@localhost home]# mkdir lamp
[root@localhost lamp]# wget http://redis.googlecode.com/files/redis-2.4.18.tar.gz

解压
[root@localhost lamp]# tar zxvf redis-2.4.18.tar.gz
[root@localhost lamp]# cd redis-2.4.18

编译:
[root@localhost redis-2.4.18]# make

进入src目录下安装
[root@localhost redis-2.4.18]# cd src && make install

递归创建redis -/bin /etc目录
mkdir -p /usr/local/redis/bin
mkdir -p /usr/local/redis/etc

移动配置文件
[root@localhost redis-2.4.18]mv /home/lamp/redis-2.4.18/redis.conf /usr/local/redis/etc
[root@localhost etc]#cd /home/lamp/redis-2.4.18/src
[root@localhost src]# mv mkreleasehdr.sh redis-benchmark redis-check-aof redis-check-dump redis-cli redis-server /usr/local/redis/bin

后台启动
[root@localhost src]# cd /usr/local/redis/bin
[root@localhost bin]# redis-server /usr/local/redis/etc/redis.conf

查看进程:
ps -ef |grep redis
查看端口:
[root@localhost bin]# netstat -tunpl | grep 6379
tcp? 0? 0 0.0.0.0:6379? 0.0.0.0:*? LISTEN??? 18704/redis-server
进入客户端
[root@localhost bin]# ./redis-cli
redis 127.0.0.1:6379>

关闭服务
[root@localhost bin]# redis-cli shutdown

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template