StreamPark部署(DockerCompose)

文档操作目录: /data/streampark

官方下载二进制包

下载mysql-connector-j-8.0.31.jar至同目录

参考官方,将环境文件复制到该目录下

在同目录下新建dockerfile

FROM registry.cn-shanghai.aliyuncs.com/luckydata/centos7_jdk8:latest
WORKDIR /streampark
RUN yum install lsof -y
COPY ./apache-streampark_2.12-2.1.2-incubating-bin.tar.gz /streampark
RUN tar -zxvf apache-streampark_2.12-2.1.2-incubating-bin.tar.gz
COPY ./mysql-connector-j-8.0.31.jar /streampark/apache-streampark_2.12-2.1.2-incubating-bin/lib
EXPOSE 10000
ENV TZ=Asia/Shanghai
ENV LANG=zh_CN.UTF-8
CMD ["/sbin/init"]
CMD ["apache-streampark_2.12-2.1.2-incubating-bin/bin/streampark.sh","start_docker"]

执行编译命令

docker build -t streampark:v2.1.2 .

在同目录下新建docker-compose.yaml

version: '3.8'
services:
  streampark:
    image: streampark:v2.1.2
    container_name: streampark
    ports:
      - 10000:10000
    env_file: .env
    volumes:
      - /data/streampark/logs:/streampark/apache-streampark_2.12-2.1.2-incubating-bin/logs
      - /data/streampark/hadoop:/streampark/hadoop
      - /data/streampark/hadoop-conf:/streampark/hadoop-conf
      - /data/streampark/hadoop-hdfs:/streampark/hadoop-hdfs
      - /data/streampark/hadoop-mapreduce:/streampark/hadoop-mapreduce
      - /data/streampark/hadoop-yarn:/streampark/hadoop-yarn
      - /data/streampark/flink:/streampark/flink
      - /data/streampark/hive-conf:/streampark/hive-conf
      - /data/streampark/workspace:/streampark/workspace
      - /etc/hosts:/etc/hosts
    privileged: true
    restart: unless-stopped
    networks:
      - streampark

networks:
  streampark:
    driver: bridge
    ipam:
      config:
        - subnet: 172.18.0.0/24

创建文件.env

TZ=Asia/Shanghai

SPRING_PROFILES_ACTIVE=mysql  #pgsql
SPRING_DATASOURCE_URL=jdbc:mysql://xxxxxxxxx:3306/streampark?useSSL=false&useUnicode=true&characterEncoding=UTF-8&allowPublicKeyRetrieval=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8
SPRING_DATASOURCE_USERNAME=xxxx
SPRING_DATASOURCE_PASSWORD=xxxxxx
HADOOP_HOME=/streampark/hadoop
HADOOP_CONF_DIR=$HADOOP_HOME/../hadoop-conf
HADOOP_HDFS_HOME=$HADOOP_HOME/../hadoop-hdfs
HADOOP_MAPRED_HOME=$HADOOP_HOME/../hadoop-mapreduce
HADOOP_YARN_HOME=$HADOOP_HOME/../hadoop-yarn
STREAMPARK_WORKSPACE_LOCAL=/streampark/workspace
STREAMPARK_WORKSPACE_REMOTE=hdfs:///streampark
LANG=zh_CN.UTF-8

执行docker compose up -d

你可能感兴趣的:(大数据运维,大数据)