Big data development beginners need to know that?

Want to go big data direction, the school which technology, learning what kind of route, think big data is fire, good jobs, high wages. . . . . . . If they are confused, for these reasons to think big data direction, can be, then I would like to ask, what is your profession, for the computer / software, what are you interested in? Is a computer professional, interested in the operating system, hardware, network, server? Is a professional software, software development, programming, writing code that interest? Or Math, Statistics, particularly interested in data and numbers. .
In fact, this is the direction you want to tell three big data platform to build / Optimization / operation and maintenance / monitoring, Big Data development / design / architecture, data analysis / mining. Please do not ask me which is easy, which is good prospect, which more money.

4V to pull it features big data:

  • Large amount of data, TB-> PB

  • Many types of data, structured, unstructured text, log, video, image, location and the like;

  • High commercial value, but the value on top of huge amounts of data required, through data analysis and machine learning faster excavated;

  • High processing timeliness, massive data processing requirements no longer confined to them off-line calculation.

Now, in order to deal with these formal characteristics of Big Data, Big Data open source framework, and more and stronger, to list some common ones:

File Storage: Hadoop HDFS, Tachyon, KFS
off-line calculation: Hadoop MapReduce, the Spark
streaming, real-time calculation: Storm, the Spark Streaming, S4, Heron
K-V, NOSQL database: HBase, Redis, MongoDB
resource management: YARN, Mesos
log collection: Flume , Scribe, Logstash, Kibana
messaging system: Kafka used to live, StormMQ, ZeroMQ, RabbitMQ
analysis: Hive, Impala, Pig, Presto, Phoenix, SparkSQL, Drill, Flink, Kylin, Druid
distributed coordination services: Zookeeper
cluster management and monitoring: Ambari , Ganglia, Nagios, Cloudera Manager
data mining, machine learning: Mahout, the Spark MLLib
data synchronization: Sqoop
task scheduling: Oozie
......

Vertigo, right, above the 30 kinds of it, let alone mastered, will all use, I guess not many.
For me personally, the main experience is in a second direction (development / design / architecture), and listen to my advice it.

 

Chapter One: acquaintance Hadoop

 

1.1 learn Baidu and Google

 

Regardless of any problems, first try and solve their own search.


Google preferred, climb over, just use Baidu bar.

 

1.2 References preferred official documents

 

Especially for entry, official documents will always be the first choice for the document.


I believe this is mostly engaged intellectuals, English improvise on the line, I could not stand, please refer to the first step.

 

Let them run Hadoop 1.3

 

Hadoop can be regarded as a large data storage and computing pedigree, now mostly open-source Hadoop big data framework or rely very good compatibility with it.

 

About Hadoop, you at least need to figure out what are the following:

 

  • Hadoop 1.0、Hadoop 2.0

  • MapReduce、HDFS

  • NameNode, DataNode

  • JobTracker, TaskTracker

  • Yarn、ResourceManager、NodeManager

 

Build their own Hadoop, please use the first and second stages, allowing it to run up on the line.


It is recommended to use the command line to install the installation package, do not use the management tools installed.


Also: Hadoop1.0 know it's the line, now with Hadoop 2.0.

 

Try using Hadoop 1.4

 

HDFS directory operation command;
upload, download files command;
submit MapReduce run the sample program;


Open the Hadoop WEB interface to view the Job running, view the Job run log.
 

I know where Hadoop system logs.

 

1.5 You should understand their principles of

 

MapReduce: How to Divide and conquer;
HDFS: Where is the data, what is a copy;
what Yarn in the end is that it can do;
the NameNode in the end in doing;
the ResourceManager in the end are doing;

 

1.6 write a MapReduce program

 

Please follow WordCount example, to write a (copy is also OK) WordCount program,
packaged and submitted to run Hadoop.


You will not Java? Shell, Python can be, there is something called Hadoop Streaming.

If you're serious completed the above steps, congratulations, you are one foot already entered.

 

Chapter II: More efficient WordCount

 

