1.下载 https://redis.io/download
2.上传到linux服务器tools文件夹下
3.解压到安装目录 tar -zxf /app/redis/redis-5.0.4.tar.gz
4.进入解压文件目录使用make对解压的Redis文件进行编译
cd /app/redis/redis-5
make
5.编译完成后进入src 用make install 进行安装
部署
1.为了方便管理,将Redis文件中的conf配置文件和常用命令移动到统一文件中
mv redis.conf /app/redis/etc/
进入src目录,移动mkreleasehdr.sh redis-benchmark redis-check-aof redis-check-rdb redis-cli redis-server到/app/redis/bin/
执行命令 :mv mkreleasehdr.sh redis-benchmark redis-check-aof redis-check-rdb redis-cli redis-server /app/redis/bin/
执行./redis-server 启动redis
6.设置后台启动redis
1)、首先编辑conf文件,将daemonize属性改为yes(表明需要在后台运行)
cd etc/
vim redis.conf
将no修改为yes
2)、再次启动redis服务,并指定启动服务配置文件
./redis-server /app/redis/etc/redis.conf
7.设置linux 通行端口redis(6379)并重启防火墙 service iptables resestart
8.查看进程netstat -tunpl|grep 6379
Exception in thread "main" redis.clients.jedis.exceptions.JedisConnectionException: java.net.SocketTimeoutException: connect timed out
出现以上问题 redis.conf 中bind 127.0.0.1 未用#注释掉
1)机器之间网络无法联通
2)ip和端口号不正确
3)虚拟机中防火墙的原因(可能性较大)
4)redis.conf 中bind 127.0.0.1 未用#注释掉
Exception in thread "main" redis.clients.jedis.exceptions.JedisDataException: DENIED Redis is running in protected mode because protected mode is enabled, no bind address was specified, no authentication password is requested to clients. In this mode connections are only accepted from the loopback interface. If you want to connect from external computers to Redis you may adopt one of the following solutions: 1) Just disable protected mode sending the command 'CONFIG SET protected-mode no' from the loopback interface by connecting to Redis from the same host the server is running, however MAKE SURE Redis is not publicly accessible from internet if you do so. Use CONFIG REWRITE to make this change permanent. 2) Alternatively you can just disable the protected mode by editing the Redis configuration file, and setting the protected mode option to 'no', and then restarting the server. 3) If you started the server manually just for testing, restart it with the '--protected-mode no' option. 4) Setup a bind address or an authentication password. NOTE: You only need to do one of the above things in order for the server to start accepting connections from the outside.
出现以上问题解决方案
1)[root@localhost bin]# cd /app/redis/redis-5.0.4/src/ 进入该目录
2)[root@localhost src]# ./redis-cli 执行该命令
127.0.0.1:6379> config set protected-mode "no" 将受保护模式改为no

最新文章

  1. asp.net mvc js 获取model值。
  2. Java的版本分类
  3. 每次点击按钮后,判断页面是否已经有该行,没有弹出repeater的一行,并给他赋一个这行附值,没有则跳出
  4. Hololens开发笔记之Gaze凝视射线
  5. Android,使用Intent或Bundle传递参数,跳转页面。
  6. [codility]PrefixMaxProduct
  7. python 加密模块安装
  8. FineReport使用总结
  9. OpenCASCADE BRepMesh - 2D Delaunay Triangulation
  10. Sql中根据旧表创建新表的SQL语句
  11. python多线程爬虫+批量下载斗图啦图片项目(关注、持续更新)
  12. SQL Server 迁移至MySQL 关键步骤的梳理总结
  13. docker的基础命令
  14. Mysql基本操作命令【转载】
  15. DevExpress v18.2新版亮点——Reporting篇(一)
  16. gmail及youtube
  17. jQuery的end() 方法
  18. Watto and Mechanism CodeForces - 514C (字典树,哈希)
  19. 续drone 1.0 新界面调整
  20. Codeforces Beta Round #61 (Div. 2)

热门文章

  1. 从乘法求导法则到BPTT算法
  2. React + TypeScript + Taro前端开发小结
  3. 发布nuget包的正确姿势---cicd自动打包发布nuget包
  4. Spring Retry 在SpringBoot 中的应用
  5. js实现图片懒加载原理
  6. jmeter元件分析
  7. Java面试题资料合集
  8. 『现学现忘』Git基础 — 18、Git对象的总结
  9. 《Streaming Systems》第三章: Watermarks
  10. 10大黑客专用的 Linux 操作系统