1. 程式人生 > >搭建zookeeper-Kafka-Storm訊息系統

搭建zookeeper-Kafka-Storm訊息系統

1.搭建zookeeper

  • 2.解壓,linux命令:
    sudo tar -zxvf zookeeper-3.4.3.tar.gz
  • 3.配置環境變數 ,linux命令:vi ~/.bashrc ,新增ZOOKEEPER_HOME
export JAVA_HOME=/usr/java/jdk1.8.0_60

export ZOOKEEPER_HOME=/opt/software/zookeeper-3.4.6

export STORM_HOMW=/opt/software/apache-storm-0.9.5
export PATH=$JAVA_HOME/bin:$ZOOKEEPER_HOME/bin:$STORM_HOME
/bin:$PATH
  • 4.conf設定,dataDir、clientPort、最下面的server注意下.
    記得手動建立Dir的目錄,不然會啟動失敗。
[[email protected] conf]# cat zoo.cfg 
# The number of milliseconds of each tick
tickTime=2000
# The number of ticks that the initial 
# synchronization phase can take
initLimit=10
# The number of ticks that can pass between 
# sending a request and getting an acknowledgement syncLimit=5 # the directory where the snapshot is stored. # do not use /tmp for storage, /tmp here is just # example sakes. dataDir=/var/zookeeper/data # the port at which the clients will connect clientPort=2181 # the maximum number of client connections.
# increase this if you need to handle more clients #maxClientCnxns=60 # # Be sure to read the maintenance section of the # administrator guide before turning on autopurge. # # http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance # # The number of snapshots to retain in dataDir #autopurge.snapRetainCount=3 # Purge task interval in hours # Set to "0" to disable auto purge feature #autopurge.purgeInterval=1 server.1=192.168.3.160:2888:3888 server.2=192.168.3.161:2888:3888 server.3=192.168.3.162:2888:3888
  • 5.常用命令
    zookeeper-3.4.6/bin/zkServer.sh {start|start-foreground|stop|restart|status|upgrade|print-cmd}
    先start之後,status檢視狀態
[[email protected] zookeeper-3.4.6]# bin/zkServer.sh start
JMX enabled by default
Using config: /opt/software/zookeeper-3.4.6/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED

[[email protected] software]# zookeeper-3.4.6/bin/zkServer.sh status
JMX enabled by default
Using config: /opt/software/zookeeper-3.4.6/bin/../conf/zoo.cfg
Mode: standalone

[[email protected] zookeeper-3.4.6]# bin/zkServer.sh stop
JMX enabled by default
Using config: /opt/software/zookeeper-3.4.6/bin/../conf/zoo.cfg
Stopping zookeeper ... STOPPED

2.Kafka搭建

  • 2.解壓,linux命令:
    sudo tar -zxvf kafka_2.11-0.8.2.2.tgz
  • 3.conf設定,注意host.name=192.168.3.160,zookeeper.connect=192.168.3.163:2181
...
############################# Server Basics #############################

# The id of the broker. This must be set to a unique integer for each broker.
broker.id=0

############################# Socket Server Settings #############################

# The port the socket server listens on
port=9092

# Hostname the broker will bind to. If not set, the server will bind to all interfaces
host.name=192.168.3.160

...
############################# Zookeeper #############################

# Zookeeper connection string (see zookeeper docs for details).
# This is a comma separated host:port pairs, each corresponding to a zk
# server. e.g. "127.0.0.1:3000,127.0.0.1:3001,127.0.0.1:3002".
# You can also append an optional chroot string to the urls to specify the
# root directory for all kafka znodes.
zookeeper.connect=192.168.3.163:2181

# Timeout in ms for connecting to zookeeper
zookeeper.connection.timeout.ms=6000
  • 4.啟動kafka server: nohup bin/kafka-server-start.sh config/server.properties >/dev/null 2>&1 &
    此命令忽略hangup可以在遠端連線關閉後繼續執行。

kafka叢集的多個broke連線到同一個zookeeper,生產者往一個broke傳送訊息,消費者從zookeeper獲得訂閱。

3.Storm搭建

# 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
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

########### These MUST be filled in for a storm configuration
# storm.zookeeper.servers:
#     - "server1"
#     - "server2"
storm.zookeeper.servers:
  - "192.168.3.161"

storm.zookeeper.port: 2181

#
# nimbus.host: "nimbus"
#
nimbus.host: "192.168.3.160"
nimbus.childopts: -Xmx1024m -Djava.net.preferIPv4Stack=true

ui.childopts: -Xmx768m -Djava.net.preferIPv4Stack=true

ui.host: 0.0.0.0
ui.port: 8080

