首页 > 其他分享 >etcd错误:Failed to defragment etcd member[127.0.0.1:2379] (context deadline exceeded)

etcd错误:Failed to defragment etcd member[127.0.0.1:2379] (context deadline exceeded)

时间:2024-06-12 18:43:22浏览次数:12  
标签:127.0 context -- client etcd 2379 timeout endpoints

etcd 版本

# etcdctl version
etcdctl version: 3.5.1
API version: 3.5

问题

在 执行 etcdctl --endpoints=http://127.0.0.1:2379 defrag命令时,可能遇到错误:

{"level":"warn","ts":"2024-06-12T18:20:17.444+0800","logger":"etcd-client","caller":"v3/retry_interceptor.go:62","msg":"retrying of unary invoker failed","target":"etcd-endpoints://0xc00037c540/127.0.0.1:2379","attempt":0,"error":"rpc error: code = DeadlineExceeded desc = context deadline exceeded"}
Failed to defragment etcd member[http://127.0.0.1:2379] (context deadline exceeded)

错误原因

etcdctl 的默认命令超时为 5 秒,但碎片整理花费的时间比这更长。

解决方案

指定超时时间 --command-timeout

etcdctl --endpoints=http://127.0.0.1:2379 --command-timeout=30s defrag

参数

GLOBAL OPTIONS:
      --cacert=""                               verify certificates of TLS-enabled secure servers using this CA bundle
      --cert=""                                 identify secure client using this TLS certificate file
      --command-timeout=5s                      timeout for short running command (excluding dial timeout)
      --debug[=false]                           enable client-side debug logging
      --dial-timeout=2s                         dial timeout for client connections
  -d, --discovery-srv=""                        domain name to query for SRV records describing cluster endpoints
      --discovery-srv-name=""                   service name to query when using DNS discovery
      --endpoints=[127.0.0.1:2379]              gRPC endpoints
      --hex[=false]                             print byte strings as hex encoded strings
      --insecure-discovery[=true]               accept insecure SRV records describing cluster endpoints
      --insecure-skip-tls-verify[=false]        skip server certificate verification (CAUTION: this option should be enabled only for testing purposes)
      --insecure-transport[=true]               disable transport security for client connections
      --keepalive-time=2s                       keepalive time for client connections
      --keepalive-timeout=6s                    keepalive timeout for client connections
      --key=""                                  identify secure client using this TLS key file
      --password=""                             password for authentication (if this option is used, --user option shouldn't include password)
      --user=""                                 username[:password] for authentication (prompt if password is not supplied)
  -w, --write-out="simple"                      set the output format (fields, json, protobuf, simple, table)

参考链接:https://github.com/etcd-io/etcd/issues/8260

清理集群 etcdctl defrag --cluster

标签:127.0,context,--,client,etcd,2379,timeout,endpoints
From: https://www.cnblogs.com/alioth01/p/18244515

相关文章

  • Android attachBaseContext作用
    在Android应用程序中,attachBaseContext()方法是一个回调方法,它在onCreate()方法之前被调用,其作用是向应用程序的Context对象中添加或修改一些信息。通常,开发人员会在这个方法中执行一些初始化操作,如创建全局对象、设置默认语言等。具体来说,attachBaseContext()方法的主要......
  • FFmpeg结构体:AVIOContext
    1.描述AVIOContext是FFmpeg管理输入输出数据的结构体,位于avio.h文件中。2.结构体定义1typedefstructAVIOContext{2/**3*Aclassforprivateoptions.4*5*IfthisAVIOContextiscreatedbyavio_open2(),av_classissetand......
  • etcd watch 实现原理
    介绍在etcd中,watch是一个非常重要的特性,它可以让客户端监控etcd中的key或者一组key,当key发生变化时,etcd会通知客户端。本文将介绍etcdwatch的实现原理。etcdctlwatch/test#当/test的值发生变化时,会输出如下信息PUT/testaPUT/testbDELETE/testwatc......
  • ApplicationContextAware获取IOC容器
    目录常见Aware实现ApplicationContextAware作用1、ApplicationContext是什么?2、ApplicationContextAware作用ApplicationContextAware使用常见Aware实现接口作用ApplicationContextAware获取当前应用的上下文对象EnvironmentAware获取环境变量,包括我们配置的以及......
  • pageContext.request.contextpath、getServletContext.getRealPath(““)、request.ge
    在JavaEE(JavaEnterpriseEdition)中开发Web应用时,开发者常常需要获取Web应用的上下文路径和服务器上文件的真实路径。以下是对pageContext.request.contextPath、getServletContext().getRealPath("")和request.getContextPath()的详细解释及它们之间的区别:1.pageContext......
  • WPF DataContext order and filter via CollectionViewSource.GetDefaultView(DataCon
    //xaml<Windowx:Class="WpfApp146.MainWindow"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"xmlns:d="http://schemas.mi......
  • 1_关于BeanFactory与ApplicationContext的联系和区别
    BeanFactory与ApplicationContext1.容器和接口1.1BeanFactory与ApplicationContext的联系与区别:ConfigurableApplicationContext是ApplicationContext的子接口,而ApplicationContext接口又是BeanFactory的子接口。因此ConfigurableApplicationContext接口简介继承了Bean......
  • MainWindows移动View文件夹和使用Window.DataContext单例绑定需要修改的地方
    项目结构移动文件夹后需要修改的三个地方1、App.xaml2、MainWindow.xaml3、MainWindow.xaml.cs单例绑定需要修改的地方MainWindow.xaml ......
  • Java动态获取实现类 Class.forName(clazz).newInstance()和applicationContext.getBea
    Java动态获取实现类Class.forName(clazz).newInstance()和applicationContext.getBean,beanMap寻找方式,JavaMap定义和初始化方法1.定义枚举类MyServiceTypeEnum.javapackagecom.example.core.mydemo.bean;publicenumMyServiceTypeEnum{SUBMIT_ORDER_SUCCESS("s......
  • SpringBoot启动流程分析之准备应用上下文refreshContext()(八)
    SpringBoot启动流程分析之准备应用上下文refreshContext()(八)文章目录SpringBoot启动流程分析之准备应用上下文refreshContext()(八)1、准备刷新1.1、子类prepareRefresh()方法1.2父类prepareRefresh()方法2、通知子类刷新内部bean工厂3、准备bean工厂4、允许上下文子类对b......