-
Grouping方式
查看全部 -
環境搭建:
1.下載安裝zookeeper
2.生成一個新的配置文件 zoo.cfg
3.修改配置文件:vi zookeeper-3.4.6/conf/zoo.cfg
添加以下內容:
tickTime=2000
dataDir=/Users/dev/zookeeper-3.4.6/data
clientPort=2181
4.進入zookeeper目錄: cd zookeeper-3.4.6
5.啟動zookeeper服務: sh bin/zkServer.sh start
6.查看運行狀態:echo stat | nc 127.0.0.1 2181
zookeeper集群版配置:
1.生成zoo.cfg.cluster文件,vi zoo.cfg.cluster
內容如下:
tickTime=2000
dataDir=/Users/dev/zookeeper-3.4.6/data
clientPort=2181
server.1=xx.xx.xx.xx:2182
server.2=xx.xx.xx.xx:2182
server.3=xx.xx.xx.xx:2182
syncLimit=2
initLimit=5
2.創建新文件 vi myid
內容如下:
1
3.在每臺安裝zookeeper的機器上啟動服務即可
啟動storm
1.進入storm文件:cd apache-storm-0.9.5
2.啟動storm服務:
nohup bin/storm nimbus &
nohup bin/storm supervisor &
nohup bin/storm ui &
3.訪問:http://localhost:8080/index.html
4.集群模式下,需要更改配置文件 vi conf/storm.yaml, 修改zk配置
提交一個jar包到storm:
1.查看文件:ls examples/storm-starter/
2.提交jar: ./bin/storm jar examples/storm-starter/storm-starter-topologies-0.9.5.jar storm.starter.WordCountTopology wordcount
3.訪問http://localhost:8080/index.html 就能看到
4.關閉命令:./bin/storm kill wordcount
查看全部 -
數據可靠性:
Nimbus掛掉,換臺機器重啟就可
supervisor掛掉,將上面的worker遷移走就可以
worker掛掉,利用ack機制保證數據未處理成功,會通知spout重新發送.需要對記錄通過msgId進行去重.也就是spout發送tuple時指定msgId,
spout也掛掉: 可以將數據記錄到外部存儲,設置checkpoint。查看全部 -
task數邏輯數,就是前面設置的.setNumTasks(7)<br>
worker是進程數
executor是表示線程數查看全部 -
循環運行了100次,而且有7個并發,所有每個單詞的數量都是700的倍數
查看全部 -
Spout繼承BaseRichSpout 并包含幾個方法(聲明字段、初始化、數據讀取和輸出)
Spout中 nextTuple方法:隨機讀取String sentence中的句子通過_collector.emit(next)發送給下游查看全部 -
grouping:
隨機發送
按一定規則發送
strom: kafka-->數據源結點spout多個(數據來源,發送一個個Tuple給到bolt,同樣的Tuple會發到同樣的bolt),普通計算結點bolt(可調用其它語言腳本,如java,python)多個(計算完可以持久化到數據庫),數據流stream,記錄Tuple。
Hdfs: Mapper從hdfs中讀取數據并計算,進行整理后(同一個word一定落到同一個reduce里)發送給reduce-再發送給hdfs查看全部 -
$ cd apache-storm-0.9.5
$ cd examples/storm-starter/
$ mv test
$ mvn exec:java "-Dstorm.topology=storm.starter.WordCountTopology"
查看全部 -
storm作業提交運行流程
1.用戶編寫storm Topolgy(wordCountTopology) 一個用戶作業
2.使用client提交Topolgy給nimbus
3.nimbus提派Task給supervisor
4.supervisor為task啟動worker
5.worker執行task
--------------------------
storm采用主從結構,主Nimbus和多個從Supervisor,Nimbus只負責管理性的工作單點問題必須保證主節點是無狀態的,重啟就能恢復,相關元數據配置信息都是存儲在zookeeper上。Supervisor主要聽Nimbus的話管理啟動和監控worker, worker是真正干活的進程負責數據傳輸和計算.
-------------------------------
Storm 主從結構
Nimbus 主節點,只負責整體分配工作,不具體干活
Supervisor 從節點,維護每臺機器,直接管理干活的Worker
Worker ?真正干活的(task)進程,數據計算和傳輸
DRPC ?
Storm UI 監控WEB
運行流程
用戶編寫作業
使用客戶端提交給Nimbus
Nimbus指派Task給Supervisor
Supervisor 為task啟動Worker
Worker 執行Task查看全部 -
Google發明的幾篇論文解決了各個公司升級服務器的弊端,
分布式框架三篇論文;
? ?google file system
? ?bigTable
? ?MapReduce
流式計算和批量計算:
目前有些人希望通過同一API解決批量計算和流式計算:
Summer bird
Clouddataflow? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 批量計算 ? ? ? ? ? ? ? ? ? ? 流式計算
數據到達 ? ? ? 計算開始前數據已準備好 ? ? ? ? ? 計算進行中數據持續到來
計算周期 ? ? ? 計算完成后會結束計算 ? ? ? ? ? ? 一般會作為服務持續運行
使用場景 ? ? ? 時效性要求低的場景 ? ? ? ? ? ? ? 時效性要求高的場景查看全部 -
storm走也提交運行流程
查看全部 -
huh查看全部
-
Storm主從結構
查看全部 -
批量計算與流式計算的區別
查看全部 -
我的筆記test13我的筆記test13我的筆記test13我的筆記test13我的筆記test13
我的筆記test13我的筆記test13我的筆記test13我的筆記test13我的筆記test13我的筆記test13我的筆記test13我的筆記test13我的筆記test13我的筆記test13我的筆記test13我的筆記test13
我的筆記test13我的筆記test13我的筆記test13我的筆記test13我的筆記test13我的筆記test13我的筆記test13我的筆記test13我的筆記test13我的筆記test13我的筆記test13我的筆記test13
我的筆記test13我的筆記test13我的筆記test13我的筆記test13我的筆記test13我的筆記test13我的筆記test13我的筆記test13我的筆記test13我的筆記test13我的筆記test13我的筆記test13
我的筆記test13我的筆記test13我的筆記test13我的筆記test13我的筆記test13我的筆記test13我的筆記test13我的筆記test13我的筆記test13我的筆記test13我的筆記test13我的筆記test13我的筆記test13我的筆記test13我的筆記test13我的筆記test13我的筆記test13我的筆記test13我的筆記test13我的筆記test13我的筆記test13我的筆記test13我的筆記test13我的筆記test13我的筆記test13我的筆記test13我的筆記test13我的筆記test13我的筆記test13我的筆記test13我的筆記test13我的筆記test13我的筆記test13我的筆記test13我的筆記test13我的筆記test13我的筆記test13
查看全部 -
我的筆記test13
查看全部 -
我的筆記test12
查看全部 -
我的筆記test11
查看全部 -
我的筆記test10
查看全部
舉報