flike/kingshard

启动时报no master database

muye100110 opened this issue · 2 comments

配置完ks.yml后,启动报错:ERROR - main.go:[108] - [main] "main" "no master database" "" conn_id=0
以下是配置文件:

server listen addr

addr : 0.0.0.0:9696

prometheus server listen addr

prometheus_addr : 0.0.0.0:7080

server user and password

user_list:

user :  root
password : root
  • user : kingshard
    password : kingshard

the web api server

web_addr : 0.0.0.0: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 : /Users/flike/log

log level[debug|info|warn|error],default error

log_level : debug

if set log_sql(on|off) off,the sql log will not output

log_sql: on

only log the query that take more than slow_log_time ms

#slow_log_time : 100

the path of blacklist sql file

all these sqls in the file will been forbidden by kingshard

#blacklist_sql_file: /Users/flike/blacklist

only allow this ip list ip to connect kingshard

support ip and ip segment

#allow_ips : 127.0.0.1,192.168.15.0/24

the charset of kingshard, if you don't set this item

the default charset of kingshard is utf8.

#proxy_charset: gbk

node is an agenda for real remote mysql server.

nodes :

name : node1 

# default max conns for mysql server
max_conns_limit : 32

# all mysql in a node must have the same user and password
user :  snsoft 
password : Snsoft2019!

# master represents a real mysql master server 
master : 127.0.0.1:3306

# slave represents a real mysql salve server,and the number after '@' is 
# read load weight of this slave.
#slave : 192.168.59.101:3307@2,192.168.59.101:3307@3
down_after_noalive : 32
  • #name : node2

    default max conns for mysql server

    max_conns_limit : 32

    all mysql in a node must have the same user and password

    #user : root
    #password : root

    master represents a real mysql master server

    master : 127.0.0.1:3309

    slave represents a real mysql salve server

    slave :

    down mysql after N seconds noalive

    0 will no down

    down_after_noalive: 32

schema defines sharding rules, the db is the sharding table database.

schema_list:

user: snsoft
nodes: [node1]
default: node1      
shard:
-   
    db: kingshard
    table: t_sta_sale
    key: day_time
    nodes: [node1]
    type: date_year

怎么解决的呢??

怎么解决的呢??

没解决了,问题太多,启动不起来了