Code Monkey home page Code Monkey logo

etcd-manage's Introduction

etcd-manage's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

etcd-manage's Issues

无法使用

我试过网上很多可视化,(etcd-viewer, etcd-manager, 还有你的etcd-manage), 我很难过, 没有任何一个是能正常使用的, 比如etcd-viewer报错连接重设, etcd-manager报错Cannot read property 'getAll' of null.

你的v2报错没有 server 这种配置
你的v1能运行起来, 但是打开会报错 Etcd client is empty
我不知道我做错了什么上天要如此惩罚我
能不能告诉我v2应该怎么配置

2.0.0版本报错

main.go:18: line 27: field corresponding to `server' is not defined in config.Config

是关于启用etcd的Basic Auth的问题

我们的项目部署在集群中,我们想对一些操作进行限制,所以使用了Basic Auth,我在etcd集群中创建了root权限和root用户,同时我在etcd-manage的配置文件中对应的写好账号和密码,但是会报一些错误,你能来帮我看一下吗?感激不尽
image
具体报错信息:
image
@shiguanghuxian

tls

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:

  • Connected to {{FQDN}} (x.x.x.x) port 2379 (#0)

POST / HTTP/1.1
User-Agent: curl/7.29.0
Host: {{FQDN}}:2379
Accept: /

  • Connection #0 to host {{FQDN}} left intact

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?

Change frontend baseURL

HI,

Is there any good way to change frontend baseURL (for axios), which now defaults to 127.0.0.1:10280?

Eng version

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`

非常好用,两个建议,一个BUG

  1. 希望对value进行一些格式的format,如json
  2. 对keys的展示方式希望添加一种树结构

均可参考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"

member的Status显示unhealthy

image

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"

点击了repair directory也不行
image

English Docs / README

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做配置中心的事情,想做成目录树管理的方式。结果赫然发现你的这个项目。
不过作为配置中心,还需要加入:权限管理、配置校验、灰度发布、发布审核等功能,可以一起开发么?

Etcd client is empty及context deadline exceeded问题解决方法

使用环境:
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啊

公司用的是v2,没用v3,manage看着确实好啊,可能。。。没v2的,不知道有没有v2转v3的功能,很想用这个etcd-manage

etcd_manage启动起来无法加载出数据

我的cfg.toml中指定了我服务器上的etcd单机示实例的etcd前缀是
key_prefix = "/"
,但是etcd_manage启动起来之后页面没显示出/下面的key value数据,所有接口返回400;
我通过etcdctl或者golang程序是可以获取返回值的
X0@5IEO2B%}7`VW}SCQ5}Y6

Context deadline exceeded when using with remote etcd which has cert based auth

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 1.15.2 编译不通过

作者大佬辛苦了,我在本地用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 模式管理吗?非常感谢。

未能正常启动`user' is not defined in config.Config

配置如下:
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 内的 etcd-manage

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 toserver' 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"

某配置项不能使用中文

image

前端页面对etcd的增删改查操作的点击无响应,控制台发现不发送http请求,改成全英文恢复正常

猜测是解析配置到生成etcd客户端的问题,但不清楚为什么会影响前端

自定义UI

您好,我通过tpls/compile.sh打包静态文件,界面加载失败。

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.