搭建日志收集系统时使用客户端连接etcd遇到的问题
问题: 在做日志收集系统时使用到etcd,其中server端在linux上,首先安装第三方包(windows)(安装过程可能会有问题,我遇到的是连接谷歌官网请求超时,如果已经出现下面的两个文件夹并且文件夹中都有内容则可以不理会错误):
go get -u -v github.com/coreos/etcd/clientv3
完成之后,在开发环境中会增加两个文件夹:
. src\go.etcd.io
. src\github.com\coreos
客户端测试程序(go语言,命名为main.go,注意etcd server端的ip地址换成你自己的):
package main import (
"fmt"
etcd_client "github.com/coreos/etcd/clientv3"
//etcd_client "go.etcd.io/etcd/clientv3"
"time"
) func main() { cli, err := etcd_client.New(etcd_client.Config{
Endpoints: []string{"192.168.30.136:2379", "192.168.30.136:22379", "192.168.30.136:32379"},
DialTimeout: * time.Second,
})
if err != nil {
fmt.Println("connect failed, err:", err)
return
} fmt.Println("connect succ")
defer cli.Close()
}
测试程序
在该文件夹下执行,报错如下:
go run main.go
F:\Go\project\src\go_dev_yuanma\go_dev\day12\etcd_conn>go run main.go
# github.com/coreos/etcd/clientv3
..\..\..\..\github.com\coreos\etcd\clientv3\auth.go::: cannot use auth.call Opts (type []"github.com/coreos/etcd/vendor/google.golang.org/grpc".CallOption)
as type []"go.etcd.io/etcd/vendor/google.golang.org/grpc".CallOption in argument to auth.remote.AuthEnable
..\..\..\..\github.com\coreos\etcd\clientv3\auth.go::: cannot use auth.call Opts (type []"github.com/coreos/etcd/vendor/google.golang.org/grpc".CallOption)
as type []"go.etcd.io/etcd/vendor/google.golang.org/grpc".CallOption in argument to auth.remote.AuthDisable
..\..\..\..\github.com\coreos\etcd\clientv3\auth.go::: cannot use auth.cal lOpts (type []"github.com/coreos/etcd/vendor/google.golang.org/grpc".CallOption)
as type []"go.etcd.io/etcd/vendor/google.golang.org/grpc".CallOption in argument to auth.remote.UserAdd
..\..\..\..\github.com\coreos\etcd\clientv3\auth.go::: cannot use auth.call Opts (type []"github.com/coreos/etcd/vendor/google.golang.org/grpc".CallOption)
as type []"go.etcd.io/etcd/vendor/google.golang.org/grpc".CallOption in argument to auth.remote.UserDelete
..\..\..\..\github.com\coreos\etcd\clientv3\auth.go::: cannot use auth.cal
lOpts (type []"github.com/coreos/etcd/vendor/google.golang.org/grpc".CallOption) as type []"go.etcd.io/etcd/vendor/google.golang.org/grpc".CallOption in argumen
t to auth.remote.UserChangePassword
..\..\..\..\github.com\coreos\etcd\clientv3\auth.go::: cannot use auth.cal lOpts (type []"github.com/coreos/etcd/vendor/google.golang.org/grpc".CallOption)
as type []"go.etcd.io/etcd/vendor/google.golang.org/grpc".CallOption in argumen
t to auth.remote.UserGrantRole
..\..\..\..\github.com\coreos\etcd\clientv3\auth.go::: cannot use auth.call Opts (type []"github.com/coreos/etcd/vendor/google.golang.org/grpc".CallOption)
as type []"go.etcd.io/etcd/vendor/google.golang.org/grpc".CallOption in argument
to auth.remote.UserGet
..\..\..\..\github.com\coreos\etcd\clientv3\auth.go::: cannot use auth.call Opts (type []"github.com/coreos/etcd/vendor/google.golang.org/grpc".CallOption)
as type []"go.etcd.io/etcd/vendor/google.golang.org/grpc".CallOption in argument
to auth.remote.UserList
..\..\..\..\github.com\coreos\etcd\clientv3\auth.go::: cannot use auth.cal lOpts (type []"github.com/coreos/etcd/vendor/google.golang.org/grpc".CallOption)
as type []"go.etcd.io/etcd/vendor/google.golang.org/grpc".CallOption in argumen
t to auth.remote.UserRevokeRole
..\..\..\..\github.com\coreos\etcd\clientv3\auth.go::: cannot use auth.call Opts (type []"github.com/coreos/etcd/vendor/google.golang.org/grpc".CallOption)
as type []"go.etcd.io/etcd/vendor/google.golang.org/grpc".CallOption in argument
to auth.remote.RoleAdd
..\..\..\..\github.com\coreos\etcd\clientv3\auth.go::: too many errors
这样的错误原因可以参考:
https://blog.csdn.net/zhangyexinaisurui/article/details/87001028
解决的办法:
1. 在 import 的时候,不要引用 "github.com/coreos/etcd/clientv3",而是 "go.etcd.io/etcd/clientv3",原因已在上面的链接有所说明:
//"github.com/coreos/etcd/clientv3"
"go.etcd.io/etcd/clientv3"
然后使用上面的测试程序测试,如果还有问题,再使用下面的 2 方法试下。
2. 可以到 github.com/coreos/etcd 地址下载所有的包,然后解压缩到 src\github.com\coreos 路径下,如果没有该目录则创建,并将解压后的文件夹命名为 etcd(原来为etcd-master),再将前面改名后的 etcd文件夹拷贝到 src\go.etcd.io 目录下,再使用测试程序测试下(测试前记着启动etcd的server端,同时测试程序 import "go.etcd.io/etcd/clientv3")。
参考文献:
- https://blog.csdn.net/zhangyexinaisurui/article/details/87001028
搭建日志收集系统时使用客户端连接etcd遇到的问题的更多相关文章
- Kafka+Zookeeper+Filebeat+ELK 搭建日志收集系统
ELK ELK目前主流的一种日志系统,过多的就不多介绍了 Filebeat收集日志,将收集的日志输出到kafka,避免网络问题丢失信息 kafka接收到日志消息后直接消费到Logstash Logst ...
- docker搭建日志收集系统EFK
EFK Elasticsearch是一个数据搜索引擎和分布式NoSQL数据库的组合,提过日志的存储和搜索功能. Fluentd是一个消息采集,转化,转发工具,目的是提供中心化的日志服务. Kibana ...
- 快速搭建应用服务日志收集系统(Filebeat + ElasticSearch + kibana)
快速搭建应用服务日志收集系统(Filebeat + ElasticSearch + kibana) 概要说明 需求场景,系统环境是CentOS,多个应用部署在多台服务器上,平时查看应用日志及排查问题十 ...
- 日志收集系统搭建-BELK
前言 日志是我们分析系统运行情况.问题定位.优化分析等主要数据源头.目前,主流的业务系统都采用了分布式.微服务的形式.如果想要查看日志,就需要从不同的节点上去查看,而且对于整个业务链路也非常不清晰.因 ...
- 用ElasticSearch,LogStash,Kibana搭建实时日志收集系统
用ElasticSearch,LogStash,Kibana搭建实时日志收集系统 介绍 这套系统,logstash负责收集处理日志文件内容存储到elasticsearch搜索引擎数据库中.kibana ...
- 日志收集系统ELK搭建
一.ELK简介 在传统项目中,如果在生产环境中,有多台不同的服务器集群,如果生产环境需要通过日志定位项目的Bug的话,需要在每台节点上使用传统的命令方式查询,这样效率非常低下.因此我们需要集中化的管理 ...
- [转载] 一共81个,开源大数据处理工具汇总(下),包括日志收集系统/集群管理/RPC等
原文: http://www.36dsj.com/archives/25042 接上一部分:一共81个,开源大数据处理工具汇总(上),第二部分主要收集整理的内容主要有日志收集系统.消息系统.分布式服务 ...
- Go实现海量日志收集系统(一)
项目背景 每个系统都有日志,当系统出现问题时,需要通过日志解决问题 当系统机器比较少时,登陆到服务器上查看即可满足 当系统机器规模巨大,登陆到机器上查看几乎不现实 当然即使是机器规模不大,一个系统通常 ...
- 一共81个,开源大数据处理工具汇总(下),包括日志收集系统/集群管理/RPC等
作者:大数据女神-诺蓝(微信公号:dashujunvshen).本文是36大数据专稿,转载必须标明来源36大数据. 接上一部分:一共81个,开源大数据处理工具汇总(上),第二部分主要收集整理的内容主要 ...
随机推荐
- 使用JavaScript实现单向链表
一.实现功能 1.链表元素头部插入 this.unShift = function(data) {} 2.链表元素尾部插入 this.append= function(data) {} //返回boo ...
- Unity 利用UGUI打包图集,动态加载sprite资源
今天做了一个UI界面,这个界面是好友界面,该界面上有若干个好友item. 需要对每个tem的头像对象(image)动态显示对应的头像.尝试利用UGUI的图集来加载,具体实现如下: 1.首先,需要知道S ...
- 软件测试之Soot
详情请见:https://github.com/fogmisty/SoftwareTest
- python模块与路径
# 切记不能与方法函数同名,否则会报错!!! # python的模块与包 分为三种: #1.标准库 #2.第三方模块 #3.自定义模块 #python 模块的引入原理: # 加入你创建了一个模块,在i ...
- CentOS 7 安装samba服务
STEP 1. 安装 #安装 [root@study ~]yum install smaba [root@study ~]systemctl start smb nmb STEP 2. 建立共享目录以 ...
- WC.exe【C】
gitee传送门!!!(电脑打不开github,多次尝试未果,决定先用gitee存着先) 项目要求 wc.exe 是一个常见的工具,它能统计文本文件的字符数.单词数和行数.这个项目要求写一个命令行程序 ...
- Java基础语法-Unicode、UTF-8、UTF-16
1.Unicode(统一码.万国码),从名字里可以看出,unicode码表囊括世界上各国语言文字. unidode中包含17个代码级别,第一个代码级别又称作基本的多语言级别(码点从U+0000到U+F ...
- python python中那些双下划线开头的那些函数都是干啥用用的
1.写在前面 今天遇到了__slots__,,所以我就想了解下python中那些双下划线开头的那些函数都是干啥用用的,翻到了下面这篇博客,看着很全面,我只了解其中的一部分,还不敢乱下定义. 其实如果足 ...
- 选择排序java实现
package text.algorithm; /** * 选择排序 * O(n^2);空间复杂度O(1); */public class SelectionSort { public static ...
- Arrays工具类
1.Arrays工具类针对数组进行操作的工具类 提供了排序查找等功能 2.方法: Arrays.toString(int[] a) 将数据转换成字符串 Arrays.sort(int[] a) 将数组 ...