Redis数据库 安装

介绍

Redis 是一个开源(BSD 许可)的内存数据结构存储,用作数据库、缓存和消息代理。Redis 提供数据结构,例如字符串、散列、列表、集合、具有范围查询的排序集合、位图、超日志、地理空间索引和流。Redis 具有内置复制、Lua 脚本、LRU 驱逐、事务和不同级别的磁盘持久性,并通过 Redis Sentinel 和 Redis Cluster 自动分区提供高可用性。

Redis官网

1 Windows

2 Centos

2.1 安装配置

确保这两个命令都在“/usr/redis”目录下执行即可

make
make  install

2.2 使用Redis

连接本地redis

[root@client redis]$ src/redis-cli

连接远程redis

[root@master redis]$ src/redis-cli  -h  client

向redis里写入数据

[root@client redis]$ src/redis-cli -h 192.168.56.20
172.17.0.15:6379> set chengshi sh,bj,sz,nj,hf
172.17.0.15:6379> get chengshi

2.3 常见报错

2.3.1 make指令

cd src && make all
make[1]: Entering directory `/usr/cstor/redis/src'
    CC adlist.o
/bin/sh: cc: command not found
make[1]: *** [adlist.o] Error 127
make[1]: Leaving directory `/usr/cstor/redis/src'
make: *** [all] Error 2

解决方法

yum -y install gcc gcc-c++ libstdc++-devel
yum -y install gcc automake autoconf libtool make

一系列安装货如果还报错,就是上次安装报错残留报错问题

make distclean

你可能感兴趣的:(数据库,redis,数据库,缓存)