Learn SQL 2.1 bar

 

You know databases? SQL you write it?
If not, please learn SQL it.

 

2.2 SQL版WordCount

 

In 1.6, you write (or copy) of WordCount There are a few lines of code?
 

You look at me:

SELECT word,COUNT(1) FROM wordcount GROUP BY word;

 

This is the charm of SQL programming required dozens of lines, or even hundreds of lines of code, I have to get this one; the use of SQL processing and analysis of data on Hadoop, convenient, efficient and approachable, even more is the trend. Whether calculated or off-line real-time computing, more and more large data processing framework are actively provides a SQL interface.

 

2.3 SQL On Hadoop之Hive

 

What is the Hive? The official explanation given is:


The Apache Hive data warehouse software facilitates reading, writing, and managing large datasets residing in distributed storage and queried using SQL syntax.

 

Why Hive is a data warehouse tool, rather than a database tool? Some people may not know the data warehouse, data warehouse is a logical concept, using the underlying database, the data warehouse has two characteristics: the most comprehensive historical data (mass), relatively stable; the so-called relative stability , referring to the business system database is different from the data warehouse, data will be updated frequently, the data once into the data warehouse rarely updated and deleted, will be a large number of queries. The Hive, also have these two characteristics, therefore, Hive suitable for mass data of the data warehousing tools, rather than a database tool.

 

2.4 Installation Configuration Hive

 

Please refer to 1.1 and 1.2 of the installation configuration Hive. Hive can normally enter the command line.

 

Try using Hive 2.5

 

Please refer to 1.1 and 1.2, create wordcount table in the Hive and run the 2.2 SQL statement.
SQL task to find just running Hadoop WEB interface.


SQL query results and see if the results are consistent in MapReduce 1.4.

 

2.6 Hive is how it works

 

Obviously written SQL, see Why Hadoop WEB interface is MapReduce task?

 

2.7 learn basic commands of Hive

 

Create, delete table;
load data into tables;
download data Hive table;


See Section 1.2 to learn more about the Hive and command syntax.

 

If you've followed "Big Data written to the development of beginner words" in the flow of the first chapters of the second full seriously gone again, then you should already have the following skills and knowledge:

 

  • 0 and the difference of Hadoop2.0;

  • MapReduce principle (or that classic title, a 10G size of the file, given the size of 1G memory, how to use Java programs up to 10 times the number of words and statistics appear);

  • HDFS read and write data flow; PUT data to the HDFS; download data from the HDFS;

  • I will write a simple MapReduce program, run problems, know where to view the log;

  • Write simple SELECT, WHERE, GROUP BY and other SQL statements;

  • Hive SQL procedure substantially converted to the MapReduce;

  • Hive common statement: create table, drop table, load data into a table, partition, download the data in the table to the local;

 

From the above study, you have learned, distributed storage framework Hadoop HDFS is provided, which can be used to store huge amounts of data, MapReduce is a Hadoop distributed computing framework provided, it can be used on the huge amounts of data and statistical analysis HDFS while the Hive is SQL On Hadoop, Hive provides a SQL interface, developers only need to write SQL statements simple and approachable, responsible for the Hive SQL translated into MapReduce, filed to run.

 

At this point, your "big data platform," is this:

 

 

So the question is, how vast amounts of data to HDFS it?

 

Chapter 3: get the data elsewhere on Hadoop

 

Here can also be called the data acquisition, the acquired data to the respective data sources Hadoop.

 

3.1 HDFS PUT command

 

This in front of you should have used before.

 

put the command in a real environment is relatively common, usually with the shell, python and other scripting languages ​​to use.

Recommended master.

 

3.2 HDFS API

 

HDFS provides an API to write data, they used programming language to write data to HDFS, put the command itself also use the API.
Usually their actual environment using fewer programming API to write data to the HDFS, other frameworks are usually packaged method. For example: Hive in the INSERT statement, Spark of saveAsTextfile and so on.


Understand the principles of suggestions, write Demo.

 

