2017-03-08 84 views
1

我想使用Apache水槽弹性搜索本机接收器在天鹅座。 我怎样才能配置cygnus使用这个本机接收器?添加Apache水槽弹性搜索水槽

难道我把本地jar file在Apache的水槽lib和将代理配置为如下因素:

# Name the components on this agent 
a1.sources = r1 
a1.sinks = k1 
a1.channels = c1 

# Describe/configure the source 
a1.sources.r1.type = netcat 
a1.sources.r1.bind = localhost 
a1.sources.r1.port = 44444 

# Describe the sink 
a1.sinks.k1.type = logger 

# Use a channel which buffers events in memory 
a1.channels.c1.type = memory 
a1.channels.c1.capacity = 1000 
a1.channels.c1.transactionCapacity = 100 

# Bind the source and sink to the channel 
a1.sources.r1.channels = c1 
a1.sinks.k1.channel = c1 

,然后我启动两个天鹅例如一个与天鹅-ngsi剂和其他弹性搜索本地水槽? 找不到如何运行天鹅座实例(我从源安装天鹅座,所以我不能使用Linux服务启动它)

是否有可能使用相同的源cygnus-ngsi和这个新的汇?因为我需要两个相同的来源。

感谢和问候。

回答

1

Cygnus基于Apache Flume,它安装所有Flume库。这意味着如果您愿意,您甚至可以使用Cygnus作为纯Flume代理。换句话说,Cygnus是Apache Flume的延伸。

因此,在天鹅座中使用本机接收器只是一个配置问题。在ElasticSearchSink的特定情况下,只需按照documentation

cygnusngsi.sinks = elastic-sink <other_flume_sinks> <other_cygnus_sinks> 
cygnusngsi.channels = elastic-channel <other_channels> 
... 
cygnusngsi.sinks.elastic-sink.type = elasticsearch 
cygnusngsi.sinks.elastic-sink.hostNames = 127.0.0.1:9200,127.0.0.2:9300 
cygnusngsi.sinks.elastic-sink.indexName = foo_index 
cygnusngsi.sinks.elastic-sink.indexType = bar_type 
cygnusngsi.sinks.elastic-sink.clusterName = foobar_cluster 
cygnusngsi.sinks.elastic-sink.batchSize = 500 
cygnusngsi.sinks.elastic-sink.ttl = 5d 
cygnusngsi.sinks.elastic-sink.serializer = org.apache.flume.sink.elasticsearch.ElasticSearchDynamicSerializer 
cygnusngsi.sinks.elastic-sink.channel = elastic-channel 

关于源,可以配置多个在一个单一的代理配置,然后将每个源通过专用信道连接到一个不同的接收器。图示:

source1 --- channel1 --- sink1 
source2 --- channel2 --- sink2 

或者你可以使用相同的来源为两个接收器;在这种情况下,您必须通过两个专用通道将两个接收器连接到单个信号源,并且复制通道选择器(无需对其进行配置,这是默认行为)将为传入的NGSI通知创建一个副本每个频道。示意图:

  ___ channel1 --- sink1 
source__/
     \___ channel2 --- sink2