1. application.yaml
redis:
host: xxx.xxx.xxx.xxx
port: 6379
password: xxxxx
lettuce:
pool:
max-active: 10
max-idle: 10
min-idle: 1
time-between-eviction-runs: 10s
jackson:
default-property-inclusion: non_null # JSON处理时忽略非空字段
2. pom.xml
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
<!--<version>5.1.47</version>-->
</dependency>
<!--redisson-->
<dependency>
<groupId>org.redisson</groupId>
<artifactId>redisson-spring-boot-starter</artifactId>
<version>3.13.6</version>
</dependency>
3. MobaXterm 远程虚拟机
tips:po 上这张图主要是强调 redis 需要设置密码,不过若是使用本地虚拟机不设置也可。添加密码需要修改 redis.cofig 文件,具体步骤跟着本套视频的教程来即可。
不要忘记修改 redis.config 文件后,需要使用 redis-server redis.conf 启动
即每次启动的时候,需要使用配置文件启动,否则就不会加载需要输入密码的选项。
4. 使用 xshell 方式远程虚拟机:
主要说明修改配置文件时,普通用户权限无法退出问题
① xshell 开启同一个虚拟机的多个窗口
快捷键: alt + shift + t 允许开放四个标签,多于4个会打开新的窗口
隐藏会话标签 :ctr + shift + t
② 默认复制的窗口是普通用户权限
③ 在普通用户权限下打开 readonly 文件,使用 :qa! 退出
5. 使用 RDM 可视化客户端
关于 redis-desktop-manager 客户端无法连接到 redis
需要在centos中防火墙中打开对 6379 的访问权限,使用root用户添加 6379 端口