# 簡介

因為工作需求，所以開始透過觀看[Youtube Hadoop 教學系列](https://www.youtube.com/playlist?list=PLSGSXGjRyTbYD4KAaeA9At8PlHxSJTsev)自學Hadoop，後來又看了Spark跟Sqoop。但是Hadoop有太多功能，架設每個功能又有太多配置檔，所以寫給筆記方便自己以後複習。

## Hadoop各項功能應用簡介

### HDFS

分散式儲存檔案架構，用來存取分散式資料以及分散式運算所需檔案

### Map Reduce

一種分散式運算，但由於在運算時對硬碟有大量IO，所以被Spark取代，但是Sqoop在匯入資料時還是會應用它。

### Hive

一種將資料存放在HDFS上的Sql資料庫，可使用分散式運算

### HBase

一種將資料存放在HDFS上的No Sql資料庫，可使用分散式運算

### Spark

一種分散式運算，會將運算資料Cache在記憶體，所以會比Map Reduce快10到100倍

### Sqoop

一種工具，方便開發人員把其他資料庫的資料匯入到Hive或HBase

## 應用情境

### 分析大數據

目前測試7千萬多筆的資料，資料大小約8G，光透過MySql Count Function運算資料總數就快要三分鐘多。如果T大小等級的資料加上更複雜的運算式，當然耗的時間又更多，跑一個分析數據可能從好幾小時到好幾天。\
\
所以要加快分析資料的時間，那當然就必須要將這些資料分析的作業分工。這不代表每一台Spark Work運算的比Mysql快，是他可以有很多Spark Worker來處理一個分工。\
\
開發人員可以透過Sqoop將MySql資料匯出到Hive，在Hive透過對資料下分析的Hql指令，透過Spark做分工處理，並將結果存在另外一個Hive Table，最後在透過Sqoop匯回到MySql。<br>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://shark.gitbook.io/hadoop/master.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
