今天有需求,本地远程连接 腾讯云redis 服务器,服务器运维知识有限,搜索了不少文章,总算尝试出来了,记录下。(模模糊糊记得之前好像操作 aliyun 就做过类似这种的)
参考文章:
https://cloud.tencent.com/developer/ask/120909
1.腾讯云服务器,配置安全策略(默认好像就是开放所有端口)
https://cloud.tencent.com/document/product/213/18197#typical
2.服务器 iptables 配置,需要开放 6379 端口(这一步,可能有些系统不需要,我的需要)
iptables -I INPUT -p tcp --dport 6379 -j ACCEPT
service iptables save
https://blog.csdn.net/qq_27631797/article/details/79062574
3.redis 配置
# bind 127.0.0.1 // redis 默认只允许本机访问,注释
protected-mode no // 将保护模式关闭
requirepass dongxuemin // 为了安全,可开启密码验证
service redis-server restart // 重启 redis
redis 查看已加载的配置:
redis-cli -h 127.0.0.1 -p 6379 -a dongxuemin
config get * // 查看所有记录
config get dir // 查看 redis 数据库存储目录
ping - 用来测试指定服务器的 80 端口,是否开放
ping xxx
tcping - 测试服务器指定端口是否开放
tcping xxx 6379 - 测试 6379 端口是否开放
远程连接 腾讯云 redis 服务器
猜你喜欢
转载自blog.csdn.net/beyond__devil/article/details/82349106
今日推荐
周排行