redis入门到精通 - 01 redis特点及安装

REDIS

官网:http://redis.io

Redis is an open source (BSD licensed), in-memory data structure store, used as a database, cache and message broker. It supports data structures such as strings, hashes, lists, sets, sorted sets with range queries, bitmaps, hyperloglogs and geospatial indexes with radius queries. Redis has built-in replication, Lua scripting, LRU eviction, transactions and different levels of on-disk persistence, and provides high availability via Redis Sentinel and automatic partitioning with Redis Cluster.

Ubuntu安装配置redis

apt -y install redis-server

# 修改参数
vi /etc/redis/redis.conf
#------------------------------------------------------------------------
# bind 127.0.0.1 ::1    注释掉
daemonize yes           # daemonize为yes时,redis在后台执行
#------------------------------------------------------------------------

ls -l /usr/bin/redis*
#------------------------------------------------------------------------
-rwxr-xr-x 1 root root   88112 Apr  3 03:37 /usr/bin/redis-benchmark        # 性能测试工具
-rwxr-xr-x 1 root root 1085080 Apr  3 03:37 /usr/bin/redis-check-aof        # 检查aof日志工具
-rwxr-xr-x 1 root root 1085080 Apr  3 03:37 /usr/bin/redis-check-rdb        # 检查rdb日志工具
-rwxr-xr-x 1 root root  174088 Apr  3 03:37 /usr/bin/redis-cli              # 连接用的客户端
lrwxrwxrwx 1 root root      15 Apr  3 03:37 /usr/bin/redis-server -> redis-check-rdb # 服务进程
#------------------------------------------------------------------------

# 启动redis
/etc/init.d/redis-server start

ps -ef | grep -v grep | grep redis
#------------------------------------------------------------------------
redis      188     1  0 14:37 ?        00:00:00 /usr/bin/redis-server *:6379
#------------------------------------------------------------------------

# 连接
redis-cli
127.0.0.1:6379>

Centos安装配置redis

Docker安装

docker应用 - 部署REDIS服务
docker下的安装目录

ls -l /usr/local/bin
total 22376
-rwxr-xr-x    1 root     root           388 Jul 16 17:12 docker-entrypoint.sh
-rwxr-xr-x    1 root     root       2507216 Jul 11 08:57 redis-benchmark
-rwxr-xr-x    1 root     root       5902032 Jul 11 08:57 redis-check-aof
-rwxr-xr-x    1 root     root       5902032 Jul 11 08:57 redis-check-rdb
-rwxr-xr-x    1 root     root       2688168 Jul 11 08:57 redis-cli
lrwxrwxrwx    1 root     root            12 Jul 11 08:57 redis-sentinel -> redis-server
-rwxr-xr-x    1 root     root       5902032 Jul 11 08:57 redis-server

后续学习实验内容均在docker容器内

文章目录
  1. 1. REDIS
  2. 2. Ubuntu安装配置redis
  3. 3. Centos安装配置redis
  4. 4. Docker安装