Comments (5)
配置里面的"需要转义?
报错信息可以在日志中查看
from gaea.
日志里头显示如下的错误:
[2019-09-17 13:44:40] [gaea_proxy] [MacBook-Pro-7.local] [WARN] [900000001] [github.com/XiaoMi/Gaea/proxy/server.loadAllNamespace:manager.go:69] list namespace failed, err: client: response is invalid json. The endpoint is probably not valid etcd cluster endpoint.
[2019-09-17 13:44:40] [gaea_proxy] [MacBook-Pro-7.local] [WARN] [900000001] [github.com/XiaoMi/Gaea/proxy/server.LoadAndCreateManager:manager.go:41] init namespace manager failed, client: response is invalid json. The endpoint is probably not valid etcd cluster endpoint.
[2019-09-17 13:44:40] [gaea_proxy] [MacBook-Pro-7.local] [FATAL] [900000001] [main.main:main.go:60] init manager failed, error: client: response is invalid json. The endpoint is probably not valid etcd cluster endpoint.
gaea的配置如下
; config type, etcd/file, you can test gaea with file type, you shoud use etcd in production
config_type=etcd
;file config path, 具体配置放到file_config_path的namespace目录下,该下级目录为固定目录
file_config_path=./etc/file
;coordinator addr
coordinator_addr=http://localhost:2379
;远程配置(当前为etcd)根目录
coordinator_root=/gaea
;etcd user config
username=root
password=root
;environ
environ=local
;service name
service_name=gaea_proxy
;log config
log_path=./logs
log_level=Notice
log_filename=gaea
log_output=file
;admin addr
admin_addr=0.0.0.0:13307
; basic auth
admin_user=admin
admin_password=admin
;proxy addr
proto_type=tcp4
proxy_addr=0.0.0.0:13306
proxy_charset=utf8
;slow sql time, when execute time is higher than this, log it, unit: ms
slow_sql_time=100
;close session after session timeout, unit: seconds
session_timeout=3600
;stats conf
stats_enabled=true
;encrypt key
encrypt_key=1234abcd5678efg*
本地的etcd服务,是最新的3.4.0,跑起来的状态如下所示
MacBook-Pro-7:etcd user$ ./etcdctl --write-out=table endpoint status
+----------------+------------------+---------+---------+-----------+------------+-----------+------------+--------------------+--------+
| ENDPOINT | ID | VERSION | DB SIZE | IS LEADER | IS LEARNER | RAFT TERM | RAFT INDEX | RAFT APPLIED INDEX | ERRORS |
+----------------+------------------+---------+---------+-----------+------------+-----------+------------+--------------------+--------+
| 127.0.0.1:2379 | 8e9e05c52164694d | 3.4.0 | 45 kB | true | false | 2 | 20 | 20 | |
+----------------+------------------+---------+---------+-----------+------------+-----------+------------+--------------------+--------+
from gaea.
JSON配置的数据是这样导入的,不知道有没有问题
MacBook-Pro-7:etcd user$ ./etcdctl put /gaea/namespace/test_namespace_1.json "{\"name\":\"test_namespace_1\",\"online\":true,\"read_only\":false,\"allowed_dbs\":{\"test\":true},\"slow_sql_time\":\"1000\",\"black_sql\":[\"\"],\"allowed_ip\":null,\"slices\":[{\"name\":\"slice-0\",\"user_name\":\"root\",\"password\":null,\"master\":\"127.0.0.1:3306\",\"slaves\":null,\"statistic_slaves\":null,\"capacity\":12,\"max_capacity\":24,\"idle_timeout\":60}],\"shard_rules\":[{\"db\":\"test\",\"table\":\"log\",\"type\":\"date_month\",\"key\":\"created_at\",\"slices\":[\"slice-0\"],\"date_range\":[\"201804-201910\"]}],\"users\":[{\"user_name\":\"root\",\"password\":\"root\",\"namespace\":\"test_namespace_1\",\"rw_flag\":2,\"rw_split\":1,\"other_property\":0}],\"default_slice\":\"slice-0\",\"global_sequences\":null}"
OK
MacBook-Pro-7:etcd user$ ./etcdctl get /gaea/namespace/test_namespace_1.json
/gaea/namespace/test_namespace_1.json
{"name":"test_namespace_1","online":true,"read_only":false,"allowed_dbs":{"test":true},"slow_sql_time":"1000","black_sql":[""],"allowed_ip":null,"slices":[{"name":"slice-0","user_name":"root","password":null,"master":"127.0.0.1:3306","slaves":null,"statistic_slaves":null,"capacity":12,"max_capacity":24,"idle_timeout":60}],"shard_rules":[{"db":"test","table":"log","type":"date_month","key":"created_at","slices":["slice-0"],"date_range":["201804-201910"]}],"users":[{"user_name":"root","password":"root","namespace":"test_namespace_1","rw_flag":2,"rw_split":1,"other_property":0}],"default_slice":"slice-0","global_sequences":null}
from gaea.
Etcd版本退回到3.3.15解决问题,还有个注意的地方就是往etcd写入namespace配置数据的命令如下
使用V2版本的API,V3的有点小问题
ETCDCTL_API=2 ./etcdctl set /gaea/namespace/test_namespace_1 "{\"name\":\"test_namespace_1\",\"online\":true,\"read_only\":false,\"allowed_dbs\":{\"test\":true},\"slow_sql_time\":\"1000\",\"black_sql\":[\"\"],\"allowed_ip\":null,\"slices\":[{\"name\":\"slice-0\",\"user_name\":\"root\",\"password\":null,\"master\":\"127.0.0.1:3306\",\"slaves\":null,\"statistic_slaves\":null,\"capacity\":12,\"max_capacity\":24,\"idle_timeout\":60}],\"shard_rules\":[{\"db\":\"test\",\"table\":\"log\",\"type\":\"date_month\",\"key\":\"created_at\",\"slices\":[\"slice-0\"],\"date_range\":[\"201804-201910\"]}],\"users\":[{\"user_name\":\"root\",\"password\":\"root\",\"namespace\":\"test_namespace_1\",\"rw_flag\":2,\"rw_split\":1,\"other_property\":0}],\"default_slice\":\"slice-0\",\"global_sequences\":null}"
from gaea.
V3版本etcd部署Gaea参考指导:https://blog.caixinglong.cn/archives/hnixyl
需部署gaea-cc,通过api添加namespace,不能通过etcdctl进行添加,因为Gaea存储namespace到etcd中,用户名和密码是加密过的
from gaea.
Related Issues (20)
- 使用java 8.0版本的driver连接gaea,后端mysql版本低于5.7.20时,报Unknown system variable 'transaction_isolation'
- 考虑使用 podman 进行单元测试 (consider using Podman for unit test.) HOT 3
- 分片和非分片均不支持 with rollup 语句
- 分库分表场景下,不支持跨分片insert,支持跨分片update和delete,这样是否合理?辛苦指导
- prepare类型语句出错 HOT 3
- set设置自定义变量,select返回结果为null HOT 3
- HASH模式的分表,扩容的时候必须要迁移数据库才可以吗 HOT 2
- gaea-agent在SQL端运行的代码在哪里呢?
- 执行批量更新时,Gaea代理会将SQL在结尾处添加个逗号,从而导致mysql底层执行失败。 HOT 1
- grafana数据部分数据为空,是参数填写错了吗 HOT 1
- Gaea web现在开源了吗? HOT 1
- prepare,exec方式代理导致decimal精度丢失
- gaea连接etcd,当第一个节点异常时,无法连接配置的其他节点
- geea1.2.2版本,mybatisplus执行批量更新报错
- 普通表怎么去left join分表表
- 此项目还在维护吗? HOT 1
- 支持 Create Function/Create Procedure HOT 1
- 为什么定义的xlog接口要返回error?
- 使用代理后怎么获取sql执行进程id HOT 1
- 升级gaea版本后报错commands out of sync HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gaea.