linux cenos redis 单机部署

编译安装redis(Centos)

编译安装前先安装编译基础环境:

bash 复制代码
yum install -y gcc gcc-c++ 
yum install -y readline-devel 
yum install -y zlib-devel 
yum -y install pcre 
yum -y install pcre-devel 
yum -y install openssl 
yum -y install openssl-devel 
yum -y install gd-devel

1. 下载redis源码包

Redis源码包下载地址:nginx源码包下载

2. 上传redis源码包到服务器

通过文件传输工具上传到服务器指定目录,此处上传的目录是/home/tdhtkg/redisServer

3. 解压缩redis源码包

bash 复制代码
tar xzf redis-5.0.9.tar.gz

4. 编译安装redis

进入解压后的文件目录

bash 复制代码
cd redis-5.0.9

执行

bash 复制代码
make

成功后执行

bash 复制代码
make PREFIX= /home/tdhtkg/redisServer/redis install

PREFIX= /home/tdhtkg/redisServer/redis 命令为指定安装目录 安装结束后会看到安装目录

5. 修改配置文件

进入redis-5.0.9

bash 复制代码
cd redis-5.0.9

查看配置文件:vi redis.conf

修改任意ip可访问:

修改后台启动:

修改密码访问:

requirepass 后面写自己的密码

修改完了以后:wq保存退出
6. 启动redis

进入redis指定安装目录

bash 复制代码
cd /home/tdhtkg/redisServe/redis
pwd

指定配置文件启动redis

bash 复制代码
./bin/redis-server ../redis-5.0.9/redis.conf

查看redis进程 ps -ef | grep redis

并查看进程目录是否为我们指定的redis安装目录 pwdx 16600

7. 使用连接工具测试

打开redisDesktop

输入redis的ip和设置的密码连接

相关推荐
阿里云大数据AI技术9 小时前
阿里云 EMR AI 助手正式发布:从问答工具到全栈智能运维助手
运维·人工智能
orion571 天前
Missing Semester Class1:course overview and introduction of shell
linux
SkyWalking中文站1 天前
认识 Horizon UI · 6/17:Trace 探索器
运维·监控·自动化运维
用户120487221611 天前
Linux驱动编译与加载
linux·嵌入式
火车叼位1 天前
写给初级开发者:SSL、SSH、HTTPS 与证书体系全解析
运维
vivo互联网技术2 天前
从 10 分钟到 1 秒:ES 深度分页任意跳页的三轮优化实战
服务器·数据库·redis·elasticsearch·深度分页
用户805533698032 天前
Input 子系统架构:Core、Handler、Driver 三层是怎么协作的
linux·嵌入式
用户805533698032 天前
RK-Forge外设系列开篇 - 把板子从「能启动」变成「能用」:Ethernet/SPI/MMC 三个纯接线外设
linux·github·嵌入式
小猿姐2 天前
唯品会大规模数据库云原生实践:基于 KubeBlocks 管理数千实例的统一运维之路
运维·elasticsearch·云原生