CentOS 7 安装 Redis-4.0.8
2018-03-26 15:36
218 查看
1 获取 Redis 源码包
1.1 方式一
1.2 方式二
2 编译 Redis 源码
3 运行 Redis
4 客户端连接
4.1 本机客户端连接
4.2 Windows 客户端连接
4.2.1 修改配置文件
4.2.2 安装客户端工具
5 参考文献
1.1 方式一
1.2 方式二
2 编译 Redis 源码
3 运行 Redis
4 客户端连接
4.1 本机客户端连接
4.2 Windows 客户端连接
4.2.1 修改配置文件
4.2.2 安装客户端工具
5 参考文献
1 获取 Redis 源码包
1.1 方式一
去 Redis 官网下载最新稳定版,上传到 Linux:https://redis.io/download1.2 方式二
使用 wget 命令获取wget http://download.redis.io/releases/redis-4.0.8.tar.gz[/code]2 编译 Redis 源码
# 解压 tar -zxvf redis-4.0.8.tar.gz # 进入 redis 主目录 cd redis-4.0.8 # 编译,编译完成后,Redis 已经可以运行 src/redis-server make # 如果想要在任何目录都可以执行 Redis 命令,执行以下命令进行安装 make install3 运行 Redis
# 启动 Redis 服务,后台启动:redis-server & redis-server
出现下图日志打印,安装成功,可以看出 Redis 默认使用 6379 端口4 客户端连接
4.1 本机客户端连接
# 连接本机 Redis redis-cli # 存入数据 set [key] [value] set foo bar # 获取数据 get [key] get foo
如下图:4.2 Windows 客户端连接
4.2.1 修改配置文件
为了安全起见,Redis 只允许本机访问,如果要通过其他主机访问,需要修改配置文件# 进入 Redis 主目录,其中 redis.conf 是 Redis 的配置文件,修改前先进行备份 cp redis.conf redis.conf.bak # 编辑配置文件 vim redis.conf
找到以下几项:# 注释掉 bind 127.0.0.1 # bind 127.0.0.1 # 修改保护模式 protected-mode yes,默认启用保护模式,在没有注释掉 bind 和没有设置密码的情况下,只允许本机客户端连接 protected-mode no # 可以通过 requirepass 选项设置密码。如果设置了密码,通过 redis-cli -a mypassword 指定密码登录 # requirepass mypassword注意:# 修改配置文件后,启动时指定配置文件 redis-server redis.conf4.2.2 安装客户端工具
下载并安装 Redis Desktop Manager 客户端工具:https://redisdesktop.com/download5 参考文献
Redis官网 https://redis.io/community
相关文章推荐
- centos7.3安装redis4.0.8 3主3从集群
- CentOS 7 安装 redis 4.0.8
- CentOS中安装redis并随系统启动启动
- 【安装】REDIS-4.0.0 on CentOS 6.8
- CentOS 6.5 下安装 Redis 2.8.7
- centos下gitlab私服完整安装部署(nginx+MySQL+redis+gitlab-ce+gitlab-shell+)
- CentOS 6.8下安装 Redis 2.8.7
- CentOS 6.5 -- Redis 4.0.2环境搭建、安装和实例启动
- 虚拟机CentOS6.7 快速安装redis
- centos下安装redis
- centos_6.5_x64 上快速编译安装redis
- CentOS6.5下Redis安装与配置
- centos上安装redis
- CentOS7.2 安装redis 3.0.6集群
- centos安装redis
- Redis的安装(CentOS 7下)
- centos6.5 下redis安装
- centos redis安装配置整合php
- centos7 安装 redis
- Redis 3.2.3 源码安装(centos6.8)