logstash-output-jdbc遇到connection is not available,request time out after 10000ms的问题解决
上一篇logstash-output-jdbc使用中提到“运行bin/logstash -f test.conf时可能提示注册插件失败”,通过分析详细的错误日志,发现其赫然写着“connection is not available,request time out after 10000ms”,原来是mysql连接的问题,插件注册失败只是表象。
由于没有在logstash所在的机器A安装mysql,而是通过mysql connector 的jar包(logstash conf文件里指定了jar报路径),所以没有办法测试A到数据库机器B的连接是否成功,尝试过增加mysql connection_timeout的时间到300s,发现错误还是request time out after 10000ms,说明jar里有自己的时间设置。
百度良久,最后在mysql的my.ini文件(默认C:\PragramData\MySQL\MySQLServer 5.7目录下)中增加skip-name-resolve,重启mysql服务后,问题解决。原因是
MySQL处理用户连接时进行如下过程来验证用户的合法性(参考http://www.cnblogs.com/timeship/archive/2013/02/28/2937730.html):
When a new client connects to mysqld, mysqld spawns a new thread to handle the request. This thread first checks whether the host name is in the host name cache. If not, the thread attempts to resolve the host name:
The thread takes the IP address and resolves it to a host name (using gethostbyaddr()). It then takes that host name and resolves it back to the IP address (using gethostbyname()) and compares to ensure it is the original IP address.
logstash-output-jdbc遇到connection is not available,request time out after 10000ms的问题解决的更多相关文章
- Filebeat之input和output(包含Elasticsearch Output 、Logstash Output、 Redis Output、 File Output和 Console Output)
前提博客 https://i.cnblogs.com/posts?categoryid=972313 Filebeat啊,根据input来监控数据,根据output来使用数据!!! Filebeat的 ...
- 使用 Logstash 和 JDBC 确保 Elasticsearch 与关系型数据库保持同步
为了充分利用 Elasticsearch 提供的强大搜索功能,很多公司都会在既有关系型数据库的基础上再部署Elasticsearch.在这种情况下,很可能需要确保 Elasticsearch 与所关联 ...
- JDBC driver connection string大全
Database / data source URL format / driver name Value Default port MySQL URL format: jdbc:mysql: ...
- Logstash使用jdbc同步MySQL中的数据
[--26T20::,][WARN ][logstash.inputs.jdbc ] Exception when executing JDBC query {:exception=>#< ...
- atitit.故障排除------有时会错误com.microsoft.sqlserver.jdbc.SQLServerException: Connection reset by peer: soc
atitit.故障排除------有时会错误com.microsoft.sqlserver.jdbc.SQLServerException: Connection reset by peer: soc ...
- SQLTransientConnectionException: HikariPool-1 - Connection is not available, request timed out after 30001ms.
SQLTransientConnectionException: HikariPool-1 - Connection is not available, request timed out after ...
- tomcat one connection one thread one request one thread
java - What is the difference between thread per connection vs thread per request? - Stack Overflow ...
- logstash output到kafka记录与总结( No entry found for connection 2)
简述 本文记录logstash的output配置为kafka的过程.这里是简单的例子,输入为stdin,本文主要目的是为了记录在这次配置过程中遇到的问题和解决的过程及总结. 关于kafka集群的搭建可 ...
- logstash input jdbc连接数据库
示例 以下配置能够实现从 SQL Server 数据库中查询数据,并增量式的把数据库记录导入到 ES 中. 1. 查询的 SQL 语句在 statement_filepath => " ...
随机推荐
- 20191210-RobotFramework常见问题解决
附加-问题解决 1. 执行robot用例的时候提示WebDriverException: Message: invalid argument: can't kill an exited proce ...
- PAT(B) 1060 爱丁顿数(Java:21分)
题目链接:1060 爱丁顿数 (25 point(s)) 题目描述 英国天文学家爱丁顿很喜欢骑车.据说他为了炫耀自己的骑车功力,还定义了一个"爱丁顿数" E ,即满足有 E 天骑车 ...
- Mac上go的下载安装教程
mac上go的下载安装教程 官网https://golang.google.cn/dl/下载,安装 环境变量配置 参考https://www.jianshu.com/p/5c1873eaf3ca Ba ...
- SQL 向表中添加字段
如果要在数据表中添加一个字段,应该如何表示呢?下面就为您介绍表添加字段的SQL语句的写法,希望可以让您对SQL语句有更深的认识. 通用式: alter table [表名] add [字段名] 字段属 ...
- openstack-nova源码之阅读流程
以创建虚拟机为例 1.项目入口setup.cfg文件 2.根据nova-compute = nova.cmd.compute:main找到功能入口 3.nova/api/openstack/compu ...
- Nginx限制访问速率和最大并发连接数模块--limit (防范DDOS攻击)
Tengine版本采用http_limit_req_module进行限制 具体连接请参考 http://tengine.taobao.org/document_cn/http_limit_req_cn ...
- Codeforces Round #568 Div. 2
没有找到这场div3被改成div2的理由. A:签到. #include<bits/stdc++.h> using namespace std; #define ll long long ...
- ADO.NET 一(概述)
在 C# 语言中 ADO.NET 是在 ADO 的基础上发展起来的,ADO (Active Data Object) 是一个 COM 组件类库,用于访问数据库,而 ADO.NET 是在 .NET 平台 ...
- python PIL图像处理库
1. Introduction PIL(Python Image Library)是python的第三方图像处理库,但是由于其强大的功能与众多的使用人数,几乎已经被认为是python官方图像处理库了. ...
- PHP 常用数据库操作
1.建立与数据库服务器的连接(前提数据库服务器必须打开) 第一个参数:本地地址 第二个参数:数据库账户 第三个参数:数据库密码 第四个参数:数据库名称 $connection = mysqli_con ...