Coder Social home page Coder Social logo

云服务器ping时出错 about kingshard HOT 2 CLOSED

smallevil avatar smallevil commented on July 17, 2024
云服务器ping时出错

from kingshard.

Comments (2)

smallevil avatar smallevil commented on July 17, 2024

补充说明一下:
1.使用的go 1.16编译,centos 7系统yum直接安装的
2.只是sys.log报错,不影响使用,因为只有一台机器,所以不清楚这样的话,从库会不会被判断成down

以下为配置文件:

# kingshard的地址和端口
addr : 0.0.0.0:9696

# prometheus server listen addr
prometheus_addr : 127.0.0.1:7080

# 连接kingshard的用户名和密码的用户列表
user_list:
-
    user : kingshard
    password : 111111

# the web api server
web_addr : 127.0.0.1:9797
#HTTP Basic Auth
web_user : admin
web_password : admin

# if set log_path, the sql log will write into log_path/sql.log,the system log
# will write into log_path/sys.log
log_path : /root/kingshard

# log level[debug|info|warn|error],default error
log_level : debug

# 打开SQL日志,设置为on;关闭SQL日志,设置为off
log_sql: on

# 如果设置了该项,则只输出SQL执行时间超过slow_log_time(ms)毫秒的SQL日志,不设置则输出全部SQL日志
slow_log_time : 100

# sql黑名单文件路径
# 所有在该文件中的sql都会被kingshard拒绝转发
#blacklist_sql_file: /Users/flike/blacklist

# 只允许下面的IP列表连接kingshard,如果不配置则对连接kingshard的IP不做限制
# allow_ips : 127.0.0.1

# kingshard使用的字符集,如果不设置该选项,则kingshard使用utf8作为默认字符集
proxy_charset: utf8mb4

# 一个node节点表示mysql集群的一个数据分片,包括一主多从(可以不配置从库)
nodes :
-
    name : node1

    # 连接池中最大的空闲连接数,也就是kingshard最多与后端DB建立max_conns_limit个连接
    max_conns_limit : 64

    # kingshard连接该node中mysql的用户名和密码,master和slave的用户名和密码必须一致
    user :  root
    password : 1111

    # master的地址和端口
    master : 127.0.0.1:3306

    # slave的地址、端口和读权重,@后面的表示该slave的读权重。可不配置slave
    # read load weight of this slave.
    #slave : 127.0.0.1:3309@1,192.168.0.13@2
    # kingshard在300秒内都连接不上mysql,kingshard则会下线该mysql
    #down_after_noalive : 32

# 各用户的分表规则
schema_list :
-
    # schema的所属用户名
    user: kingshard
    # 分表分布的node名字
    nodes: [node1]
    #
    default: node1
    shard:
    -

from kingshard.

smallevil avatar smallevil commented on July 17, 2024

已查明,此问题是因为interactive_timeout和wait_timeout设置引起的.
这两个值有任一个设置小于20,就会出现此报错.但不影响使用.
必须两个同时设置20以上才行.之后就不会再报错了.

有哪个有经验的大哥说一下,这两个值在有mysql proxy时应该设多少合适?

from kingshard.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.