Redis学习系列——Redis安装
来源:互联网 发布:python turtle 坐标 编辑:程序博客网 时间:2024/06/05 10:04
Redis学习系列——Redis安装
1. 什么是Redis ?
Redis是一个开源,高级的键值存储和一个适用的解决方案,用于构建高性能,可扩展的Web应用程序。Redis有三个主要特点,使它优越于其它键值数据存储系统:
- Redis将其数据库完全保存在内存中,仅使用磁盘进行持久化。
- 与其它键值数据存储相比,Redis有一组相对丰富的数据类型。
- Redis可以将数据复制到任意数量的从机中。
2. Redis 安装(Ubuntu)
2.1 在 Ubuntu 系统安装 Redis可以使用以下命令:
$sudo apt-get update$sudo apt-get install redis-server
2.2 启动Redis:
$sudo redis-server
2.3 查看服务:
$ redis-cli
2.4 命令执行后打开终端:
redis 127.0.0.1:6379>
注:6379为Redis 默认端口。
redis 127.0.0.1:6379> pingPONG
安装完成!
3. Redis 基本配置(ubuntu)
ubuntu 下Redis配置文件位于:/etc/redis/redis.conf
3.1 设置密码
sudo vi /etc/redis/redis.conf
定位 requirepass
修改密码 requirepass yourpassword
################################## SECURITY #################################### Require clients to issue AUTH <PASSWORD> before processing any other# commands. This might be useful in environments in which you do not trust# others with access to the host running redis-server.## This should stay commented out for backward compatibility and because most# people do not need auth (e.g. they run their own servers).## Warning: since Redis is pretty fast an outside user can try up to# 150k passwords per second against a good box. This means that you should# use a very strong password otherwise it will be very easy to break.#requirepass redis
通过一下命令行测试修改结果:
$ redis-cli 127.0.0.1:6379> config get requirepass(error) NOAUTH Authentication required.
提示无权访问。
$ redis-cli -h 127.0.0.1 -p 6379 -a redispass127.0.0.1:6379> config get requirepass1) "requirepass"2) "redispass"
通过密码登陆可以正确访问。
注:redispass 为你设置的密码。127.0.0.1为本机Ip地址
3.2 设置远程访问
将bind 0.0.0.0这一行解除注释
# By default Redis listens for connections from all the network interfaces# available on the server. It is possible to listen to just one or multiple# interfaces using the "bind" configuration directive, followed by one or# more IP addresses.## Examples:## bind 192.168.1.100 10.0.0.1bind 0.0.0.0
通过ip地址访问redis
$ redis-cli -h xxx.xxx.xxx.xxx -p 6379 -a redispassxxx.xxx.xxx.xxx:6379>
注意:xxx.xxx.xxx.xxx为服务器IP地址。
4. Redis可视化客户端工具
下载安装 Redis Desktop Manager(https://redisdesktop.com/download)
下面是Redis Desktop Manager的配置界面:
连接成功:
1 0
- Redis学习系列——Redis安装
- Redis学习——01.redis安装
- redis系列-redis安装
- redis学习系列之——安装篇
- Redis学习系列——Redis基本教程
- redis学习:redis安装
- Redis入门—安装Redis
- Redis系列-初识redis、安装
- redis学习系列--1.redis下载安装配置
- redis学习系列(十)--redis-集群安装
- Redis学习笔记——Redis安装部署
- Redis学习笔记二——redis安装
- Redis学习笔记三——redis分布式安装
- redis学习(一)——redis介绍及安装
- Redis学习笔记——(一)Redis安装配置
- Redis学习笔记——(三)Redis集群安装
- 分布式缓存技术redis学习系列(一)——redis简介以及linux上的安装
- 分布式缓存技术redis学习系列(一)——redis简介以及linux上的安装
- 104. Maximum Depth of Binary Tree
- poj 1017 Packets
- springmvc常用注解标签详解
- NYOJ-1235-A/B Problem
- C/C++:宏定义中的#与##
- Redis学习系列——Redis安装
- Problem A: 时间类的构造和输出
- angular-单页面多行数据展示-自定义命名-ui-view
- Problem B: 时间类的成员读写
- linux_2-LDAP网络用户账户
- Spring Boot搭建spring+springMVC+Mybatis简单Demo
- 如何优雅的“编写”api接口文档
- PAT-A-1024. Palindromic Number (25)
- Problem C: 时间类的输入