一、StreamPark簡介
StreamPark(原StreamX)是一個流處理應(yīng)用程序開發(fā)管理框架。初衷是讓流處理更簡單,旨在輕松構(gòu)建和管理流處理應(yīng)用程序,提供使用 Apache Flink 和 Apache Spark 編寫流處理應(yīng)用程序的開發(fā)框架,未來將支持更多其他引擎。同時,StreamPark 提供了一個流處理應(yīng)用管理平臺,核心能力包括但不限于應(yīng)用開發(fā)、調(diào)試、交互查詢、部署、運維、實時數(shù)倉等。
官方網(wǎng)站:https://streampark.apache.org
二、快速安裝使用
1. 使用docker-compose安裝
1.1 安裝docker
首先要安裝docker,要求如下:
Docker 1.13.1+
Docker Compose 1.28.0+
1.2 安裝docker-compose
docker-compose安裝方式有很多,這里在嘗試pip安裝后,啟動StreamPark后頻繁報錯,所以推薦二進制安裝方式。
-
首先下載docker-compose文件,使用daocloud下載會快點,安裝最新穩(wěn)定版v2.16.0
sudo curl -L https://get.daocloud.io/docker/compose/releases/download/2.16.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
-
接著將docker-compose添加可執(zhí)行權(quán)限
sudo chmod +x /usr/local/bin/docker-compose
-
查詢版本
docker-compose --version
###1.3 下載docker-compose.yaml和.env
官方給的指令:
wget https://github.com/apache/incubator-streampark/blob/dev/deploy/docker/docker-compose.yaml
wget https://github.com/apache/incubator-streampark/blob/dev/deploy/docker/.env
這里我下載到的文件里面是html代碼,且下載麻煩,下面直接給文件內(nèi)容,創(chuàng)建兩個文件就行:
sudo mkdir -p streampark
sudo vim docker-compose.yaml
- docker-compose.yaml
# 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.
version: '3.8'
services:
streampark-console:
image: apache/streampark:latest
command: ${RUN_COMMAND}
ports:
- 10000:10000
env_file: .env
volumes:
- flink:/streampark/flink/${FLINK}
- /var/run/docker.sock:/var/run/docker.sock
- /etc/hosts:/etc/hosts:ro
- ~/.kube:/root/.kube:ro
privileged: true
restart: unless-stopped
networks:
- streampark
flink-jobmanager:
image: ${FLINK_IMAGE}
ports:
- "8081:8081"
command: jobmanager
volumes:
- flink:/opt/flink
env_file: .env
restart: unless-stopped
privileged: true
networks:
- streampark
flink-taskmanager:
image: ${FLINK_IMAGE}
depends_on:
- flink-jobmanager
command: taskmanager
deploy:
replicas: 1
env_file: .env
restart: unless-stopped
privileged: true
networks:
- streampark
networks:
streampark:
driver: bridge
volumes:
flink:
這里要注意按照自己的需求調(diào)整配置,特別注意端口不能和現(xiàn)有服務(wù)端口沖突文章來源:http://www.zghlxwxcb.cn/news/detail-440398.html
- .env
# 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.
#
TZ=Asia/Shanghai
SPRING_PROFILES_ACTIVE=h2 #mysql, pgsql
# If use mysql or pgsql, please set the following parameters
#SPRING_DATASOURCE_URL=jdbc:mysql://localhost:3306/streampark?useSSL=false&useUnicode=true&characterEncoding=UTF-8&allowPublicKeyRetrieval=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8
#SPRING_DATASOURCE_URL=jdbc:postgresql://localhost:5432/streampark?stringtype=unspecified
#SPRING_DATASOURCE_USERNAME=root
#SPRING_DATASOURCE_PASSWORD=streampark
FLINK=flink1.14.5
FLINK_IMAGE=flink:1.14.5-scala_2.12
RUN_COMMAND='/bin/sh -c "wget -P lib https://repo1.maven.org/maven2/com/mysql/mysql-connector-j/8.0.31/mysql-connector-j-8.0.31.jar && bash bin/startup.sh"'
JOB_MANAGER_RPC_ADDRESS=flink-jobmanager
1.4 啟動容器
docker-compose up -d
1.5 查看服務(wù)
- 訪問StreamPark http://yourip:10000,這里的yourip是指宿主機的ip
- 默認賬號和密碼是admin 和 streampark
- 訪問StreamPark http://yourip:8081,同上
- 這里的端口是和配置文件中的一致的,如果有改動,改成對應(yīng)的端口即可
1.6 快速開始
請見官方文檔:[StreamPark-快速開始](https://streampark.apache.org/zh-CN/docs/user-guide/quick-start)
2. 基于源碼構(gòu)建鏡像進行StreamPark部署
未完待續(xù)。
三、常見報錯
未完待續(xù)。。。
報錯記錄不在,后續(xù)有空更新文章來源地址http://www.zghlxwxcb.cn/news/detail-440398.html
到了這里,關(guān)于流計算開發(fā)平臺StreamPark安裝的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!