zoukankan      html  css  js  c++  java
  • redis 拒绝远程访问解决

    启动时报的警告:

    1、Warning: no config file specified, using the default config. In order to specify a config file use ./src/redis-server /path/to/redis.conf

    就因为这个原因,无法连接到远程redis:Unable to connect to 192.168.163.131:6379

    解决:

    [root@cent7-zuoys src]# ./redis-server ../redis.conf

    2、

    WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.

    解决:

    编辑/etc/sysctl.conf ,改vm.overcommit_memory=1,然后sysctl -p 使配置文件生效

    3、The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.

    解决:

    在/etc/sysctl.conf中添加:net.core.somaxconn = 2048,然后在终端中执行sysctl -p

    4、

    you have Transparent Huge Pages (THP) support enabled in your kernel.?This will create latency and memory usage issues with Redis.?To fix thisissue run the?command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root,?and add it to your /etc/rc.local in order to retain thesetting after a reboot.?Redis must be restarted after THP is disabled.

    解决:

    临时解决方法:
    
    echo never > /sys/kernel/mm/transparent_hugepage/enabled。
    
    永久解决方法:
    
    将其写入/etc/rc.local文件中。

    远程访问redis报错:

    org.springframework.data.redis.RedisConnectionFailureException: Unable to connect to Redis; nested exception is io.lettuce.core.RedisConnectionException: Unable to connect to 10.134.253.30:6379

    解决:

    vi redis.conf

    1、注释掉 bind 127.0.0.1,即可让所有ip访问
    2、protected-mode no
  • 相关阅读:
    在Eclipse上实现简单的JDBC增删查改操作
    Java学习路线:day12 面向对象(中)
    Java学习路线:day11 客户信息管理软件
    Android个人手机通讯录开发详解
    解决:keeps stopping(停止运行)
    Java学习路线:day10 面向对象(上)3
    2020最新版大数据学习路线
    Java学习路线:day9 面向对象(上)2
    一个简单的ASP登录页面
    Python笔记_第四篇_高阶编程_检测_2.对类进行单元检测
  • 原文地址:https://www.cnblogs.com/yaoyuan2/p/9808890.html
Copyright © 2011-2022 走看看