欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  数据库

Nosql之Redis: 在centos下安装

程序员文章站 2022-03-31 19:33:32
...

通过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