This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.io.IOException; | |
| import java.util.*; | |
| import org.apache.hadoop.conf.*; | |
| import org.apache.hadoop.io.*; | |
| import org.apache.hadoop.mapreduce.Job; | |
| import org.apache.hadoop.mapreduce.Mapper; | |
| import org.apache.hadoop.mapreduce.Reducer; | |
| import org.apache.hadoop.mapreduce.lib.input.*; | |
| import org.apache.hadoop.mapreduce.lib.output.*; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import ftplib | |
| import sys | |
| from progressbar import ProgressBar | |
| from progressbar.widgets import Percentage, FileTransferSpeed, ETA, Bar | |
| if len(sys.argv) < 4: | |
| print("请输入ftp地址,用户,密码和文件".decode("utf8")) | |
| sys.exit(0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| #-*- coding:utf-8 -*- | |
| ## | |
| ## | |
| # Copyright (C) | |
| # | |
| # This program is free software; you can redistribute it and/or | |
| # modify it under the terms of the GNU General Public License | |
| # as published by the Free Software Foundation. | |
| # 本程序是免费软件,基于GPL许可发布。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.io.BufferedInputStream; | |
| import java.io.BufferedOutputStream; | |
| import java.io.File; | |
| import java.io.FileInputStream; | |
| import java.io.FileOutputStream; | |
| import java.io.IOException; | |
| import java.util.zip.GZIPInputStream; | |
| import org.xeustechnologies.jtar.TarEntry; | |
| import org.xeustechnologies.jtar.TarInputStream; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| webrequest.channels = file-channel | |
| webrequest.sources = udp2log | |
| webrequest.sinks = hdfs-sink | |
| # Channel which buffers events on disk | |
| webrequest.channels.file-channel.type = file | |
| webrequest.channels.file-channel.checkpointDir = /var/lib/hadoop/data/e/flume/file-channel/checkpoint | |
| webrequest.channels.file-channel.dataDirs = /var/lib/hadoop/data/e/flume/file-channel/data | |
| webrequest.channels.file-channel.checkpointInterval = 1000 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import org.apache.hadoop.hbase.util.Bytes | |
| import org.apache.hadoop.hbase.{HColumnDescriptor, HTableDescriptor, TableName, HBaseConfiguration} | |
| import org.apache.hadoop.hbase.client._ | |
| import org.apache.spark.SparkContext | |
| import scala.collection.JavaConversions._ | |
| /** | |
| * HBase 1.0.0 新版API, CRUD 的基本操作代码示例 | |
| **/ | |
| object HBaseNewAPI { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # | |
| # Licensed to the Apache Software Foundation (ASF) under one or more | |
| # contributor license agreements. See the NOTICE file distributed with | |
| # this work for additional information regarding copyright ownership. | |
| # The ASF licenses this file to You under the Apache License, Version 2.0 | |
| # (the "License"); you may not use this file except in compliance with | |
| # the License. You may obtain a copy of the License at | |
| # | |
| # http://www.apache.org/licenses/LICENSE-2.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| emitter.sources = access avro1 thrift1 nc1 | |
| emitter.channels = c1 | |
| emitter.sinks = s1 s2 s3 | |
| emitter.sinkgroups = g1 | |
| emitter.sources.access.channels = c1 | |
| emitter.sources.access.type = exec | |
| emitter.sources.access.command = tail -F -n 0 --pid `ps -o ppid= $$` /tmp/access.log | sed -e "s/^/host=`hostname --fqdn` category=access:/" | |
| emitter.sources.access.shell = /bin/sh -c |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # | |
| # chkconfig: 345 99 01 | |
| # description: Kafka | |
| # | |
| # File : Kafka | |
| # | |
| # Description: Starts and stops the Kafka server | |
| # |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "template_logstash":{ | |
| "template" : "logstash*", | |
| "settings" : { | |
| "number_of_shards" : 5, | |
| "index.cache.field.type" : "soft", | |
| "index.refresh_interval" : "5s", | |
| "index.store.compress.stored" : true, | |
| "index.query.default_field" : "message", | |
| "index.routing.allocation.total_shards_per_node" : 5 |