Flume 入门

作者:Rui 发布时间:September 9, 2015 分类:BIGDATA 浏览:724

Flume NG 简介

Flume NG(Next Generation)是一个分布式、可靠、和高可用的海量日志聚合的系统,支持在系统中定制各类数据发送方,用于收集数据;同时Flume提供对数据进行简单处理,并写到各种数据接受方(可定制)的能力。

下载 Flume NG

在官网 有Flume的源码包和二进制包,你可以从这里下载,如果你不想了解Flume的源码,可以直接下载二进制包,这样更简单。

Building From Source

如果想编译Flume源码,你必须先下载Git,JDK1.6, Maven

  1. 下载源码
$ git clone https://git-wip-us.apache.org/repos/asf/flume.git flume
$ cd flume
$ git checkout trunk
  1. 编译源码

Apache Flume 需要额外的MAVEN 配置

export MAVEN_OPTS="-Xms512m -Xmx1024m -XX:PermSize=256m -XX:MaxPermSize=512m"
#Build the code and run the tests (note: use mvn install, not mvn package, since we deploy Jenkins SNAPSHOT jars daily, and Flume is a multi-module project)
$ mvn install
# ...or build the code without running the tests
$ mvn install -DskipTests

阅读剩余部分...

How to run a Java program in a Docker container

作者:Rui 发布时间:September 9, 2015 分类:JAVA,Docker,CLOUD 浏览:625

In this post I’m going to show how to create a new Docker image from scratch, how to add the JDK, and how we can use this image to compile and run a Java program.

Creating the Image with the JDK

The first step is to create a new Docker image from the base Docker image ubuntu:14.04 and to install a JDK on top of that. We use a Dockerfile to provide the instructions to build such an image.
There is a link explaining how to Install Oracle Java 8 In Ubuntu Via PPA Repository [JDK8]. Basically we want to execute these commands in a Dockerfile.
The Dockerfile is simply as follows:

RUN apt-get update 
RUN apt-get install software-properties-common -y 
RUN add-apt-repository ppa:webupd8team/java -y 
RUN apt-get update 
RUN echo debconf shared/accepted-oracle-license-v1-1 select true | debconf-set-selections 
RUN apt-get install oracle-java8-installer -y 
RUN apt-get install oracle-java8-set-default 

It’s worth noting that we want the JDK installation to be automated (auto accept license) because the image is built in a not-interactive way and it wouldn’t be possible for us to manually accept the license during the JDK installation. This is done by the debconf-set-selections command. Now we just need to copy the Dockerfile above into a directory (in this article I’m using ~/dockertest) and run the docker build command:

~/dockertest$ docker build -t massimo/javatest:v1 .

阅读剩余部分...

关于融资融券

作者:Rui 发布时间:September 1, 2015 分类:STOCK 浏览:406

融资融券是指证券公司向投资者出借资金供其买入证券,或出借证券供其卖出的经营活动。投资者向证券公司借入资金买入证券、借入证券卖出的交易活动,则称为融资融券交易,又称信用交易。

融资融券交易分为融资交易和融券交易两类。投资者向证券公司借入资金买入证券,为融资交易;投资者向证券公司借入证券卖出,为融券交易。

融资可以放大你的操作规模,如当你看好某只股票想大举介入而手中钱又不多时就可以向券商借钱买股票,当股票上涨到目标价后,你可以卖出股票清偿借款,从而放大你的收益。融券为你做空赚钱创造了条件,当你看跌某股时,你可以向券商借入该股,然后将其卖掉,等其下跌后你再买入该股票还给券商,从中获取差额。

简单了说,融资就是券商借钱给你买股票,等你卖出或者时间截至时你在还钱,融券是券商借股票让你卖出,等你在买入该股票或者到期时系统自动买入股票时,偿还借的股票。

阅读剩余部分...