supervisor.childopts: -Djava.net.preferIPv4Stack=true
worker.childopts: -Xmx768m -Dfile.encoding=utf-8 -Djava.net.preferIPv4Stack=true

supervisor.slots.ports:
  - 6700
  - 6701
  - 6702
  - 6703

storm.local.dir: /data/cluster/storm

storm.log.dir: /data/cluster/storm/logs

logviewer.port: 8000
#
# ##### These may optionally be filled in:
#
## List of custom serializations
# topology.kryo.register:
#     - org.mycompany.MyType
#     - org.mycompany.MyType2: org.mycompany.MyType2Serializer
#
## List of custom kryo decorators
# topology.kryo.decorators:
#     - org.mycompany.MyDecorator
#
## Locations of the drpc servers
# drpc.servers:
#     - "server1"
#     - "server2"
drpc.servers:
  - "192.168.3.160"

## Metrics Consumers
# topology.metrics.consumer.register:
#   - class: "backtype.storm.metric.LoggingMetricsConsumer"
#     parallelism.hint: 1
#   - class: "org.mycompany.MyMetricsConsumer"
#     parallelism.hint: 1
#     argument:
#       - endpoint: "metrics-collector.mycompany.org"

supervisor.slots.ports: 對於每個Supervisor工作節點,需要配置該工作節點可以執行的worker數量。每個worker佔用一個單獨的埠用於接收訊息,該配置選項即用於定義哪些埠是可被worker使用的。預設情況下,每個節點上可執行4個workers,分別在6700、6701、6702和6703埠.

  • 4.常用命令
# bin/storm nimbus < /dev/null 2<&1 &
# bin/storm supervisor < /dev/null 2<&1 &
# bin/storm ui < /dev/null 2<&1 &
#
#bin/storm jar storm-demo-1.0.jar io.sterm.demo.topology.WordCountTopology
#bin/storm kill word-count
  • 啟動nimbus後臺執行:bin/storm nimbus < /dev/null 2<&1 &
  • 啟動supervisor後臺執行:bin/storm supervisor < /dev/null 2<&1 &
  • 啟動ui後臺執行:bin/storm ui < /dev/null 2<&1 &

相關推薦

搭建zookeeper-Kafka-Storm訊息系統

1.搭建zookeeper 2.解壓,linux命令: sudo tar -zxvf zookeeper-3.4.3.tar.gz 3.配置環境變數 ,linux命令:vi ~/.bashrc ,新增ZOOKEEPER_HOME export J

淺談實時流平臺Kafka訊息系統設計

文章目錄 Kafka解決什麼問題? Kafka的流處理 Kafka如何實現負載均衡Load balancing Kafka的資料單位是什麼?怎麼傳輸? 消費者如何解析生產者的訊息? 如何保證一個pa

快速搭建 Zookeeper+Kafka 高可用叢集環境

1、概念和方案 本文只介紹快速的搭建方案,不囉嗦哈。搭建方案圖,如下: Zookeeper獨立3臺叢集(根據專案情況擴充套件),一臺為leader,其他為follower。 Kafka為多節點多br

KAFKA分散式訊息系統

