find the line 保卫萝卜125关攻略略

大数据工具篇之flume1.4-安装部署指南 - 张子良 - 推酷
大数据工具篇之flume1.4-安装部署指南 - 张子良
flume-ng是一个分布式、高可靠和高效的日志收集系统,flume-ng是flume的新版本的意思,其中“ng”意为new generate(新一代),目前来说,flume-ng 1.4是最新的版本。flume-ng与flume相比,发生了很大的变化,因为之前一直在flume0.9的版本,一直没有升级到flume-ng,最近因为项目需要,做了一次升级,发现了一些问题,特记录下来,分享给大家。
二、版本说明
三、安装步骤
下载、解压、安装JDK、设置环境变量部分已经有很多介绍性的问题,不做说明。
需要特别说明之处的是,flume-ng不需要要zookeeper
,无需设置。
四、flume-ng bug
安装完成后运行flume-ng会出现错误信息,这主要是因为shell脚本的问题,我将修改后的flume-ng完整的上传如下,其中标注:#zhangzl下面的行是需要修改的部分。完整脚本如下所示:
1 #!/bin/bash
4 # Licensed to the Apache Software Foundation (ASF) under one
5 # or more contributor license agreements.
See the NOTICE file
6 # distributed with this work for additional information
7 # regarding copyright ownership.
The ASF licenses this file
8 # to you under the Apache License, Version 2.0 (the
9 # &License&); you may not use this file except in compliance
10 # with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
14 # Unless required by applicable law or agreed to in writing,
15 # software distributed under the License is distributed on an
16 # &AS IS& BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 # KIND, either express or implied.
See the License for the
18 # specific language governing permissions and limitations
19 # under the License.
22 ################################
23 # constants
24 ################################
26 FLUME_AGENT_CLASS=&org.apache.flume.node.Application&
27 FLUME_AVRO_CLIENT_CLASS=&org.apache.flume.client.avro.AvroCLIClient&
28 FLUME_VERSION_CLASS=&org.apache.flume.tools.VersionInfo&
29 FLUME_TOOLS_CLASS=&org.apache.flume.tools.FlumeToolsMain&
31 CLEAN_FLAG=1
32 ################################
33 # functions
34 ################################
36 info() {
if [ ${CLEAN_FLAG} -ne 0 ]; then
local msg=$1
echo &Info: $msg& &&2
43 warn() {
if [ ${CLEAN_FLAG} -ne 0 ]; then
local msg=$1
echo &Warning: $msg& &&2
50 error() {
local msg=$1
local exit_code=$2
echo &Error: $msg& &&2
if [ -n &$exit_code& ] ; then
exit $exit_code
61 # If avail, add Hadoop paths to the FLUME_CLASSPATH and to the
62 # FLUME_JAVA_LIBRARY_PATH env vars.
63 # Requires Flume jars to already be on FLUME_CLASSPATH.
64 add_hadoop_paths() {
local HADOOP_IN_PATH=$(PATH=&${HADOOP_HOME:-${HADOOP_PREFIX}}/bin:$PATH& \
which hadoop 2&/dev/null)
if [ -f &${HADOOP_IN_PATH}& ]; then
info &Including Hadoop libraries found via ($HADOOP_IN_PATH) for HDFS access&
# determine hadoop java.library.path and use that for flume
local HADOOP_CLASSPATH=&&
local HADOOP_JAVA_LIBRARY_PATH=$(HADOOP_CLASSPATH=&$FLUME_CLASSPATH& \
${HADOOP_IN_PATH} org.apache.flume.tools.GetJavaProperty \
java.library.path)
# look for the line that has the desired property value
# (considering extraneous output from some GC options that write to stdout)
# IFS = InternalFieldSeparator (set to recognize only newline char as delimiter)
for line in $HADOOP_JAVA_LIBRARY_PATH; do
#if [[ $line =~ ^java\.library\.path=(.*)$ ]]; then
if [[ &$line& =~ &^java\.library\.path=(.*)$& ]]; then
HADOOP_JAVA_LIBRARY_PATH=${BASH_REMATCH[1]}
if [ -n &${HADOOP_JAVA_LIBRARY_PATH}& ]; then
FLUME_JAVA_LIBRARY_PATH=&$FLUME_JAVA_LIBRARY_PATH:$HADOOP_JAVA_LIBRARY_PATH&
# determine hadoop classpath
HADOOP_CLASSPATH=$($HADOOP_IN_PATH classpath)
# hack up and filter hadoop classpath
local ELEMENTS=$(sed -e 's/:/ /g' &&&${HADOOP_CLASSPATH})
local ELEMENT
for ELEMENT in $ELEMENTS; do
local PIECE
for PIECE in $(echo $ELEMENT); do
if [[ $PIECE =~ &slf4j-(api|log4j12).*\.jar& ]]; then
info &Excluding $PIECE from classpath&
FLUME_CLASSPATH=&$FLUME_CLASSPATH:$PIECE&
115 add_HBASE_paths() {
local HBASE_IN_PATH=$(PATH=&${HBASE_HOME}/bin:$PATH& \
which hbase 2&/dev/null)
if [ -f &${HBASE_IN_PATH}& ]; then
info &Including HBASE libraries found via ($HBASE_IN_PATH) for HBASE access&
# determine HBASE java.library.path and use that for flume
local HBASE_CLASSPATH=&&
local HBASE_JAVA_LIBRARY_PATH=$(HBASE_CLASSPATH=&$FLUME_CLASSPATH& \
${HBASE_IN_PATH} org.apache.flume.tools.GetJavaProperty \
java.library.path)
# look for the line that has the desired property value
# (considering extraneous output from some GC options that write to stdout)
# IFS = InternalFieldSeparator (set to recognize only newline char as delimiter)
for line in $HBASE_JAVA_LIBRARY_PATH; do
if [[ $line =~ &^java\.library\.path=(.*)$& ]]; then
HBASE_JAVA_LIBRARY_PATH=${BASH_REMATCH[1]}
if [ -n &${HBASE_JAVA_LIBRARY_PATH}& ]; then
FLUME_JAVA_LIBRARY_PATH=&$FLUME_JAVA_LIBRARY_PATH:$HBASE_JAVA_LIBRARY_PATH&
# determine HBASE classpath
HBASE_CLASSPATH=$($HBASE_IN_PATH classpath)
# hack up and filter HBASE classpath
local ELEMENTS=$(sed -e 's/:/ /g' &&&${HBASE_CLASSPATH})
local ELEMENT
for ELEMENT in $ELEMENTS; do
local PIECE
for PIECE in $(echo $ELEMENT); do
if [[ $PIECE =~ &slf4j-(api|log4j12).*\.jar& ]]; then
info &Excluding $PIECE from classpath&
FLUME_CLASSPATH=&$FLUME_CLASSPATH:$PIECE&
FLUME_CLASSPATH=&$FLUME_CLASSPATH:$HBASE_HOME/conf&
168 set_LD_LIBRARY_PATH(){
169 #Append the FLUME_JAVA_LIBRARY_PATH to whatever the user may have specified in
170 #flume-env.sh
if [ -n &${FLUME_JAVA_LIBRARY_PATH}& ]; then
export LD_LIBRARY_PATH=&${LD_LIBRARY_PATH}:${FLUME_JAVA_LIBRARY_PATH}&
176 display_help() {
178 Usage: $0 &command& [options]...
180 commands:
display this help text
run a Flume agent
avro-client
run an avro Flume client
show Flume version info
186 global options:
--conf,-c &conf&
use configs in &conf& directory
--classpath,-C &cp&
append to the classpath
--dryrun,-d
do not actually start Flume, just print the command
--plugins-path &dirs& colon-separated list of plugins.d directories. See the
plugins.d section in the user guide for more details.
Default: \$FLUME_HOME/plugins.d
-Dproperty=value
sets a Java system property value
-Xproperty=value
sets a Java -X option
196 agent options:
--conf-file,-f &file& specify a config file (required)
--name,-n &name&
the name of this agent (required)
display help text
201 avro-client options:
--rpcProps,-P &file&
RPC client properties file with server connection params
--host,-H &host&
hostname to which events will be sent
--port,-p &port&
port of the avro source
--dirname &dir&
directory to stream to avro source
--filename,-F &file&
text file to stream to avro source (default: std input)
--headerFile,-R &file& File containing event headers as key/value pairs on each new line
display help text
Either --rpcProps or both --host and --port must be specified.
212 Note that if &conf& directory is specified, then it is always included first
213 in the classpath.
218 run_flume() {
local FLUME_APPLICATION_CLASS
if [ &$#& -gt 0 ]; then
FLUME_APPLICATION_CLASS=$1
error &Must specify flume application class& 1
if [ ${CLEAN_FLAG} -ne 0 ]; then
$EXEC $JAVA_HOME/bin/java $JAVA_OPTS -cp &$FLUME_CLASSPATH& \
-Djava.library.path=$FLUME_JAVA_LIBRARY_PATH &$FLUME_APPLICATION_CLASS& $*
235 ################################
236 # main
237 ################################
239 # set default params
240 FLUME_CLASSPATH=&&
241 FLUME_JAVA_LIBRARY_PATH=&&
242 JAVA_OPTS=&-Xmx20m&
243 LD_LIBRARY_PATH=&&
245 opt_conf=&&
246 opt_classpath=&&
247 opt_plugins_dirs=&&
248 opt_java_props=&&
249 opt_dryrun=&&
251 mode=$1
254 case &$mode& in
display_help
opt_agent=1
opt_agent=1
warn &The \&node\& command is deprecated. Please use \&agent\& instead.&
avro-client)
opt_avro_client=1
opt_tool=1
opt_version=1
CLEAN_FLAG=0
error &Unknown or unspecified command '$mode'&
display_help
284 args=&&
285 while [ -n &$*& ] ; do
case &$arg& in
--conf|-c)
[ -n &$1& ] || error &Option --conf requires an argument& 1
opt_conf=$1
--classpath|-C)
[ -n &$1& ] || error &Option --classpath requires an argument& 1
opt_classpath=$1
--dryrun|-d)
opt_dryrun=&1&
--plugins-path)
opt_plugins_dirs=$1
opt_java_props=&$opt_java_props $arg&
opt_java_props=&$opt_java_props $arg&
args=&$args $arg&
319 # make opt_conf absolute
320 if [[ -n &$opt_conf& && -d &$opt_conf& ]]; then
opt_conf=$(cd $opt_ pwd)
324 # allow users to override the default env vars via conf/flume-env.sh
325 if [ -z &$opt_conf& ]; then
warn &No configuration directory set! Use --conf &dir& to override.&
327 elif [ -f &$opt_conf/flume-env.sh& ]; then
info &Sourcing environment configuration script $opt_conf/flume-env.sh&
source &$opt_conf/flume-env.sh&
332 # append command-line java options to stock or env script JAVA_OPTS
333 if [ -n &${opt_java_props}& ]; then
JAVA_OPTS=&${JAVA_OPTS} ${opt_java_props}&
337 # prepend command-line classpath to env script classpath
338 if [ -n &${opt_classpath}& ]; then
if [ -n &${FLUME_CLASSPATH}& ]; then
FLUME_CLASSPATH=&${opt_classpath}:${FLUME_CLASSPATH}&
FLUME_CLASSPATH=&${opt_classpath}&
346 if [ -z &${FLUME_HOME}& ]; then
FLUME_HOME=$(cd $(dirname $0)/..; pwd)
350 # prepend $FLUME_HOME/lib jars to the specified classpath (if any)
351 if [ -n &${FLUME_CLASSPATH}& ] ; then
FLUME_CLASSPATH=&${FLUME_HOME}/lib/*:$FLUME_CLASSPATH&
FLUME_CLASSPATH=&${FLUME_HOME}/lib/*&
357 # load plugins.d directories
358 PLUGINS_DIRS=&&
359 if [ -n &${opt_plugins_dirs}& ]; then
PLUGINS_DIRS=$(sed -e 's/:/ /g' &&&${opt_plugins_dirs})
PLUGINS_DIRS=&${FLUME_HOME}/plugins.d&
365 unset plugin_lib plugin_libext plugin_native
366 for PLUGINS_DIR in $PLUGINS_DIRS; do
if [[ -d ${PLUGINS_DIR} ]]; then
for plugin in ${PLUGINS_DIR}/*; do
if [[ -d &$plugin/lib& ]]; then
plugin_lib=&${plugin_lib}${plugin_lib+:}${plugin}/lib/*&
if [[ -d &$plugin/libext& ]]; then
plugin_libext=&${plugin_libext}${plugin_libext+:}${plugin}/libext/*&
if [[ -d &$plugin/native& ]]; then
plugin_native=&${plugin_native}${plugin_native+:}${plugin}/native&
382 if [[ -n &${plugin_lib}& ]]
FLUME_CLASSPATH=&${FLUME_CLASSPATH}:${plugin_lib}&
387 if [[ -n &${plugin_libext}& ]]
FLUME_CLASSPATH=&${FLUME_CLASSPATH}:${plugin_libext}&
392 if [[ -n &${plugin_native}& ]]
if [[ -n &${FLUME_JAVA_LIBRARY_PATH}& ]]
FLUME_JAVA_LIBRARY_PATH=&${FLUME_JAVA_LIBRARY_PATH}:${plugin_native}&
FLUME_JAVA_LIBRARY_PATH=&${plugin_native}&
402 # find java
403 if [ -z &${JAVA_HOME}& ] ; then
warn &JAVA_HOME is not set!&
# Try to use Bigtop to autodetect JAVA_HOME if it's available
if [ -e /usr/libexec/bigtop-detect-javahome ] ; then
. /usr/libexec/bigtop-detect-javahome
elif [ -e /usr/lib/bigtop-utils/bigtop-detect-javahome ] ; then
. /usr/lib/bigtop-utils/bigtop-detect-javahome
# Using java from path if bigtop is not installed or couldn't find it
if [ -z &${JAVA_HOME}& ] ; then
JAVA_DEFAULT=$(type -p java)
[ -n &$JAVA_DEFAULT& ] || error &Unable to find java executable. Is it in your PATH?& 1
JAVA_HOME=$(cd $(dirname $JAVA_DEFAULT)/..; pwd)
420 # look for hadoop libs
421 add_hadoop_paths
422 add_HBASE_paths
424 # prepend conf dir to classpath
425 if [ -n &$opt_conf& ]; then
FLUME_CLASSPATH=&$opt_conf:$FLUME_CLASSPATH&
429 set_LD_LIBRARY_PATH
430 # allow dryrun
431 EXEC=&exec&
432 if [ -n &${opt_dryrun}& ]; then
warn &Dryrun mode enabled (will not actually initiate startup)&
EXEC=&echo&
437 # finally, invoke the appropriate command
438 if [ -n &$opt_agent& ] ; then
run_flume $FLUME_AGENT_CLASS $args
440 elif [ -n &$opt_avro_client& ] ; then
run_flume $FLUME_AVRO_CLIENT_CLASS $args
442 elif [ -n &${opt_version}& ] ; then
run_flume $FLUME_VERSION_CLASS $args
444 elif [ -n &${opt_tool}& ] ; then
run_flume $FLUME_TOOLS_CLASS $args
error &This message should never appear& 1
450 exit 0
五、测试配置文件
在conf目录下创建example-conf.properties文件,属性如下所示:
1 # Describe the source
2 a1.sources = r1
3 a1.sinks = k1
4 a1.channels = c1
6 # Describe/configure the source
7 a1.sources.r1.type = avro
8 a1.sources.r1.bind = localhost
9 a1.sources.r1.port = 44444
11 # Describe the sink
12 # 将数据输出至日志中
13 a1.sinks.k1.type = logger
16 # Use a channel which buffers events in memory
17 a1.channels.c1.type = memory
18 a1.channels.c1.capacity = 1000
19 a1.channels.c1.transactionCapacity = 100
21 # Bind the source and sink to the channel
22 a1.sources.r1.channels = c1
23 a1.sinks.k1.channel = c1
六、运行命令
[hadoop@hadoop1 conf]$ flume-ng agent -n a1 -f example-conf.properties
6.2 启动avro-client客户端向agent代理发送数据-需要单独启动新的窗口
[hadoop@hadoop1 conf]$ flume-ng avro-client -H localhost -p 44444 -F file01
七、结果查看
1 14/01/16 22:26:34 INFO ipc.NettyServer: [id: 0x, /127.0.0.1:54289 =& /127.0.0.1:44444] OPEN
2 14/01/16 22:26:34 INFO ipc.NettyServer: [id: 0x, /127.0.0.1:54289 =& /127.0.0.1:44444] BOUND: /127.0.0.1:44444
3 14/01/16 22:26:34 INFO ipc.NettyServer: [id: 0x, /127.0.0.1:54289 =& /127.0.0.1:44444] CONNECTED: /127.0.0.1:54289
4 14/01/16 22:26:36 INFO ipc.NettyServer: [id: 0x, /127.0.0.1:54289 :& /127.0.0.1:44444] DISCONNECTED
5 14/01/16 22:26:36 INFO ipc.NettyServer: [id: 0x, /127.0.0.1:54289 :& /127.0.0.1:44444] UNBOUND
6 14/01/16 22:26:36 INFO ipc.NettyServer: [id: 0x, /127.0.0.1:54289 :& /127.0.0.1:44444] CLOSED
7 14/01/16 22:26:36 INFO ipc.NettyServer: Connection to /127.0.0.1:54289 disconnected.
8 14/01/16 22:26:38 INFO sink.LoggerSink: Event: { headers:{} body: 68 65 6C 6C 6F 20 77 6F 72 6C 64
hello world }
已发表评论数()
&&登&&&陆&&
已收藏到推刊!
请填写推刊名
描述不能大于100个字符!
权限设置: 公开
仅自己可见当前位置: >
彩线拼图Find The Line怎么玩 游戏操作介绍
来源:18183
彩线拼图Find The Line是一款创意无限的游戏,需要玩家发挥想象力,才能过关。那么游戏应该怎么操作呢?下面小编为大家详细介绍。
游戏的玩法很简单,用手指滑动屏幕下方的滚动槽,来控制每根线条的前进或后退。而最为叫人意外的是,虽然直接将线条移动方向限制死了,只有向前或是后退,却不会让人感到僵硬无趣。这就归功于游戏画面对&精美&和&灵动&这两个词语近乎完美的演绎。一开始路线会非常简单,很容易就能看出端倪。
以上就是彩线拼图Find The Line这款游戏操作介绍,希望对大家有所帮助。更多攻略查看18183彩线拼图Find The Line专区。
18183手游网发布此文仅为传递信息,不代表18183认同其观点或证实其描述。
本文标签:
Find The Line支持系统:快捷入口:游戏类型:休闲益智游戏语言:英文
请在微信公众帐号中搜索“18183”或用手机扫描左方二维码即可获得18183每日精彩游戏资讯推荐。find the line第111关至第130关的钥匙在哪_百度知道
find the line第111关至第130关的钥匙在哪
已经找到116关的
提问者采纳
114也有一个钥匙。
提问者评价
其他类似问题
按默认排序
其他1条回答
120 有一个
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁您的位置:&
《寻找线条》(Find the Line)是由名为 Stigol 的乌克兰游戏公司开发,麒麟狗负责代理发......findtheline第七大关钥匙在第几关_百度知道
findtheline第七大关钥匙在第几关
就sports那关,玩出来的说啊,最好再附上图,谢谢
82第六大关、73:72:8、65第五大关、61、109、36、40第四大关。、13第三大关、10:4第二大关:54通关亲测,还有一个也在寻找中。:第一大关:31:95
其他类似问题
按默认排序
其他1条回答
114,116,120
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁}

我要回帖

更多关于 保卫萝卜2 125关攻略 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信