3.3 Sqoop

 

Sqoop is a major open-source framework for the exchange of data between Hadoop / Hive traditional relational database Oracle / MySQL / SQLServer like.


Like the Hive SQL translated into MapReduce, like, Sqoop to translate the parameters you specify into MapReduce, Hadoop running submitted to complete the exchange of data between Hadoop and other databases.

 

Download and configure their own Sqoop (recommended to use Sqoop1, Sqoop2 more complex).


Identifying common configuration parameters and methods Sqoop.


Sqoop completed using MySQL to synchronize data from the HDFS;
use Sqoop to complete the synchronization data from MySQL Hive table;

 

PS: If subsequent selection is determined using Sqoop as a data exchange tool, it is recommended to master, otherwise, will be used to understand and Demo can be.

 

3.4 Flume

 

Flume is a distributed massive log collection and transmission frame, because "acquisition and transmission frame", so it is not suitable for data collection and transmission relational database.


Flume from the network protocol, message system, real-time file system logs collected and transmitted to the HDFS.
So, if you have a business data from these data sources, and the need for real-time collection, then you should consider using the Flume.

 

Download and configure Flume.


Flume continuously monitor a file using the additional data, and transfers the data to the HDFS;

 

PS: Flume configuration and use more complex, if you do not have enough interest and patience, you can skip Flume.

 

3.5 Ali open source DataX

 

The reason why this introduction, because the tool Hadoop and relational database data we currently use the exchange, is based on previously developed DataX, very easy to use.


You can refer to my blog "heterogeneous data sources mass data exchange tool -Taobao DataX download and use."


DataX now has a 3.0 version, supports many data sources.


You can also do the secondary development above it.

PS: Interested parties can study and use it, compare it with Sqoop.

 

If you earnestly fulfill the above study and practice, at this time, your "big data platform" should look like this:

 

 

Chapter 4: data on Hadoop get elsewhere

Seen how the collected data to a data source Hadoop, after data on Hadoop, Hive and MapReduce can use to analyze the. Then the next question is how the results from the analysis of the complete Hadoop synchronized to the other systems and applications go? Want the system to learn big data , you can join the big data exchange technology to learn buttoned Junyang: 522 189 307 , welcome additions, understand Courses

In fact, the methods herein and the third chapter basically the same.

4.1 HDFS GET command

The files on HDFS GET locally. Need to master.

4.2 HDFS API

With 3.2.

4.3 Sqoop

. 3.3 with
use Sqoop complete file to the HDFS synchronizing the MySQL;
use Sqoop Hive completion data table are synchronized to the MySQL;

4.4 DataX

With 3.5.

 

If you earnestly fulfill the above study and practice, at this time, your "big data platform" should look like this:

 

 

If you've followed the process of Chapter III and IV "wrote 2 big data development beginner words" serious Complete gone again, then you should already have the following skills and knowledge:

 

We know how to collect existing data on HDFS, including offline collection and real-time acquisition;

You already know sqoop (or there DataX) is a tool for data exchange between HDFS and other data sources;

You already know flume can be used as a real-time log collection;

 

从前面的学习,对于大数据平台,你已经掌握的不少的知识和技能,搭建Hadoop集群,

把数据采集到Hadoop上,使用Hive和MapReduce来分析数据,把分析结果同步到其他数据源。

 

接下来的问题来了,Hive使用的越来越多,你会发现很多不爽的地方,特别是速度慢,

大多情况下,明明我的数据量很小,它都要申请资源,启动MapReduce来执行。

 

第五章:快一点吧,我的SQL

 

其实大家都已经发现Hive后台使用MapReduce作为执行引擎,实在是有点慢。

因此SQL On Hadoop的框架越来越多,按我的了解,最常用的按照流行度依次为SparkSQL、Impala和Presto.

 

这三种框架基于半内存或者全内存,提供了SQL接口来快速查询分析Hadoop上的数据。关于三者的比较,请参考1.1.

 

