当前位置:网站首页>Redis - the solution to the failure of connecting to the redis server in linux using jedis
Redis - the solution to the failure of connecting to the redis server in linux using jedis
2022-08-11 05:32:00 【cute tiger】
First of all, we need to introduce dependencies:
org.springframework.boot spring-boot-starter-data-redis redis.clients jedis Open the redis server in linux:
redis-server /xxx/xxx/redis.conf
If you are prompted to connect to the solution:
1. Check the redis-conf file
1.1 daemonize yes
1.2 bind 127.0.0.1 is commented out
1.3 protected-mode is no
2.linux firewall settings
systemctl stop firewalld.service #stopfirewall
systemctl disable firewalld.service #Disable firewall startup
firewall-cmd --zone=public --add-port=6379/tcp --permanent open port 6379
Test:
@Testvoid testCon(){Jedis jedis = new Jedis("192.168.80.128",6379);jedis.set("s", "success");String ping = jedis.ping();System.out.println(ping+","+jedis.get("s"));}//result:PONG,success边栏推荐
- Idea 2021.3.3版本文件目录展开
- postman脚本的应用
- PyTorch显存机制分析
- 【嵌入式开源库】cJSON的使用,高效精简的json解析库
- for循环使用多线程优化
- pip 国内源下载
- Redis-数据类型(基本指令、String、List、Set、Hash、ZSet、BitMaps、HyperLogLog、GeoSpatial)/发布和订阅
- Golden Warehouse Database KingbaseGIS User Manual (6.10. Geometric Object Operation Operator)
- 基于TF-IDF 文本相似性实战 详细教程
- 让你代码越来越高大上的技巧——代码规范,你得知道
猜你喜欢
随机推荐
arraylist之与linkedlist
You must understand - the nine built-in objects and four domain objects of JSP
BitLocker的解密
Golden Warehouse Database KingbaseGIS User Manual (6.10. Geometric Object Operation Operator)
[ARM] rk3399 mounts nfs error
Idea essential skills to improve work efficiency
博客目录管理 :机器学习 深度学习 nlp
金仓数据库 KingbaseGIS 使用手册(6.8. 几何对象输入函数)
【嵌入式开源库】MultiButton的使用,简单易用的事件驱动型按键驱动模块
将double类型的数据转为字符串
Unity WebGL RuntimeError: integer overflow
Unity WebGL RuntimeError: integer overflow(整数溢出问题)
注解式编程小记
Redis详解
MySQL数据库管理
About CC Attacks
BGP综合实验
[Untitled] 2022 Amination Process Exam Questions Mock Exam Question Bank and Online Mock Exam
(二)性能实时监控平台搭建(Grafana+Prometheus+Jmeter)
C Language: Practical Debugging Tips









