Linux Redis 4.0.2 安装部署

本文涉及的产品
云数据库 Redis 版,社区版 2GB
推荐场景:
搭建游戏排行榜
简介:

Linux Redis 4.0.2 安装部署

01 安装GCC

yum -y install gcc gcc-c++ libstdc++-devel tcl -y

02 下载安装包

cd /export/software/
wget http://219.238.7.71/files/403400000ABE0C0C/download.redis.io/releases/redis-4.0.2.tar.gz
tar -zxvf redis-4.0.2.tar.gz  -C ../servers
cd /export/servers/
mv redis-4.0.2 redis

03 编译Redis

cd /export/servers/redis/
make MALLOC=libc
make PREFIX=/usr/local/redis install

04 准备配置文件

cd /usr/local/redis/bin/
cd /usr/local/redis
mkdir conf
vi redis_6379.conf

配置文件如下:

bind 127.0.0.1
protected-mode yes
port 6379
tcp-backlog 511
timeout 0
tcp-keepalive 300
daemonize yes
supervised no
pidfile /export/data/redis/6379/redis_6379.pid
loglevel notice
logfile "/export/data/redis/6379/log.log"
databases 16
always-show-logo yes
save 900 1
save 300 10
save 60 10000
stop-writes-on-bgsave-error yes
rdbcompression yes
rdbchecksum yes
dbfilename dump.rdb
dir /export/data/redis/6379/
slave-serve-stale-data yes
slave-read-only yes
repl-diskless-sync no
repl-diskless-sync-delay 5
repl-disable-tcp-nodelay no
slave-priority 100
lazyfree-lazy-eviction no
lazyfree-lazy-expire no
lazyfree-lazy-server-del no
slave-lazy-flush no
appendonly yes
appendfilename "appendonly.aof"
appendfsync everysec
no-appendfsync-on-rewrite no
auto-aof-rewrite-percentage 100
auto-aof-rewrite-min-size 64mb
aof-load-truncated yes
aof-use-rdb-preamble no
lua-time-limit 5000
slowlog-log-slower-than 10000
slowlog-max-len 128
latency-monitor-threshold 0
notify-keyspace-events ""
hash-max-ziplist-entries 512
hash-max-ziplist-value 64
list-max-ziplist-size -2
list-compress-depth 0
set-max-intset-entries 512
zset-max-ziplist-entries 128
zset-max-ziplist-value 64
hll-sparse-max-bytes 3000
activerehashing yes
client-output-buffer-limit normal 0 0 0
client-output-buffer-limit slave 256mb 64mb 60
client-output-buffer-limit pubsub 32mb 8mb 60
hz 10
aof-rewrite-incremental-fsync yes

05 启动服务

mkdir -p /export/data/redis/6379/
cd /usr/local/redis/bin/
./redis-server ../conf/redis_6379.conf

06 使用客户端连接

cd /usr/local/redis/bin/
./redis-cli 
127.0.0.1:6379> ping
PONG
相关实践学习
基于Redis实现在线游戏积分排行榜
本场景将介绍如何基于Redis数据库实现在线游戏中的游戏玩家积分排行榜功能。
云数据库 Redis 版使用教程
云数据库Redis版是兼容Redis协议标准的、提供持久化的内存数据库服务,基于高可靠双机热备架构及可无缝扩展的集群架构,满足高读写性能场景及容量需弹性变配的业务需求。 产品详情:https://www.aliyun.com/product/kvstore     ------------------------------------------------------------------------- 阿里云数据库体验:数据库上云实战 开发者云会免费提供一台带自建MySQL的源数据库 ECS 实例和一台目标数据库 RDS实例。跟着指引,您可以一步步实现将ECS自建数据库迁移到目标数据库RDS。 点击下方链接,领取免费ECS&RDS资源,30分钟完成数据库上云实战!https://developer.aliyun.com/adc/scenario/51eefbd1894e42f6bb9acacadd3f9121?spm=a2c6h.13788135.J_3257954370.9.4ba85f24utseFl
相关文章
|
6天前
|
存储 移动开发 Linux
Linux系统之部署h5ai目录列表程序
【5月更文挑战第3天】Linux系统之部署h5ai目录列表程序
19 1
|
4天前
|
关系型数据库 MySQL Linux
在Linux系统上实现高效安装与部署环境的全方位指南
在Linux系统上实现高效安装与部署环境的全方位指南
|
4天前
|
NoSQL Linux Redis
Redis的介绍,以及Redis的安装(本机windows版,虚拟机Linux版)和Redis常用命令的介绍
Redis的介绍,以及Redis的安装(本机windows版,虚拟机Linux版)和Redis常用命令的介绍
17 0
|
4天前
|
Linux 测试技术 网络安全
Linux系统之部署2048网页小游戏
【5月更文挑战第5天】Linux系统之部署2048网页小游戏
17 0
Linux系统之部署2048网页小游戏
|
4天前
|
前端开发 Java Linux
宝塔Linux:部署His医疗项目通过jar包的方式
宝塔Linux:部署His医疗项目通过jar包的方式
|
4天前
|
前端开发 Java 关系型数据库
2023全网最详细的若依开源项目部署,将其部署到Linux操心系统中
2023全网最详细的若依开源项目部署,将其部署到Linux操心系统中
|
5天前
|
运维 监控 Linux
如何在Linux上部署1Panel运维管理面板并远程访问内网进行操作
如何在Linux上部署1Panel运维管理面板并远程访问内网进行操作
10 0
如何在Linux上部署1Panel运维管理面板并远程访问内网进行操作
|
6天前
|
安全 Linux 网络安全
Linux _ apache服务器部署 不同域名—访问不同网站(多网站)
Linux _ apache服务器部署 不同域名—访问不同网站(多网站)
|
12天前
|
存储 Linux 文件存储
Linux使用Docker部署Traefik容器并实现远程访问管理界面-1
Linux使用Docker部署Traefik容器并实现远程访问管理界面