我们目前使用的是SparkSQL,至于为什么用SparkSQL,原因大概有以下吧:

 

使用Spark还做了其他事情,不想引入过多的框架;

Impala对内存的需求太大,没有过多资源部署;

 

5.1 关于Spark和SparkSQL

 

什么是Spark,什么是SparkSQL。
Spark有的核心概念及名词解释。
SparkSQL和Spark是什么关系,SparkSQL和Hive是什么关系。
SparkSQL为什么比Hive跑的快。

 

5.2 如何部署和运行SparkSQL

 

Spark有哪些部署模式?
如何在Yarn上运行SparkSQL?
使用SparkSQL查询Hive中的表。

PS: Spark不是一门短时间内就能掌握的技术,因此建议在了解了Spark之后,可以先从SparkSQL入手,循序渐进。

 

关于Spark和SparkSQL,可参考 http://lxw1234.com/archives/category/spark

如果你认真完成了上面的学习和实践,此时,你的”大数据平台”应该是这样的:

 

 

第六章:一夫多妻制

 

请不要被这个名字所诱惑。其实我想说的是数据的一次采集、多次消费。

 

在实际业务场景下,特别是对于一些监控日志,想即时的从日志中了解一些指标(关于实时计算,后面章节会有介绍),这时候,从HDFS上分析就太慢了,尽管是通过Flume采集的,但Flume也不能间隔很短就往HDFS上滚动文件,这样会导致小文件特别多。

 

为了满足数据的一次采集、多次消费的需求,这里要说的便是Kafka。

 

6.1 关于Kafka

 

什么是Kafka?

Kafka的核心概念及名词解释。

 

6.2 如何部署和使用Kafka

 

使用单机部署Kafka,并成功运行自带的生产者和消费者例子。


使用Java程序自己编写并运行生产者和消费者程序。


Flume和Kafka的集成,使用Flume监控日志,并将日志数据实时发送至Kafka。

关于Kafka,可以参考 http://lxw1234.com/archives/category/kafka

 

如果你认真完成了上面的学习和实践,此时,你的”大数据平台”应该是这样的:

 

 

这时,使用Flume采集的数据,不是直接到HDFS上,而是先到Kafka,Kafka中的数据可以由多个消费者同时消费,其中一个消费者,就是将数据同步到HDFS。

 

如果你已经按照《写给大数据开发初学者的话3》中第五章和第六章的流程认真完整的走了一遍,那么你应该已经具备以下技能和知识点:

 

  • 为什么Spark比MapReduce快。

  • 使用SparkSQL代替Hive,更快的运行SQL。

  • 使用Kafka完成数据的一次收集,多次消费架构。

  • 自己可以写程序完成Kafka的生产者和消费者。

 

从前面的学习,你已经掌握了大数据平台中的数据采集、数据存储和计算、数据交换等大部分技能,而这其中的每一步,都需要一个任务(程序)来完成,各个任务之间又存在一定的依赖性,比如,必须等数据采集任务成功完成后,数据计算任务才能开始运行。如果一个任务执行失败,需要给开发运维人员发送告警,同时需要提供完整的日志来方便查错。

 

第七章:越来越多的分析任务

 

不仅仅是分析任务,数据采集、数据交换同样是一个个的任务。这些任务中,有的是定时触发,有点则需要依赖其他任务来触发。当平台中有几百上千个任务需要维护和运行时候,仅仅靠crontab远远不够了,这时便需要一个调度监控系统来完成这件事。调度监控系统是整个数据平台的中枢系统,类似于AppMaster,负责分配和监控任务。

 

7.1 Apache Oozie

 

1. Oozie是什么?有哪些功能?
2. Oozie可以调度哪些类型的任务(程序)?
3. Oozie可以支持哪些任务触发方式?
4.  安装配置Oozie。

 

7.2 其他开源的任务调度系统

 

Azkaban:

https://azkaban.github.io/

light-task-scheduler:

https://github.com/ltsopensource/light-task-scheduler

Zeus:

https://github.com/alibaba/zeus

