Put queue for MemoryTransaction of capacity 10000 full, consider committing more frequently, increasing capacity or increasing thread count flume capacity 时间数
package com.test; import org.apache.http.*;
import org.apache.http.entity.ContentType;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.DefaultBHttpClientConnection;
import org.apache.http.impl.DefaultConnectionReuseStrategy;
import org.apache.http.message.BasicHttpEntityEnclosingRequest;
import org.apache.http.protocol.*; import java.net.Socket;
import java.util.UUID; public class ElementalHttpPost {
public static void main(String[] args) throws Exception {
String strBatch = "[";
String s = "http://hc.apache.org/httpcomponents-core-ga/httpcore/examples/org/apache/http/examples/ElementalHttpPost.javahttp://hc.apache.org/httpcomponents-core-ga/httpcore/examples/org/apache/http/examples/ElementalHttpPost.javahttp://hc.apache.org/httpcomponents-core-ga/httpcore/examples/org/apache/http/examples/ElementalHttpPost.javahttp://hc.apache.org/httpcomponents-core-ga/httpcore/examples/org/apache/http/examples/ElementalHttpPost.javahttp://hc.apache.org/httpcomponents-core-ga/httpcore/examples/org/apache/http/examples/ElementalHttpPost.javahttp://hc.apache.org/httpcomponents-core-ga/httpcore/examples/org/apache/http/examples/ElementalHttpPost.javahttp://hc.apache.org/httpcomponents-core-ga/httpcore/examples/org/apache/http/examples/ElementalHttpPost.javahttp://hc.apache.org/httpcomponents-core-ga/httpcore/examples/org/apache/http/examples/ElementalHttpPost.javahttp://hc.apache.org/httpcomponents-core-ga/httpcore/examples/org/apache/http/examples/ElementalHttpPost.javahttp://hc.apache.org/httpcomponents-core-ga/httpcore/examples/org/apache/http/examples/ElementalHttpPost.javahttp://hc.apache.org/httpcomponents-core-ga/httpcore/examples/org/apache/http/examples/ElementalHttpPost.java";
try {
for (int i = 0; i < 30000; i++) {
System.out.println(i); strBatch += ",{\"headers\":{\"timestamp\":\"434324343\",\"host\":\"random_host.example.com\"},\"body\":\"abc" + i + "---" + System.currentTimeMillis() + "-" + UUID.randomUUID() + "---" + s + "\"}";
}
strBatch += "]";
strBatch = strBatch.replace("[,", "[");
System.out.println(strBatch);
HttpEntity httpEntity = new StringEntity(strBatch, ContentType.create("application/json", Consts.UTF_8));
m(httpEntity);
Thread.sleep(1000);
System.out.println(Thread.currentThread());
} finally {
}
} static void m(HttpEntity httpEntity) throws Exception {
HttpProcessor processor = HttpProcessorBuilder.create()
.add(new RequestContent())
.add(new RequestTargetHost())
.add(new ResponseConnControl())
.add(new RequestUserAgent("Test/1.1"))
.add(new RequestExpectContinue(true))
.build();
HttpRequestExecutor requestExecutor = new HttpRequestExecutor();
HttpCoreContext coreContext = HttpCoreContext.create();
HttpHost host = new HttpHost("101.201.41.72", 50000);
coreContext.setTargetHost(host); DefaultBHttpClientConnection conn = new DefaultBHttpClientConnection(8 * 10254 * 1024);
ConnectionReuseStrategy reuseStrategy = DefaultConnectionReuseStrategy.INSTANCE;
Socket socket = new Socket(host.getHostName(), host.getPort());
conn.bind(socket);
try {
BasicHttpEntityEnclosingRequest request = new BasicHttpEntityEnclosingRequest("POST", "/");
request.setEntity(httpEntity);
requestExecutor.preProcess(request, processor, coreContext);
HttpResponse response = requestExecutor.execute(request, conn, coreContext);
requestExecutor.postProcess(response, processor, coreContext);
if (!reuseStrategy.keepAlive(response, coreContext)) {
conn.close();
} else {
System.out.println("Connection kept alive...");
}
} finally {
conn.close();
}
}
}
[root@d log]# ps -aux | grep java
root 550 0.2 1.9 6000924 641384 pts/1 Sl+ 17:39 0:13 /usr/java/jdk1.8.0_101/bin/java -Xmx20m -Dflume.root.logger=INFO,console -Xms2048m -Xmx2048m -cp /data/UnifiedLog/flume/conf:/data/UnifiedLog/flume/lib/*:/lib/* -Djava.library.path= org.apache.flume.node.Application -f /data/UnifiedLog/flume/conf/httpSourceApp.conf -n a1
root 11382 0.0 0.0 112712 964 pts/9 S+ 19:07 0:00 grep --color=auto java
elsearch 22711 19.3 36.3 140956640 11930396 ? S<l Sep18 16185:36 /usr/java/jdk1.8.0_101/bin/java -Xms10g -Xmx10g -Djava.awt.headless=true -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+HeapDumpOnOutOfMemoryError -XX:+DisableExplicitGC -Dfile.encoding=UTF-8 -Djna.nosys=true -Des.path.home=/usr/local/elasticsearch-2.4.1 -cp /usr/local/elasticsearch-2.4.1/lib/elasticsearch-2.4.1.jar:/usr/local/elasticsearch-2.4.1/lib/* org.elasticsearch.bootstrap.Elasticsearch start -d
root 24280 0.0 0.0 122092 1288 ? Sl Sep18 45:21 /usr/local/cloudmonitor/wrapper/bin/./wrapper /usr/local/cloudmonitor/wrapper/bin/../conf/wrapper.conf wrapper.syslog.ident=cloudmonitor wrapper.pidfile=/usr/local/cloudmonitor/wrapper/bin/./cloudmonitor.pid wrapper.daemonize=TRUE wrapper.name=cloudmonitor wrapper.displayname=cloudmonitor wrapper.statusfile=/usr/local/cloudmonitor/wrapper/bin/./cloudmonitor.status wrapper.java.statusfile=/usr/local/cloudmonitor/wrapper/bin/./cloudmonitor.java.status wrapper.lockfile=/var/lock/subsys/cloudmonitor wrapper.script.version=3.5.27
root 24282 0.5 0.2 2516408 67812 ? Sl Sep18 487:36 /usr/local/cloudmonitor/jre/bin/java -Djava.compiler=none -XX:-UseGCOverheadLimit -XX:NewRatio=1 -XX:SurvivorRatio=8 -XX:+UseSerialGC -Djava.io.tmpdir=../../tmp -Xms16m -Xmx32m -Djava.library.path=../lib:../../lib -classpath ../lib/wrappertest.jar:../lib/wrapper.jar:../../config:../../lib/agent-commons-1.2.11.jar:../../lib/agent-core-1.2.11.jar:../../lib/agent-model-1.2.11.jar:../../lib/aopalliance-1.0.jar:../../lib/commons-logging-1.2.jar:../../lib/commons-net-3.5.jar:../../lib/gson-2.4.jar:../../lib/jvm-plugin-1.2.11.jar:../../lib/log4j-1.2.16.jar:../../lib/metrics-core-3.0.2.jar:../../lib/sigar-1.6.5.132.jar:../../lib/slf4j-api-1.7.5.jar:../../lib/spring-aop-4.2.4.RELEASE.jar:../../lib/spring-beans-4.2.4.RELEASE.jar:../../lib/spring-context-4.2.4.RELEASE.jar:../../lib/spring-core-4.2.4.RELEASE.jar:../../lib/spring-expression-4.2.4.RELEASE.jar:../../lib/system-plugin-1.2.11.jar:../../lib/updater-1.2.11-jar-with-dependencies.jar -Dwrapper.key=vaz0l5Js_x6xfRzG -Dwrapper.port=32000 -Dwrapper.jvm.port.min=31000 -Dwrapper.jvm.port.max=31999 -Dwrapper.disable_console_input=TRUE -Dwrapper.pid=24280 -Dwrapper.version=3.5.27 -Dwrapper.native_library=wrapper -Dwrapper.arch=x86 -Dwrapper.service=TRUE -Dwrapper.cpu.timeout=10 -Dwrapper.jvmid=1 com.aliyun.tianji.cloudmonitor.Application
[root@d log]# cat /data/UnifiedLog/flume/conf/httpSourceApp.conf
a1.sources=r1
a1.sinks=k1
a1.channels=c1
a1.sources.r1.type=http
a1.sources.r1.bind=0.0.0.0
a1.sources.r1.port=50000
a1.sources.r1.channels=c1
a1.sinks.k1.channel=c1
#a1.sinks.k1.type = com.product.FlumeApp
a1.sinks.k1.type = file_roll
a1.sinks.k1.sink.directory = /data/UnifiedLog/log
a1.sinks.k1.batchSize=100
#a1.sinks.k1.pathManager=%y%m%d%H%M%S
a1.sinks.k1.pathManager=DEFAULT
a1.sinks.k1.pathManager.extension=log
a1.sinks.k1.pathManager.prefix=webTrack
a1.sinks.k1.rollInterval=30
#sink.rollInterval 30 Roll the file every 30 seconds. Specifying 0 will disable rolling and cause all events to be written to a single file.
a1.sinks.k1.sink.serializer = text
#capacity 100 The maximum number of events stored in the channel
#transactionCapacity 100 The maximum number of events the channel will take from a source or give to a sink per transaction
a1.channels.c1.type=memory
#a1.channels.c1.capacity=1000
#a1.channels.c1.transactionCapacity=100
a1.channels.c1.capacity=10000
a1.channels.c1.transactionCapacity=10000
[root@d log]#
Put queue for MemoryTransaction of capacity 10000 full, consider committing more frequently, increasing capacity or increasing thread count flume capacity 时间数的更多相关文章
- org.apache.flume.ChannelException: Take list for MemoryTransaction, capacity 100 full, consider committing more frequently, increasing capacity, or increasing thread count
flume在抽取MySQL数据到kafka时报错,如下 [SinkRunner-PollingRunner-DefaultSinkProcessor] ERROR org.apache.flume.s ...
- 一个Flume 异常(Put queue for MemoryTransaction of capacity 100 full)的排查和解决思路
最近在做一个分布式调用链跟踪系统, 在两个地方采用了flume (我使用的flume版本是1.5.0-cdh5.4.4),一个是宿主系统 ,用flume agent进行日志搜集. 一个是从kafka拉 ...
- List的Capacity
Capacity 在.NET中List的容量应该只是受到硬件限制. 属性Capacity的真正含义,是创建List时给它预分配的容量. 一旦项的数量超过了当前的Capacity,Capacity会以 ...
- flume的memeryChannel中transactionCapacity和sink的batchsize需要注意事项
一. fluem中出现,transactionCapacity查询一下,得出一下这些: 最近在做flume的实时日志收集,用flume默认的配置后,发现不是完全实时的,于是看了一下,原来是memery ...
- 关于flume配置加载(二)
为什么翻flume的代码,一方面是确实遇到了问题,另一方面是想翻一下flume的源码,看看有什么收获,现在收获还谈不上,因为要继续总结.不够已经够解决问题了,而且确实有好的代码,后续会继续慢慢分享,这 ...
- 将线上服务器生成的日志信息实时导入kafka,采用agent和collector分层传输,app的数据通过thrift传给agent,agent通过avro sink将数据发给collector,collector将数据汇集后,发送给kafka
记flume部署过程中遇到的问题以及解决方法(持续更新) - CSDN博客 https://blog.csdn.net/lijinqi1987/article/details/77449889 现将调 ...
- flume坑之channel.transactionCapacity和HdfsSink.batchSize
不说过程了,直接说结果!一对相连接的channel-HdfsSink,无意间配置如下:...agent.channels.common-channel.transactionCapacity=10.. ...
- Flume整合Spark Streaming
Spark版本1.5.2,Flume版本:1.6 Flume agent配置文件:spool-8.51.conf agent.sources = source1 agent.channels = me ...
- Flume使用说明
关于Flume,官方定义如下: Apache Flume is a distributed, reliable, and available system for efficiently collec ...
随机推荐
- CShopDialog类
#ifndef SHOP_H #define SHOP_H #include "XWidget.h" #include "GameConfig.h" class ...
- oracle 使用occi方式插入数据时中文乱码
这个是由于数据库的编码格式和我们输入的编码格式不一致导致的. 我们使用c++插入数据时数据库的中文显示??(即乱码),但同样的数据使用navicat进行插入却显示正常. 因此,问题并不是处在服务器端的 ...
- spring boot热部署pom.xml配置
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/20 ...
- lua工具库penlight--08额外的库(一)
额外的库 在这一节中的库不再被认为是Penlight的核心部分,但在需要时,仍提供专门的功能. 简单的输入的模式 Lua 的字符串模式匹配是非常强大,通常您将不需要传统的正则表达式库.即便如此,有时 ...
- 如何使用PHP开发高效的WEB系统
PHP是一个非常优秀的工具,它能够简单,也能够复杂.不一样的项目,应该用不一样的PHP. 小项目 - 简单而直接的PHP 一般对于一个功能页面在20下面的站点.我们能够用一个非常easy的框架结构来 ...
- javascript 屏蔽F5,BackSpace等各种按键
function DisableF5(){ with (event){ // F5 and Ctrl+R if (keyCode==116 || (ctrlKey && keyCode ...
- .NET Entity Framework(EF)使用SqlQuery直接操作SQL查询语句或者执行过程
Entity Framework是微软出品的高级ORM框架,大多数.NET开发者对这个ORM框架应该不会陌生.本文主要罗列在.NET(ASP.NET/WINFORM)应用程序开发中使用Entity F ...
- iOS自动化测试需求实现(iOS按键精灵类似)
需求分析: 作为以需求为驱动的IT公司,有再奇怪的需求都不奇怪,所以“24小时循测第三方应用”这样的需求也可以接受.业务需求重点为: 1.24小时循测 2.无人值守,自动完成 3.自动界面操作(点击. ...
- maven环境的配置
http://maven.oschina.net/help.html --配置说明 http://maven.oschina.net/index.html#nexus-search;quick ...
- Objective-C 成员变量
成员变量的访问权限 Objective-C中的成员变量有以下三种属性 public(外部及其子类可访问) protected(子类可访问,外部不可访问) private(外部及其子类不可访问) 默认情 ...