Linux—redis的部署
一.redis简介
1.redis是一个开源的使用ANSI C语言编写、遵守BSD协议,支持网络,可基于内存可持久化的日志型、key-Value的数据库,并提供多种语言的API。
2.redis是完全开源免费的,是一个高性能的key-value数据库
3.redis的特点:
1)redis支持数据的持久化,可以将内存中的数据库保存在磁盘中,重启的时候可以再次加载进行使用
2)redis不仅仅支持简单的key-value类型的数据,同时还提供list,set,zset,hash等数据结构的存储
3)redis支持数据的备份,即master-slave模式的数据备份
4.redis优点:
1)redis的读写速度极高
2)redis的所有操作都具有原子性
3)支持很多二进制数据类型
二.redis的部署
1.准备安装包:
yum install gcc gcc-c++ make -y
2.准备redis安装包,并解压:
tar xzvf redis-5.0.7.tar.gz -C /opt
3.编译安装:
[root@localhost ~]# cd /opt/redis-5.0.7/
[root@localhost redis-5.0.7]# make
[root@localhost redis-5.0.7]# make PREFIX=/usr/local/redis install
4.开启服务,并设置:
[root@localhost redis-5.0.7]# cd /opt/redis-5.0.7/utils/
[root@localhost utils]# ./install_server.sh
Welcome to the redis service installer
This script will help you easily set up a running redis server
Please select the redis port for this instance: [6379]
Selecting default: 6379
Please select the redis config file name [/etc/redis/6379.conf]
Selected default - /etc/redis/6379.conf
Please select the redis log file name [/var/log/redis_6379.log]
Selected default - /var/log/redis_6379.lo