等等……


另外,我这边是之前单独开发的任务调度与监控系统,具体请参考《大数据平台任务调度与监控系统》.

 

如果你认真完成了上面的学习和实践,此时,你的”大数据平台”应该是这样的:

 

 

第八章:我的数据要实时

 

在第六章介绍Kafka的时候提到了一些需要实时指标的业务场景,实时基本可以分为绝对实时和准实时,绝对实时的延迟要求一般在毫秒级,准实时的延迟要求一般在秒、分钟级。对于需要绝对实时的业务场景,用的比较多的是Storm,对于其他准实时的业务场景,可以是Storm,也可以是Spark Streaming。当然,如果可以的话,也可以自己写程序来做。

 

8.1 Storm

 

1. 什么是Storm?有哪些可能的应用场景?
2. Storm由哪些核心组件构成,各自担任什么角色?
3. Storm的简单安装和部署。
4. 自己编写Demo程序,使用Storm完成实时数据流计算。

 

8.2 Spark Streaming

 

1. 什么是Spark Streaming,它和Spark是什么关系?
2. Spark Streaming和Storm比较,各有什么优缺点?
3. 使用Kafka + Spark Streaming,完成实时计算的Demo程序。

 

如果你认真完成了上面的学习和实践,此时,你的”大数据平台”应该是这样的:

 

 

至此,你的大数据平台底层架构已经成型了,其中包括了数据采集、数据存储与计算(离线和实时)、数据同步、任务调度与监控这几大模块。接下来是时候考虑如何更好的对外提供数据了。

 

第九章:我的数据要对外

 

通常对外(业务)提供数据访问,大体上包含以下方面:

 

离线:比如,每天将前一天的数据提供到指定的数据源(DB、FILE、FTP)等;

离线数据的提供可以采用Sqoop、DataX等离线数据交换工具。

实时:比如,在线网站的推荐系统,需要实时从数据平台中获取给用户的推荐数据,这种要求延时非常低(50毫秒以内)。

 

根据延时要求和实时数据的查询需要,可能的方案有:HBase、Redis、MongoDB、ElasticSearch等。

 

OLAP分析:OLAP除了要求底层的数据模型比较规范,另外,对查询的响应速度要求也越来越高,可能的方案有:Impala、Presto、SparkSQL、Kylin。如果你的数据模型比较规模,那么Kylin是最好的选择。

 

即席查询:即席查询的数据比较随意,一般很难建立通用的数据模型,因此可能的方案有:Impala、Presto、SparkSQL。

 

这么多比较成熟的框架和方案,需要结合自己的业务需求及数据平台技术架构,选择合适

的。原则只有一个:越简单越稳定的,就是最好的。

 

如果你已经掌握了如何很好的对外(业务)提供数据,那么你的“大数据平台”应该是这样的:

 

 

第十章:牛逼高大上的机器学习

 

关于这块,我这个门外汉也只能是简单介绍一下了。数学专业毕业的我非常惭愧,很后悔当时没有好好学数学。

 

在我们的业务中,遇到的能用机器学习解决的问题大概这么三类:

 

  • 分类问题:包括二分类和多分类,二分类就是解决了预测的问题,就像预测一封邮件是否垃圾邮件;多分类解决的是文本的分类;

  • 聚类问题:从用户搜索过的关键词,对用户进行大概的归类。

  • 推荐问题:根据用户的历史浏览和点击行为进行相关推荐。

 

大多数行业,使用机器学习解决的,也就是这几类问题。

入门学习线路:

 

数学基础;

 

机器学习实战(Machine Learning in Action),懂Python最好;

SparkMlLib提供了一些封装好的算法,以及特征处理、特征选择的方法。

机器学习确实牛逼高大上,也是我学习的目标。

那么,可以把机器学习部分也加进你的“大数据平台”了。

发布了160 篇原创文章 · 获赞 2 · 访问量 1万+

Guess you like

Origin blog.csdn.net/mnbvxiaoxin/article/details/104607273