首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >CentOS 7 平台下编译安装Redis 5.0

CentOS 7 平台下编译安装Redis 5.0

作者头像
程裕强
发布2019-07-02 10:44:50
5060
发布2019-07-02 10:44:50
举报

1、下载当前稳定版

wget http://download.redis.io/releases/redis-stable.tar.gz

或者

wget http://download.redis.io/releases/redis-5.0.5.tar.g

2、加压缩

tar -zxvf redis-5.0.5.tar.gz

3、编译

cd redis-5.0.5/
make
make install PREFIX=/usr/local/redis

4、编辑配置文件

vi redis.conf
bind 10.17.12.160
protected-mode no
port 6379
daemonize yes
requirepass 123456

说明: daemonize yes表示后台运行 protected-mode no表示关闭保护模式

cp redis.conf /usr/local/redis

5、启动服务

cd /usr/local/redis
bin/redis-server redis.conf >> /var/log/redis.log &

6、简单使用

登录bin/redis-cli -h 10.17.12.XXX -p 6379 -a 123456

[root@server redis]# bin/redis-cli -h 10.17.12.xxx -p 6379 -a 123456
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
10.17.12.xxx:6379> set "name" "chengyuqiang"
OK
10.17.12.xxx:6379> get "name"
"chengyuqiang"
10.17.12.xxx:6379> quit
[root@server redis]# 

7、关闭服务

[root@server ~]# ps -aux | grep redis
root       763  0.1  0.1 159468 11952 ?        Ssl  09:35   0:02 /usr/local/redis/bin/redis-server 10.17.12.xxx:6379
root      1182  0.0  0.0 112648   952 pts/0    S+   10:08   0:00 grep --color=auto redis
[root@server ~]# kill 763
本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2019年06月26日,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 1、下载当前稳定版
  • 2、加压缩
  • 3、编译
  • 4、编辑配置文件
  • 5、启动服务
  • 6、简单使用
  • 7、关闭服务
相关产品与服务
云数据库 Redis
腾讯云数据库 Redis(TencentDB for Redis)是腾讯云打造的兼容 Redis 协议的缓存和存储服务。丰富的数据结构能帮助您完成不同类型的业务场景开发。支持主从热备,提供自动容灾切换、数据备份、故障迁移、实例监控、在线扩容、数据回档等全套的数据库服务。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档