您好,登錄后才能下訂單哦!
今天給大家介紹一下如何快速部署體驗實時數據流計算。文章的內容小編覺得不錯,現在給大家分享一下,覺得有需要的朋友可以了解一下,希望對大家有所幫助,下面跟著小編的思路一起來閱讀吧。
說明:all in one是一個單機版本dbus環境,是給用戶快速體驗dbus的功能,只是一個簡單體驗版,不能用于其它環境或者用途,具體包括如下:
1)基礎組建:
zookeeper 3.4.6
kafka 0.10.0.0
storm 1.0.1
granfana 4.2.0
logstash 5.6.1
influxdb (需要單獨安裝, 參考如下步驟3)
mysql (需要單獨安裝,參考如下步驟2)
2)dbus相關包:
dbus-keeper 0.5.0
dbus-stream-main 0.5.0
dbus-router 0.5.0
dbus-heartbeat 0.5.0
dbus-log-processor 0.5.0
3)mysql數據源所需:
canal
安裝dbus-allinone環境的建議配置如下
JDK 1.8.181 或 以上
CPU 2核 或以上
內存 16GB或以上
磁盤 20GB或以上
注:一臺Linux centos服務器, 該服務器最好是空機器,上面不要安裝dbus所依賴的zk,kafka,storm等
注:ip是您的具體ip,這里用192.168.0.1為例子
修改服務器/etc/hosts文件設置相應的域名信息如下:
192.168.0.1 dbus-n1
修改服務器hostname命令如下:
hostname dbus-n1
配置好后,服務器IP和域名信息如下:
由于dbus啟動拓撲采用的ssh調用storm命令,all in one包中默認的調用ssh使用app用戶和22端口,因此要正常體驗all in one需要創建app賬戶和配置ssh免密登錄,免密登錄配置的從dbus-n1到dbus-n1的免密登錄
配置完成后執行如下命令看時候配置成功
[app@dbus-n1 ~]$ ssh -p 22 app@dbus-n1 Last login: Fri Aug 10 15:54:45 2018 from 10.10.169.53 [app@dbus-n1 ~]$
推薦下載Mysql版本:5.7.19 地址:https://dev.mysql.com/downloads/mysql/
解壓mysql-5.7.19-1.el6.x86_64.rpm-bundle.tar包后,執行以下命令安裝:
rpm -ivh mysql-community-server-5.7.19-1.el6.x86_64.rpm --nodeps rpm -ivh mysql-community-client-5.7.19-1.el6.x86_64.rpm --nodeps rpm -ivh mysql-community-libs-5.7.19-1.el6.x86_64.rpm --nodeps rpm -ivh mysql-community-common-5.7.19-1.el6.x86_64.rpm --nodeps rpm -ivh mysql-community-libs-compat-5.7.19-1.el6.x86_64.rpm --nodeps
在/etc/my.cnf配置文件中,只是增加bin-log相關配置,其他不用修改,關注以下漢字注釋部分
[mysqld] # dbus相關配置開始 log-bin=mysql-bin binlog-format=ROW server_id=1 # dbus相關配置結束
執行以下命令啟動mysql:
service mysqld start
推薦下載InfluxDB版本:influxdb-1.1.0.x86_64 地址:https://portal.influxdata.com/downloads
在dbus-n1上切換到root用戶,在influxdb-1.1.0.x86_64.rpm的存放目錄下執行如下命令:
rpm -ivh influxdb-1.1.0.x86_64.rpm
在dbus-n1上執行如下命令:
service influxdb start
在dbus-n1上執行如下命令:
#登錄influx influx #執行初始化腳本 create database dbus_stat_db use dbus_stat_db CREATE USER "dbus" WITH PASSWORD 'dbus!@#123' ALTER RETENTION POLICY autogen ON dbus_stat_db DURATION 15d
在百度網盤提供dbus-allinone.tar.gz 包,訪問 release 頁面下載最新包:https://github.com/BriData/DBus/releases
將下載的dbus-allinone包上傳到服務器 /app目錄下,且必須在此目錄下
# 如果沒有app目錄,要先創建app目錄 mkdir /app cd /app tar -zxvf dbus-allinone.tar.gz
以root身份登錄mysql客戶端,執行以下命令進行數據庫初始化,會創建dbmgr庫以及用戶、canal用戶、dbus庫以及用戶、testschema庫以及用戶:
source /app/dbus-allinone/sql/init.sql
執行start.sh一鍵啟動dbus所有服務,啟動項比較多。
cd /app/dbus-allinone ./start.sh
請耐心等待(大概需要5分鐘左右時間),正確的啟動日志如下:
Start grafana... Grafana started. pid: 23760 ============================================================================================= Start zookeeper... zookeeper pid 23818 Zookeeper started. ============================================================================================= Start kafka... No kafka server to stop kafka pid 24055 kafka started. ============================================================================================= Start Canal ... canal started. ============================================================================================= Start logstash... No logstash to stop nohup: appending output to `nohup.out' logstash pid 24151 logstash started. ============================================================================================= Start storm nimbus... No storm nimbus to stop Storm nimbus pid 24215 Storm nimbus started. ============================================================================================= Start storm supervisor... No storm supervisor to stop Storm supervisor pid 24674 Storm supervisor started. ============================================================================================= Start storm ui... No storm ui to stop Storm ui pid 24939 Storm ui started. ui port: 6672 ============================================================================================= Stop storm topology. Storm topology stoped. ============================================================================================= Start storm topology... Storm topology started. ============================================================================================= Start Dbus Heartbeat... No Dbus Heartbeat to stop Dbus Heartbeat pid 26854 Dbus Heartbeat started. ============================================================================================= Start Dbus keeper... =========================stop=========================== keeper-proxy process not exist gateway process not exist keeper-mgr process not exist keeper-service process not exist register-server process not exist =========================start=========================== register-server started. pid: 27077 keeper-proxy started. pid: 27172 gateway started. pid: 27267 keeper-mgr started. pid: 27504 keeper-service started. pid: 27645 Dbus keeper prot: 6090 Dbus keeper started. =============================================================================================
進入目錄/app/dbus-allinone/allinone-auto-check-0.5.0,執行自動檢測腳本auto-check.sh,稍等待一會兒
cd /app/dbus-allinone/allinone-auto-check-0.5.0 ./auto-check.sh
會在目錄/app/dbus-allinone/allinone-auto-check-0.5.0/reports下生產對應時間的檢查報告,如下所示
[app@dbus-n1 reports]$ tree . └── 20180824111905 └── check_report.txt
打開check_report.txt文件查看相應的檢查報告,如下所示
(注意以#開頭為解釋說明信息,報告中不會生成 )
# 出現以下信息說明dbusmgr庫正常 check db&user dbusmgr start: ============================================ table t_avro_schema data count: 0 table t_data_schema data count: 4 table t_data_tables data count: 4 table t_dbus_datasource data count: 2 table t_ddl_event data count: 0 table t_encode_columns data count: 0 table t_encode_plugins data count: 1 table t_fullpull_history data count: 0 table t_meta_version data count: 5 table t_plain_log_rule_group data count: 1 table t_plain_log_rule_group_version data count: 1 table t_plain_log_rule_type data count: 0 table t_plain_log_rules data count: 5 table t_plain_log_rules_version data count: 5 table t_project data count: 1 table t_project_encode_hint data count: 1 table t_project_resource data count: 1 table t_project_sink data count: 1 table t_project_topo data count: 1 table t_project_topo_table data count: 1 table t_project_topo_table_encode_output_columns data count: 1 table t_project_topo_table_meta_version data count: 0 table t_project_user data count: 1 table t_query_rule_group data count: 0 table t_sink data count: 1 table t_storm_topology data count: 0 table t_table_action data count: 0 table t_table_meta data count: 7 table t_user data count: 2 # 出現以下信息說明dbus庫正常 check db&user dbus start: ============================================ table db_heartbeat_monitor data count: 15 table test_table data count: 0 table db_full_pull_requests data count: 0 # 出現以下信息說明canal用戶正常 check db&user canal start: ============================================ master status File:mysql-bin.000002, Position:12047338 table db_heartbeat_monitor data count: 15 table test_table data count: 0 table db_full_pull_requests data count: 0 # 出現以下信息說明testschema庫正常 check db&user testschema start: ============================================ table test_table data count: 0 # 出現以下信息說明zk啟動正常 check base component zookeeper start: ============================================ 23818 org.apache.zookeeper.server.quorum.QuorumPeerMain # 出現以下信息說明kafka啟動正常 check base component kafka start: ============================================ 24055 kafka.Kafka # 出現以下信息說明storm nimbus、supervisor、ui 啟動正常 check base component storm start: ============================================ 26500 org.apache.storm.daemon.worker 25929 org.apache.storm.daemon.worker 27596 org.apache.storm.LogWriter 26258 org.apache.storm.LogWriter 24215 org.apache.storm.daemon.nimbus 27035 org.apache.storm.LogWriter 27611 org.apache.storm.daemon.worker 26272 org.apache.storm.daemon.worker 24674 org.apache.storm.daemon.supervisor 24939 org.apache.storm.ui.core 26486 org.apache.storm.LogWriter 27064 org.apache.storm.daemon.worker 25915 org.apache.storm.LogWriter # 出現以下信息說明influxdb 啟動正常 check base component influxdb start: ============================================ influxdb 10265 1 0 Aug08 ? 02:28:06 /usr/bin/influxd -pidfile /var/run/influxdb/influxd.pid -config /etc/influxdb/influxdb.conf app 28823 28746 0 11:19 pts/3 00:00:00 /bin/sh -c ps -ef | grep influxdb app 28827 28823 0 11:19 pts/3 00:00:00 grep influxdb # 出現以下信息說明grafana 啟動正常 check base component grafana start: ============================================ app 23760 1 0 11:09 pts/3 00:00:00 ./grafana-server app 28828 28746 0 11:19 pts/3 00:00:00 /bin/sh -c ps -ef | grep grafana app 28832 28828 0 11:19 pts/3 00:00:00 grep grafana # 出現以下信息說明心跳heartbeat 啟動正常 check base component heartbeat start: ============================================ 26854 com.creditease.dbus.heartbeat.start.Start # 出現以下信息說明logstash 啟動正常 check base component logstash start: ============================================ 24151 org.jruby.Main # 出現以下信息說明canal 啟動正常 check canal start: ============================================ zk path [/DBus/Canal/otter-testdb] exists. 24105 com.alibaba.otter.canal.deployer.CanalLauncher # 出現以下信息說明dispatcher-appender、mysql-extractor、splitter-puller、router 啟動正常 check topology start: ============================================ api: http://dbus-n1:6672/api/v1/topology/summary topology testlog-log-processor status is ACTIVE topology testdb-mysql-extractor status is ACTIVE topology testdb-splitter-puller status is ACTIVE topology testdb-dispatcher-appender status is ACTIVE topology tr-router status is ACTIVE # 出現以下信息說明從數據庫->extractor-dispatcher->appender線路正常 check flow line start: ============================================ first step insert heart beat success. data arrive at topic: testdb data arrive at topic: testdb.testschema data arrive at topic: testdb.testschema.result
需要在通過瀏覽器登錄grafana的機器配置host文件,如果已經配置過請跳過此前提
如果驗證機器是windows系統,修改C:\Windows\System32\drivers\etc\hosts文件設置相應的域名信息如下:
# 192.168.0.1 替換成部署allinone包的服務器ip地址 192.168.0.1 dbus-n1
如果驗證機器是linux系統,修改/etc/hosts文件設置相應的域名信息如下:
# 192.168.0.1 替換成部署allinone包的服務器ip地址 192.168.0.1 dbus-n1
登錄grafana url地址: http://dbus-n1:3000/login
#登錄測試用戶 mysql -utestschema -p #testschema賬戶密碼:j0<C6cqcqr:TestSchema #執行測試腳本 use testschema; INSERT INTO test_table (NAME, BIRTHDAY) VALUES ('testdataname', '2018-08-10 18:00:00'); INSERT INTO test_table (NAME, BIRTHDAY) VALUES ('testdataname', '2018-08-10 18:00:00'); INSERT INTO test_table (NAME, BIRTHDAY) VALUES ('testdataname', '2018-08-10 18:00:00'); INSERT INTO test_table (NAME, BIRTHDAY) VALUES ('testdataname', '2018-08-10 18:00:00'); INSERT INTO test_table (NAME, BIRTHDAY) VALUES ('testdataname', '2018-08-10 18:00:00');
dbus-heartbeat心跳模塊兒產生日志位置在:/app/dbus-allinone/dbus-heartbeat-0.5.0/logs/heartbeat/heartbeat.log,利用logstash抽取該日志文件,把非結構化的數據,提取成結構化的數據
通過如下命令,查看要提取的非結構化數據,如下圖所示,每一分鐘產生3條包含"插入心跳包成功"的日志
cd /app/dbus-allinone/dbus-heartbeat-0.5.0/logs/heartbeat/ tail -f heartbeat.log | grep "插入心跳包成功"
提取規則如下圖:
規則執行后結果
選擇log table deatil board
選擇table:testlog.testlog_schema.t_heartbeat_data
需要在通過瀏覽器登錄dbus keeper的機器配置host文件,如果已經配置過請跳過此前提
如果驗證機器是windows系統,修改C:\Windows\System32\drivers\etc\hosts文件設置相應的域名信息如下:
# 192.168.0.1 替換成部署allinone包的服務器ip地址 192.168.0.1 dbus-n1
如果驗證機器是linux系統,修改/etc/hosts文件設置相應的域名信息如下:
# 192.168.0.1 替換成部署allinone包的服務器ip地址 192.168.0.1 dbus-n1
登錄dbus keeper url地址:http://dbus-n1:6090/login
體驗管理員功能,請使用用戶:admin 密碼:12345678
管理員界面如下:
體驗租戶功能,請使用用戶:user@dbus.com 密碼:12345678
租戶界面如下:
以上就是如何快速部署體驗實時數據流計算的全部內容了,更多與如何快速部署體驗實時數據流計算相關的內容可以搜索億速云之前的文章或者瀏覽下面的文章進行學習哈!相信小編會給大家增添更多知識,希望大家能夠支持一下億速云!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。