主要编程语言GO,关注微服务,关注Flutter,致力于app开发整套技术栈。
shiguanghuxian / etcd-manage Goto Github PK
View Code? Open in Web Editor NEW一个现代的etcd v3管理ui
Home Page: http://140.143.234.132:10280/ui/#/key/kv
License: MIT License
一个现代的etcd v3管理ui
Home Page: http://140.143.234.132:10280/ui/#/key/kv
License: MIT License
主要编程语言GO,关注微服务,关注Flutter,致力于app开发整套技术栈。
我试过网上很多可视化,(etcd-viewer, etcd-manager, 还有你的etcd-manage), 我很难过, 没有任何一个是能正常使用的, 比如etcd-viewer报错连接重设, etcd-manager报错Cannot read property 'getAll' of null.
你的v2报错没有 server 这种配置
你的v1能运行起来, 但是打开会报错 Etcd client is empty
我不知道我做错了什么上天要如此惩罚我
能不能告诉我v2应该怎么配置
main.go:18: line 27: field corresponding to `server' is not defined in config.Config
我们的项目部署在集群中,我们想对一些操作进行限制,所以使用了Basic Auth,我在etcd集群中创建了root权限和root用户,同时我在etcd-manage的配置文件中对应的写好账号和密码,但是会报一些错误,你能来帮我看一下吗?感激不尽
具体报错信息:
@shiguanghuxian
Heya
I keep getting an error with the "members tab" and the Key tab" when I use tls. I worked fine with tls on false, but I want to use it with tls now.
This works:
curl -v "{{FQDN}}:2379" -XPOST --cert /root/go/src/github.com/shiguanghuxian/etcd-manage/bin/tlskey/etcd.pem --key /root/go/src/github.com/shiguanghuxian/etcd-manage/bin/tlskey/etcd-key.pem --cacert /root/go/src/github.com/shiguanghuxian/etcd-manage/bin/tlskey/etcd-root-ca.pem --capath /root/go/src/github.com/shiguanghuxian/etcd-manage/bin/tlskey/ -d '{}'
And i get:
POST / HTTP/1.1
User-Agent: curl/7.29.0
Host: {{FQDN}}:2379
Accept: /
But when I try to use the etcd-manager UI it give me this error:
{"level":"error","ts":1550672173.158422,"caller":"v1/v1.go:51","msg":"Get key list error","err":"context deadline exceeded","stacktrace":"github.com/shiguanghuxian/etcd-manage/program/v1.getEtcdKeyList.func1\n\t/root/go/src/github.com/shiguanghuxian/etcd-manage/program/v1/v1.go:51\ngithub.com/shiguanghuxian/etcd-manage/program/v1.getEtcdKeyList\n\t/root/go/src/github.com/shiguanghuxian/etcd-manage/program/v1/v1.go:70\ngithub.com/shiguanghuxian/etcd-manage/vendor/github.com/gin-gonic/gin.(*Context).Next\n\t/root/go/src/github.com/shiguanghuxian/etcd-manage/vendor/github.com/gin-gonic/gin/context.go:108\ngithub.com/shiguanghuxian/etcd-manage/program.(*Program).middlewareEtcd.func1\n\t/root/go/src/github.com/shiguanghuxian/etcd-manage/program/http.go:123\ngithub.com/shiguanghuxian/etcd-manage/vendor/github.com/gin-gonic/gin.(*Context).Next\n\t/root/go/src/github.com/shiguanghuxian/etcd-manage/vendor/github.com/gin-gonic/gin/context.go:108\ngithub.com/shiguanghuxian/etcd-manage/vendor/github.com/gin-gonic/gin.RecoveryWithWriter.func1\n\t/root/go/src/github.com/shiguanghuxian/etcd-manage/vendor/github.com/gin-gonic/gin/recovery.go:48\ngithub.com/shiguanghuxian/etcd-manage/vendor/github.com/gin-gonic/gin.(*Context).Next\n\t/root/go/src/github.com/shiguanghuxian/etcd-manage/vendor/github.com/gin-gonic/gin/context.go:108\ngithub.com/shiguanghuxian/etcd-manage/vendor/github.com/gin-gonic/gin.LoggerWithWriter.func1\n\t/root/go/src/github.com/shiguanghuxian/etcd-manage/vendor/github.com/gin-gonic/gin/logger.go:84\ngithub.com/shiguanghuxian/etcd-manage/vendor/github.com/gin-gonic/gin.(*Context).Next\n\t/root/go/src/github.com/shiguanghuxian/etcd-manage/vendor/github.com/gin-gonic/gin/context.go:108\ngithub.com/shiguanghuxian/etcd-manage/vendor/github.com/gin-gonic/gin.(*Engine).handleHTTPRequest\n\t/root/go/src/github.com/shiguanghuxian/etcd-manage/vendor/github.com/gin-gonic/gin/gin.go:363\ngithub.com/shiguanghuxian/etcd-manage/vendor/github.com/gin-gonic/gin.(*Engine).ServeHTTP\n\t/root/go/src/github.com/shiguanghuxian/etcd-manage/vendor/github.com/gin-gonic/gin/gin.go:328\nnet/http.serverHandler.ServeHTTP\n\t/usr/local/go/src/net/http/server.go:2741\nnet/http.initNPNRequest.ServeHTTP\n\t/usr/local/go/src/net/http/server.go:3291\nnet/http.Handler.ServeHTTP-fm\n\t/usr/local/go/src/net/http/h2_bundle.go:5592\nnet/http.(*http2serverConn).runHandler\n\t/usr/local/go/src/net/http/h2_bundle.go:5877"}
This is my cfg.toml config:
`http 监听端口
[http]
监听地址
address = "0.0.0.0"
监听端口
port = 10280
使用 Let's Encrypt 证书 - tls_enable为true优先使用本地证书模式
tls_encrypt_enable = false
域名列表
tls_encrypt_domain_names = ["shiguanghuxian.com"]
是否启用tls
tls_enable = true
tls证书文件
[http.tls_config]
cert_file = "/root/go/src/github.com/shiguanghuxian/etcd-manage/bin/tlskey/etcd.pem"
key_file = "/root/go/src/github.com/shiguanghuxian/etcd-manage/bin/tlskey/etcd-key.pem"
一下每一个server为一个etcd服务 ##
[[server]]
显示名称
title = "EMcluster"
标识名 - 只能是字母数字或下划线
name = "pita"
etcd连接地址 如果为集群请填写全部地址
address = ["{{FQDNx}}:2379","{{FQDNy}}:2379","{{FQDNz}}:2379"]
查看的key前缀
key_prefix = "/"
简述信息
desc = "woef"
可访问服务器角色列表 - 不写则为所有用户可访问
roles = ["admin"]
是否启用tls连接
tls_enable = true
tls证书配置
[server.tls_config]
cert_file = "/root/go/src/github.com/shiguanghuxian/etcd-manage/bin/tlskey/etcd.pem"
key_file = "/root/go/src/github.com/shiguanghuxian/etcd-manage/bin/tlskey/etcd-key.pem"
ca_file = "/root/go/src/github.com/shiguanghuxian/etcd-manage/bin/tlskey/etcd-root-ca.pem"`
Any idea what I'm doing wrong?
HI,
Is there any good way to change frontend baseURL (for axios), which now defaults to 127.0.0.1:10280?
TYPE | NAME | KEY | Version|Value
这样 多一列 value值 看起来就更清爽了,而不用每个都点进去看
cert_file
key_file
ca_file
有dockerfile吗?编译了,直接可以运行看到demo那种
求问
Hey!
Thank you for your etcd-manage it works great. Im trying the English version/option but it doesn't translate everything. I used some sed commands(on RHEL7) to change the Chinese to English and it worked fine for the most part. Only the "filter"(筛选) button on the LOGS tab and the "repair directory"(修复目录) button on the SERVER tab dont translate for me. These are the sed command I used before I compiled the binary.
`sed -i 's/确定删除/Confirm delete/g' /root/go/src/github.com/shiguanghuxian/etcd-manage/static/src/views/Keys.vue
sed -i 's/key不能为空/key can not be empty/g' /root/go/src/github.com/shiguanghuxian/etcd-manage/static/src/views/Keys.vue
sed -i 's/添加成功!/Added successfully!/g' /root/go/src/github.com/shiguanghuxian/etcd-manage/static/src/views/Keys.vue
sed -i 's/保存成功!/Successfully saved!/g' /root/go/src/github.com/shiguanghuxian/etcd-manage/static/src/views/Keys.vue
sed -i 's/确定删除/Confirm delete/g' /root/go/src/github.com/shiguanghuxian/etcd-manage/static/src/views/Keys.vue
sed -i 's/日期/Date/g' /root/go/src/github.com/shiguanghuxian/etcd-manage/static/src/views/Logs.vue
sed -i 's/请选择日期/Please select a date/g' /root/go/src/github.com/shiguanghuxian/etcd-manage/static/src/views/Logs.vue
sed -i 's/用户/User/g' /root/go/src/github.com/shiguanghuxian/etcd-manage/static/src/views/Logs.vue
sed -i 's/类型/Types of/g' /root/go/src/github.com/shiguanghuxian/etcd-manage/static/src/views/Logs.vue
sed -i 's/筛选/Filter/g' /root/go/src/github.com/shiguanghuxian/etcd-manage/static/src/views/Logs.vue
sed -i 's/选择日期查看日志/Select date to view the log/g' /root/go/src/github.com/shiguanghuxian/etcd-manage/static/src/views/Logs.vue
sed -i 's/请选择日期/Please select date/g' /root/go/src/github.com/shiguanghuxian/etcd-manage/static/src/views/Logs.vue
sed -i 's/docker方式etcd非集群方式/Docker mode etcd cluster mode/g' /root/go/src/github.com/shiguanghuxian/etcd-manage/bin/config/cfg.toml
sed -i 's/本地etcd/Local etcd/g' /root/go/src/github.com/shiguanghuxian/etcd-manage/bin/config/cfg.toml
sed -i 's/本机环境/Native environment/g' /root/go/src/github.com/shiguanghuxian/etcd-manage/bin/config/cfg.toml
sed -i 's/docker方式etcd集群方式/Docker mode etcd cluster mode/g' /root/go/src/github.com/shiguanghuxian/etcd-manage/bin/config/cfg.toml
sed -i 's/docker方式etcd非集群方式/Docker mode etcd cluster mode/g' /root/go/src/github.com/shiguanghuxian/etcd-manage/config/cfg.toml
sed -i 's/本地etcd/Local etcd/g' /root/go/src/github.com/shiguanghuxian/etcd-manage/config/cfg.toml
sed -i 's/本机环境/Native environment/g' /root/go/src/github.com/shiguanghuxian/etcd-manage/config/cfg.toml
sed -i 's/程序退出/Program exit/g' /root/go/src/github.com/shiguanghuxian/etcd-manage/main.go
sed -i 's/启动HTTP服务/Start HTTP the service/g' /root/go/src/github.com/shiguanghuxian/etcd-manage/program/http.go
sed -i 's/启用tls必须配置证书文件路径/Enable tls must configure certificate file path/g' /root/go/src/github.com/shiguanghuxian/etcd-manage/program/http.go
sed -i 's/域名列表不能为空/The domain name list cannot be empty/g' /root/go/src/github.com/shiguanghuxian/etcd-manage/program/http.go
sed -i 's/etcd服务不存在/The etcd service does not exist/g' /root/go/src/github.com/shiguanghuxian/etcd-manage/program/http.go
sed -i 's/无权限访问/No access/g' /root/go/src/github.com/shiguanghuxian/etcd-manage/program/http.go
sed -i 's/修复目录/Repair directory/g' /root/go/src/github.com/shiguanghuxian/etcd-manage/static/src/views/EtcdServer.vue
sed -i 's/确定修复etcd key的目录问题/Determine the directory problem for repairing the etcd key/g' /root/go/src/github.com/shiguanghuxian/etcd-manage/static/src/views/EtcdServer.vue
sed -i 's/获取列表/Get list/g' /root/go/src/github.com/shiguanghuxian/etcd-manage/program/v1/v1.go
sed -i 's/获取key列表错误/Get key list error/g' /root/go/src/github.com/shiguanghuxian/etcd-manage/program/v1/v1.go
sed -i 's/获取key列表错误/Get the value of the key/g' /root/go/src/github.com/shiguanghuxian/etcd-manage/program/v1/v1.go
sed -i 's/获取key值的值错误/Get the value of the key value incorrectly/g' /root/go/src/github.com/shiguanghuxian/etcd-manage/program/v1/v1.go
sed -i 's/获取etcd集群信息/Get etcd cluster information/g' /root/go/src/github.com/shiguanghuxian/etcd-manage/program/v1/v1.go
sed -i 's/获取服务节点错误/Get service node error/g' /root/go/src/github.com/shiguanghuxian/etcd-manage/program/v1/v1.go
sed -i 's/删除key/Delete key/g' /root/go/src/github.com/shiguanghuxian/etcd-manage/program/v1/v1.go
sed -i 's/删除key错误/Delete key error/g' /root/go/src/github.com/shiguanghuxian/etcd-manage/program/v1/v1.go
sed -i 's/保存key/Save key/g' /root/go/src/github.com/shiguanghuxian/etcd-manage/program/v1/v1.go
sed -i 's/保存key错误/Save key error/g' /root/go/src/github.com/shiguanghuxian/etcd-manage/program/v1/v1.go
sed -i 's/参数错误/Parameter error/g' /root/go/src/github.com/shiguanghuxian/etcd-manage/program/v1/v1.go
sed -i 's/目录不能修改/Directory cannot be modified/g' /root/go/src/github.com/shiguanghuxian/etcd-manage/program/v1/v1.go
sed -i 's/格式化显示key/Format display key/g' /root/go/src/github.com/shiguanghuxian/etcd-manage/program/v1/v1.go
sed -i 's/key不能为空/Key cannot be empty/g' /root/go/src/github.com/shiguanghuxian/etcd-manage/program/v1/v1.go
sed -i 's/不支持的格式/Unsupported format/g' /root/go/src/github.com/shiguanghuxian/etcd-manage/program/v1/v1.go
sed -i 's/获取etcd服务列表/Get the etcd service column table/g' /root/go/src/github.com/shiguanghuxian/etcd-manage/program/v1/v1.go
sed -i 's/配置为nil/Configured as nil/g' /root/go/src/github.com/shiguanghuxian/etcd-manage/program/v1/v1.go
sed -i 's/解析日志文件错误/Parse log file error/g' /root/go/src/github.com/shiguanghuxian/etcd-manage/program/v1/v1.go
sed -i 's/读取日志文件错误/Read log file error/g' /root/go/src/github.com/shiguanghuxian/etcd-manage/program/v1/v1.go
sed -i 's/没有日志/No log/g' /root/go/src/github.com/shiguanghuxian/etcd-manage/program/v1/v1.go
sed -i 's/查看日志错误/View log errors/g' /root/go/src/github.com/shiguanghuxian/etcd-manage/program/v1/v1.go
sed -i 's/获取key的值/Get the value of the key/g' /root/go/src/github.com/shiguanghuxian/etcd-manage/program/v1/v1.go
sed -i 's/配置为nil/Configured as nil/g' /root/go/src/github.com/shiguanghuxian/etcd-manage/program/v1/v1.go
sed -i 's/修复数据错误/Fix data error/g' /root/go/src/github.com/shiguanghuxian/etcd-manage/program/v1/v1.go
sed -i 's/解析日志文件错误/Parse log file error/g' /root/go/src/github.com/shiguanghuxian/etcd-manage/program/v1/v1.go
sed -i 's/读取日志文件错误/Read log file error/g' /root/go/src/github.com/shiguanghuxian/etcd-manage/program/v1/v1.go
sed -i 's/路径文本框/Path text box/g' /root/go/src/github.com/shiguanghuxian/etcd-manage/static/src/views/Keys.vue
sed -i 's/语言/Language/g' /root/go/src/github.com/shiguanghuxian/etcd-manage/static/src/views/Keys.vue
sed -i 's/展示方式切换/Display mode switching/g' /root/go/src/github.com/shiguanghuxian/etcd-manage/static/src/views/Keys.vue
sed -i 's/方式展示/way display/g' /root/go/src/github.com/shiguanghuxian/etcd-manage/static/src/views/Keys.vue`
均可参考etcd keeper
另外一个bug:windows上直接运行exe文件报错:
2019-01-17 10:49:51.699147 I | 2019/01/17 10:49:51 main.go:18: couldn't open sink "C:\Users\win\Downloads\etcd-manage_windows\etcd-manage_windows\logs/20190117.log": no sink found for scheme "c"
cfg.toml
# debug模式
debug = true
# 日志文件路径
log_path = ""
# http 监听端口
[http]
# 监听地址
address = "0.0.0.0"
# 监听端口
port = 10280
## 一下每一个server为一个etcd服务 ##
[[server]]
# 显示名称
title = "测试环境"
# 标识名
name = "qa"
# etcd连接地址 如果为集群请填写全部地址
address = ["172.17.11.141:2379"]
# 查看的key前缀
key_prefix = "/"
# 简述信息
desc = "环境etcd"
# 可访问服务器角色列表 - 不写则为所有用户可访问
roles = ["admin","dev"]
## 以下为用户列表 ##
[[user]]
username = "admin"
password = "123456"
role = "admin"
[[user]]
username = "dev_user"
password = "123456"
role = "dev"
Let me know if I can help you translate.
This could help project internationalization.
运行make build报错:
main.go:8:2: cannot find package "github.com/shiguanghuxian/etcd-manage/program" in any of:
/usr/local/go/src/github.com/shiguanghuxian/etcd-manage/program (from $GOROOT)
/Users/liuwei/go/src/github.com/shiguanghuxian/etcd-manage/program (from $GOPATH)
make: *** [build] Error 1
查找原因是仓库找不到,直接在浏览器里访问这个仓库报404
github.com/shiguanghuxian/etcd-manage/program
如题,不知道是有什么特殊配置?
etcd-manage 增加的key,通过etcdctl get也取不到
这几天在构思基于ETCD做配置中心的事情,想做成目录树管理的方式。结果赫然发现你的这个项目。
不过作为配置中心,还需要加入:权限管理、配置校验、灰度发布、发布审核等功能,可以一起开发么?
打开首页的时候,提示Etcd client is empty
使用的版本是https://github.com/shiguanghuxian/etcd-manage/releases/download/1.1.0/etcd-manage_linux_amd64.zip
k8s数据里面value都是乱码的,怎么才能不乱码咧?
as title descibe
我把dev-v2的代码拉下来 然后使用make docker_run 这个命令 但是启动后 我访问的界面是就原来的UI 和demo不一样 要怎么解决呢
使用环境:
CentOS 7.6.1810
Docker 18.09.3
Docker Compose 1.21.2
问题描述:
在etcd-manage文件下直接使用 docker-compose up
运行容器,在加载KEYS下选择服务器会报“Etcd client is empty”错误,有时候也会报“context deadline exceeded”错误。
解决思路:
同一台主机上不同Docker容器之间网络通信会受到限制,因此尝试将etcd和etcd-manage运行在两台主机,果然错误消失:)
解决方法:
1.简单方法。使用 --link
参数链接两个容器,按照以下内容修改"docker-compose.yml"重新运行容器,错误消除。
`version: '3'
services:
etcd:
image: "quay.io/coreos/etcd:v3.3"
container_name: "etcdv3.3"
environment:
ETCD_ADVERTISE_CLIENT_URLS: "http://0.0.0.0:2379"
ETCD_LISTEN_CLIENT_URLS: "http://0.0.0.0:2379"
ETCDCTL_API: "3"
volumes:
- ./default.etcd:/default.etcd
ports:
- 2379:2379
- 2380:2380
- 4001:4001
etcd-manage:
# build: .
image: "shiguanghuxian/etcd-manage"
volumes:
- ./bin/config/cfg.toml:/app/config/cfg.toml
- ./bin/logs:/app/logs
ports:
- "10280:10280"
links:
- etcd
depends_on:
- etcd
`
2.另一种方法:在防火墙配置文件"/etc/firewalld/zones/public.xml"里面加入规则,允许Docker网络访问主机网络即可。
公司用的是v2,没用v3,manage看着确实好啊,可能。。。没v2的,不知道有没有v2转v3的功能,很想用这个etcd-manage
I tried running from dev branch. Below is the log.
[[server]] title = "make manager_run" name = "manager_run" address = ["foobar.cosmosdb.com:2379"] key_prefix = "/" desc = "docker way etcd cluster mode" roles = ["admin"] tls_enable = true [server.tls_config] cert_file = "/home/raushank/go/src/github.com/shiguanghuxian/etcd-manage/bin/tlskey/etcdserver.crt" key_file = "/home/raushank/go/src/github.com/shiguanghuxian/etcd-manage/bin/tlskey/etcdserver.key" ca_file = "/home/raushank/go/src/github.com/shiguanghuxian/etcd-manage/bin/tlskey/ca.crt"
{"level":"warn","ts":1571601848.3670743,"caller":"program/http.go:121","msg":"Got etcd as manager_run"}
{"level":"info","ts":1571601848.3683703,"caller":"v1/v1.go:522","msg":"Save key","user":"admin","role":"admin"}
{"level":"error","ts":1571601856.056904,"caller":"v1/v1.go:202","msg":"Save key error","err":"context deadline exceeded","stacktrace":"github.com/shiguanghuxian/etcd-manage/program/v1.saveEtcdKey.func1\n\t/home/raushank/go/src/github.com/shiguanghuxian/etcd-manage/program/v1/v1.go:202\ngithub.com/shiguanghuxian/etcd-manage/program/v1.saveEtcdKey\n\t/home/raushank/go/src/github.com/shiguanghuxian/etcd-manage/program/v1/v1.go:236\ngithub.com/shiguanghuxian/etcd-manage/program/v1.postEtcdKey\n\t/home/raushank/go/src/github.com/shiguanghuxian/etcd-manage/program/v1/v1.go:154\ngithub.com/shiguanghuxian/etcd-manage/vendor/github.com/gin-gonic/gin.(*Context).Next\n\t/home/raushank/go/src/github.com/shiguanghuxian/etcd-manage/vendor/github.com/gin-gonic/gin/context.go:108\ngithub.com/shiguanghuxian/etcd-manage/program.(*Program).middlewareEtcd.func1\n\t/home/raushank/go/src/github.com/shiguanghuxian/etcd-manage/program/http.go:132\ngithub.com/shiguanghuxian/etcd-manage/vendor/github.com/gin-gonic/gin.(*Context).Next\n\t/home/raushank/go/src/github.com/shiguanghuxian/etcd-manage/vendor/github.com/gin-gonic/gin/context.go:108\ngithub.com/shiguanghuxian/etcd-manage/vendor/github.com/gin-gonic/gin.RecoveryWithWriter.func1\n\t/home/raushank/go/src/github.com/shiguanghuxian/etcd-manage/vendor/github.com/gin-gonic/gin/recovery.go:48\ngithub.com/shiguanghuxian/etcd-manage/vendor/github.com/gin-gonic/gin.(*Context).Next\n\t/home/raushank/go/src/github.com/shiguanghuxian/etcd-manage/vendor/github.com/gin-gonic/gin/context.go:108\ngithub.com/shiguanghuxian/etcd-manage/vendor/github.com/gin-gonic/gin.LoggerWithWriter.func1\n\t/home/raushank/go/src/github.com/shiguanghuxian/etcd-manage/vendor/github.com/gin-gonic/gin/logger.go:84\ngithub.com/shiguanghuxian/etcd-manage/vendor/github.com/gin-gonic/gin.(*Context).Next\n\t/home/raushank/go/src/github.com/shiguanghuxian/etcd-manage/vendor/github.com/gin-gonic/gin/context.go:108\ngithub.com/shiguanghuxian/etcd-manage/vendor/github.com/gin-gonic/gin.(*Engine).handleHTTPRequest\n\t/home/raushank/go/src/github.com/shiguanghuxian/etcd-manage/vendor/github.com/gin-gonic/gin/gin.go:363\ngithub.com/shiguanghuxian/etcd-manage/vendor/github.com/gin-gonic/gin.(*Engine).ServeHTTP\n\t/home/raushank/go/src/github.com/shiguanghuxian/etcd-manage/vendor/github.com/gin-gonic/gin/gin.go:328\nnet/http.serverHandler.ServeHTTP\n\t/usr/local/go/src/net/http/server.go:2774\nnet/http.(*conn).serve\n\t/usr/local/go/src/net/http/server.go:1878"}
{"level":"error","ts":1571601858.3689067,"caller":"v1/v1.go:202","msg":"Save key error","err":"context deadline exceeded","stacktrace":"github.com/shiguanghuxian/etcd-manage/program/v1.saveEtcdKey.func1\n\t/home/raushank/go/src/github.com/shiguanghuxian/etcd-manage/program/v1/v1.go:202\ngithub.com/shiguanghuxian/etcd-manage/program/v1.saveEtcdKey\n\t/home/raushank/go/src/github.com/shiguanghuxian/etcd-manage/program/v1/v1.go:236\ngithub.com/shiguanghuxian/etcd-manage/program/v1.postEtcdKey\n\t/home/raushank/go/src/github.com/shiguanghuxian/etcd-manage/program/v1/v1.go:154\ngithub.com/shiguanghuxian/etcd-manage/vendor/github.com/gin-gonic/gin.(*Context).Next\n\t/home/raushank/go/src/github.com/shiguanghuxian/etcd-manage/vendor/github.com/gin-gonic/gin/context.go:108\ngithub.com/shiguanghuxian/etcd-manage/program.(*Program).middlewareEtcd.func1\n\t/home/raushank/go/src/github.com/shiguanghuxian/etcd-manage/program/http.go:132\ngithub.com/shiguanghuxian/etcd-manage/vendor/github.com/gin-gonic/gin.(*Context).Next\n\t/home/raushank/go/src/github.com/shiguanghuxian/etcd-manage/vendor/github.com/gin-gonic/gin/context.go:108\ngithub.com/shiguanghuxian/etcd-manage/vendor/github.com/gin-gonic/gin.RecoveryWithWriter.func1\n\t/home/raushank/go/src/github.com/shiguanghuxian/etcd-manage/vendor/github.com/gin-gonic/gin/recovery.go:48\ngithub.com/shiguanghuxian/etcd-manage/vendor/github.com/gin-gonic/gin.(*Context).Next\n\t/home/raushank/go/src/github.com/shiguanghuxian/etcd-manage/vendor/github.com/gin-gonic/gin/context.go:108\ngithub.com/shiguanghuxian/etcd-manage/vendor/github.com/gin-gonic/gin.LoggerWithWriter.func1\n\t/home/raushank/go/src/github.com/shiguanghuxian/etcd-manage/vendor/github.com/gin-gonic/gin/logger.go:84\ngithub.com/shiguanghuxian/etcd-manage/vendor/github.com/gin-gonic/gin.(*Context).Next\n\t/home/raushank/go/src/github.com/shiguanghuxian/etcd-manage/vendor/github.com/gin-gonic/gin/context.go:108\ngithub.com/shiguanghuxian/etcd-manage/vendor/github.com/gin-gonic/gin.(*Engine).handleHTTPRequest\n\t/home/raushank/go/src/github.com/shiguanghuxian/etcd-manage/vendor/github.com/gin-gonic/gin/gin.go:363\ngithub.com/shiguanghuxian/etcd-manage/vendor/github.com/gin-gonic/gin.(*Engine).ServeHTTP\n\t/home/raushank/go/src/github.com/shiguanghuxian/etcd-manage/vendor/github.com/gin-gonic/gin/gin.go:328\nnet/http.serverHandler.ServeHTTP\n\t/usr/local/go/src/net/http/server.go:2774\nnet/http.(*conn).serve\n\t/usr/local/go/src/net/http/server.go:1878"}
建议添加一个go的编译动作
go build -o bin/etcd-manage main.go
demo版的ui是最新的吗?没有更新docker compose吗?
作者大佬辛苦了,我在本地用go 1.15.2 编译不通过。
命令行输出:
main.go:8:2: cannot find package "github.com/shiguanghuxian/etcd-manage/program" in any of:
/usr/local/go/src/github.com/shiguanghuxian/etcd-manage/program (from $GOROOT)
/home/kevin/go/src/github.com/shiguanghuxian/etcd-manage/program (from $GOPATH)
请问可以把代码切换到使用go mod 模式管理吗?非常感谢。
例如,put 一个key: /a/b/c/d,值 1,再put一个key : /a/b/c/e 值 2,在 /a/b/c这一层的时候,只能显示第一个 /a/b/c/d ,没有展示出 /a/b/c/e。切换到 json 视图下,能看到两个数据都在。
配置如下:
docker-compose.yaml
version: '3'
services:
etcd-manage:
# build: .
image: "shiguanghuxian/etcd-manage"
volumes:
- ./bin/config/cfg.toml:/app/config/cfg.toml
- ./bin/logs:/app/logs
ports:
- "10280:10280"
cfg.toml
# debug模式
debug = false
# 日志文件路径
log_path = ""
# http 监听端口
[http]
# 监听地址
address = "0.0.0.0"
# 监听端口
port = 10280
# 使用 Let's Encrypt 证书 - tls_enable为true优先使用本地证书模式
tls_encrypt_enable = false
# 域名列表
tls_encrypt_domain_names = ["shiguanghuxian.com"]
# 是否启用tls
tls_enable = false
# tls证书文件
[http.tls_config]
cert_file = "cert_file"
key_file = "key_file"
## 一下每一个server为一个etcd服务 ##
[[server]]
# 显示名称
title = "make docker_cluster_run"
# 标识名 - 只能是字母数字或下划线
name = "docker_cluster_run"
# etcd连接地址 如果为集群请填写全部地址
address = ["172.18.88.196:2379"]
# 查看的key前缀
key_prefix = "/"
# 简述信息
desc = "docker方式etcd集群方式"
# 可访问服务器角色列表 - 不写则为所有用户可访问
roles = []
# 是否启用tls连接
tls_enable = true
# tls证书配置
[server.tls_config]
cert_file = "/etc/ssl/etcd/ssl/node-a-docker-cluster04.pem"
key_file = "/etc/ssl/etcd/ssl/node-a-docker-cluster04-key.pem"
ca_file = "/etc/ssl/etcd/ssl/ca.pem"
[[server]]
title = "本地etcd"
name = "local"
address = ["127.0.0.1:2379"]
key_prefix = "/"
desc = "本机环境"
roles = ["admin","dev"]
## 以下为用户列表 ##
[[user]]
username = "admin"
password = "123456"
role = "admin"
[[user]]
username = "dev_user"
password = "123456"
role = "dev"
但是未能正常启动,日志如下
Recreating etcd-manage_etcd-manage_1 ... done
Attaching to etcd-manage_etcd-manage_1
etcd-manage_1 | 2019/11/06 09:57:13 main.go:18: line 57: field corresponding to `user' is not defined in config.Config
etcd-manage_etcd-manage_1 exited with code 1
docker 启动名命令如下
docker run -d --name etcdmanage -p 10280:10280 -v /etc/etcdmanage/cfg.toml:/app/config/cfg.toml -v /etc/kubernetes/pki/etcd/:/etc/etcd/etcdSSL/ -v /tmp/etcdmanagelog:/app/logs shiguanghuxian/etcd-manage
/etc/kubernetes/pki/etcd/ 目录是K8S 的etcd相关证书
启动后报错
[root@master1 ~]# docker logs d6bf58683228 2019/09/18 08:06:59 main.go:18: line 27: field corresponding to
server' is not defined in config.Config
`
cfg.toml 的配置内容为
# debug模式
debug = true
# 日志文件路径
log_path = ""
# http 监听端口
[http]
# 监听地址
address = "0.0.0.0"
# 监听端口
port = 10280
# 使用 Let's Encrypt 证书 - tls_enable为true优先使用本地证书模式
tls_encrypt_enable = false
# 域名列表
tls_encrypt_domain_names = ["192.168.10.50"]
# 是否启用tls
tls_enable = true
# tls证书文件
[http.tls_config]
cert_file = "/etc/etcd/etcdSSL/healthcheck-client.crt"
key_file = "/etc/etcd/etcdSSL/healthcheck-client.key"
## 以下每一个server为一个etcd服务 ##
[[server]]
title = "kuberentes etcd cluster"
name = "kuberentes_etcd_cluster"
address = ["192.168.10.51:2379","192.168.10.50:2379","192.168.10.52:2379"]
# 查看的key前缀
key_prefix = "/"
# 简述信息
desc = "docker cluster"
# 可访问服务器角色列表 - 不写则为所有用户可访问
# roles = ["admin"]
# 是否启用tls连接
tls_enable = true
# tls证书配置
[server.tls_config]
cert_file = "/etc/etcd/etcdSSL/server.crt"
key_file = "/etc/etcd/etcdSSL/server.key"
ca_file = "/etc/etcd/etcdSSL/ca.crt"
## 以下为用户列表 ##
#[[user]]
#username = "admin"
#password = "123456"
#role = "admin"
2.0.0的用户名密码如何配置
您好,我通过tpls/compile.sh打包静态文件,界面加载失败。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.