Kafka[1]是linkedin用於日誌處理的分散式訊息佇列,linkedin的日誌資料容量大,但對可靠性要求不高,其日誌資料主要包括使用者行為(登入、瀏覽、點選、分享、喜歡)以及系統執行日誌(CPU、記憶體、磁碟、網路、系統及程序狀態)。 當前很多的訊息佇列服務提供可靠交付保證,並預設是即時消費(不適

什麼是Kafka——分散式訊息系統

What’s is Kafka: Apache Kafka是分散式釋出-訂閱訊息系統。他最初由Linkedln公司開發,之後成為Apache專案的一部分。Kafka是一種快速,可拓展的,設計內在就是分散式的,分割槽的和可複製的提交日誌服務 Apache Kaf

【技術世界】分享大資料領域技術、包括但不限於Storm、Spark、Hadoop等分散式計算系統Kafka、MetaQ等分散式訊息系統, MongoDB等NoSQL,PostgreSQL等RDBMS,SQL優

技術世界 分享大資料領域技術、包括但不限於Storm、Spark、Hadoop等分散式計算系統,Kafka、MetaQ等分散式訊息系統, MongoDB等NoSQL,PostgreSQL等RDBMS,SQL優...

基於flume+kafka+storm日誌收集系統搭建

基於flume+kafka+storm日誌收集系統搭建 1.     環境 192.168.0.2 hadoop1 192.168.0.3 hadoop2 192.168.0.4 hadoop3 已經

flume-ng+Kafka+Storm+HDFS 實時系統搭建

今天搭建了一下storm流處理系統,整個搭建的流程都是參考以下地址:http://www.cnblogs.com/web-v/articles/6510090.html 文章中並沒有給出flume同時寫入kafka和hdfs時的配置檔案。以下是我的flume配置檔案,有一些

【Twitter Storm系列】flume-ng+Kafka+Storm+HDFS 實時系統搭建

技術交流群:59701880 深圳廣州hadoop好友會微信公眾號:後續部落格的文件都會轉到微信公眾號中。一直以來都想接觸Storm實時計算這塊的東西,最近在群裡看到上海一哥們羅寶寫的Flume+Kafka+Storm的實時日誌流系統的搭建文件,自己也跟著整了一遍,之前羅寶的

flume-ng+Kafka+Storm+HDFS+jdbc 實時系統搭建的完美整合

一直以來都想接觸Storm實時計算這塊的東西,最近在群裡看到上海一哥們羅寶寫的Flume+Kafka+Storm的實時日誌流系統的搭建文件,自己也跟著整了一遍,之前羅寶的文章中有一些要注意點沒提到的,以後一些寫錯的點,在這邊我會做修正;內容應該說絕大部分引用羅寶的文章的,這裡要謝謝羅寶兄弟,還有寫這篇文章@

Flume+Kafka+Storm+Redis構建大數據實時處理系統:實時統計網站PV、UV+展示

大數據 實時計算 Storm [TOC] 1 大數據處理的常用方法 前面在我的另一篇文章中《大數據采集、清洗、處理:使用MapReduce進行離線數據分析完整案例》中已經有提及到,這裏依然給出下面的圖示: 前面給出的那篇文章是基於MapReduce的離線數據分析案例,其通過對網站產生的用戶訪問

Java高級互聯網架構師系統培訓班課程(nginx+redis+zookeeper+activemq+storm+dubbo+netty+jvm+並發編程鎖+項目實戰)

.... queue 多線程通信 ket targe gin per 17. 同步類容器 百度網盤下載 課程目錄分布式項目實戰所有視頻(分布式項目視頻所有的放在一起)分布式實戰項目1.mp4分布式實戰項目2.mp4分布式實戰項目3.mp4分布式實戰項目4.mp4分布式實戰項

Kafka-API中介軟體MQ訊息佇列在Maven專案中的配置使用操作 (分散式釋出訂閱訊息系統)

一、 Maven依賴 <dependency> <groupId>com.foriseland.fjf.mq</groupId> <artifactId>fjf-mq-kafka</artifactId> &

ELK 環境搭建1-zookeeper+kafka

新版kafka組消費命令: /application/elk/kafka/bin/kafka-console-consumer.sh --bootstrap-server 192.168.30.41:9092,192.168.30.42:9092,192.168.30.43:9092 --topic tes

從0到1搭建基於Kafka、Flume和Hive的海量資料分析系統(一)資料收集應用

大資料時代,一大技術特徵是對海量資料採集、儲存和分析的多元件解決方案。而其中對來自於感測器、APP的SDK和各類網際網路應用的原生日誌資料的採集儲存則是基本中的基本。本系列文章將從0到1,概述一下搭建基於Kafka、Flume、Zookeeper、HDFS、Hive的海量資料分析系統的框架、核心應用和關鍵模組

Zookeeper叢集搭建Kafka叢集的搭建

Zookeeper!!! 一、Zookeeper叢集搭建步驟 0)叢集規劃 在hadoop01、hadoop02和hadoop03三個節點上部署Zookeeper。 1)解壓安裝 (1)解壓zookeeper安裝包到/home/hadoop/insatll/目錄下 [[email 

分散式釋出訂閱訊息系統Kafka

文章目錄 Kafka概述 Kafka架構及核心概念 Kafka單節點單Broker部署之Zookeeper安裝 單節點單Broker部署 單節點多Broker部署及使用 Kafka容錯性測試

Ubuntu虛擬機器 Zookeeper+Kafka叢集搭建

機器和環境 三臺ubuntu 16.04 64bit ip地址 zookeeper主從 kafka broker id 172.16.227.128 follower 1 172.1

Flume+Kafka+Storm+Redis實時分析系統基本架構

今天作者要在這裡通過一個簡單的電商網站訂單實時分析系統和大家一起梳理一下大資料環境下的實時分析系統的架構模型。當然這個架構模型只是實時分析技術的一 個簡單的入門級架構,實際生產環境中的大資料實時分析技術還涉及到很多細節的處理, 比如使用Storm的ACK機制保證資料都能被正確處理, 叢集的高可用架構