当前位置:网站首页>使用Jedis连接linux上的redis
使用Jedis连接linux上的redis
2022-08-10 15:58:00 【qq_45860901】
第一步:maven导入Jedis
<dependency>
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
<version>3.2.0</version>
</dependency>
第二步:redis.conf 配置文件的修改。
1,bind要注掉127.0.0.1
2,protected-mode 要改为no
3,然后重启虚拟机linux的redis。
使用systemctl restart redis 重启(这种方式重启需要保证redis安装时使用的yum,可以查看往期文章中有记载yun安装redis,巧简单哦。)
第三步:关闭linux防火墙
systemctl stop firewalld
不关闭防火墙,使用Java连接时报错:timed out
第四步:写一个测试类连接

连接成功:
用jedis 推送几个命令测试:
成功:
边栏推荐
猜你喜欢

MySQL-创建、修改和删除表

安克创新每一个“五星好评”背后,有怎样的流程管理?

Etcd Kubernetes 集群稳定性:LIST 请求源码分析、性能评估与大规模基础服务部署调优

快速申请代码签名证书方法

2022年软考复习笔记一

An ABAP tool that can print the browsing history of a user in the system for BSP applications

Recommend a few had better use the MySQL open source client, collection!

web安全入门-Kill Chain测试流程

Cesium快速上手4-Polylines图元使用讲解

【21天学习挑战赛】折半查找
随机推荐
软件配置 | pip下载第三方库文件及配置pip源的不完全总结
Chapter II Module Encyclopedia "collections Module"
I met a 25k+ from Tencent, he let me see what kind of basic ceiling
Opencv 图像超像素分割(SLIC、SEEDS、LSC)
Brainstorm: Goals and
MySQL batch update and batch update method of different values of multiple records
Kubernetes kube-proxy工作原理
关于Web渗透测试需要知道的一切:完整指南
架构设计之一——基础架构
商业智能BI行业分析思维框架:铅酸蓄电池行业(二)
cmake record
LeetCode-692. Top K Frequent Words
Mobileye携手极氪通过OTA升级开启高级驾驶辅助新篇章
Detailed understanding of all built-in functions (Part 2)
请查收 2022华为开发者大赛备赛攻略
Parse the value of uuid using ABAP regular expressions
WIZnet 物联网设计大赛 - WizFi360大赛延迟通知
Colocate Join :ClickHouse的一种高性能分布式join查询模型
二维费用的背包问题 ← 模板题
全部内置函数详细认识(中篇)