企业类网站有哪些,小米网页怎么制作,外贸网站定制建站,泰安网上车管所我这里是连接的阿里云服务器上的redis
1.阿里云服务器的安全组打开6379端口
2. 修改redis.config配置
注释掉 # bind 127.0.0.1
将 protected-mode yes 改为#xff1a;protected-mode no3. 防火墙配置开启6379端口访问
在linux中执行#xff1a; /sbin/iptables -I INPU…我这里是连接的阿里云服务器上的redis
1.阿里云服务器的安全组打开6379端口
2. 修改redis.config配置
注释掉 # bind 127.0.0.1
将 protected-mode yes 改为protected-mode no3. 防火墙配置开启6379端口访问
在linux中执行 /sbin/iptables -I INPUT -p tcp --dport 6379 -j ACCEPT redis默认端口号6379是不允许进行远程连接的在防火墙中设置6379开启远程服务
4. 重启redis
./src/redis-server redis.config5.SpringBoot测试
pom dependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter-data-redis/artifactId/dependency丫妹 redis:host: 39.105.161.140connect-timeout: 5000测试 AutowiredStringRedisTemplate stringRedisTemplate;Testvoid contextLoads() {ValueOperationsString, String operations stringRedisTemplate.opsForValue();operations.set(hello,world);String hello operations.get(hello);System.out.println(hello);}