This is an automated email from the ASF dual-hosted git repository. xxyu pushed a commit to branch kylin5 in repository https://gitbox.apache.org/repos/asf/kylin.git
The following commit(s) were added to refs/heads/kylin5 by this push: new e18c3b6404 KYLIN-5266 add docker image for kylin5 e18c3b6404 is described below commit e18c3b640497c1d03b45d80bf7b8f01f3e27e532 Author: Mukvin <boyboys...@163.com> AuthorDate: Sat Sep 17 15:20:59 2022 +0800 KYLIN-5266 add docker image for kylin5 --- build/bin/sample.sh | 2 +- build/release/release.sh | 2 - src/docker/.gitignore | 1 + src/docker/all_in_one/Dockerfile_hadoop | 73 +++++++++++ src/docker/all_in_one/Dockerfile_kylin | 46 +++++++ src/docker/all_in_one/build_image.sh | 35 ++++++ .../all_in_one/conf/hadoop/capacity-scheduler.xml | 134 +++++++++++++++++++++ src/docker/all_in_one/conf/hadoop/core-site.xml | 29 +++++ src/docker/all_in_one/conf/hadoop/hdfs-site.xml | 32 +++++ src/docker/all_in_one/conf/hadoop/mapred-site.xml | 20 +++ src/docker/all_in_one/conf/hadoop/yarn-site.xml | 56 +++++++++ src/docker/all_in_one/conf/hive/hive-site.xml | 44 +++++++ .../conf/kylin/kylin.properties.override | 56 +++++++++ src/docker/all_in_one/conf/zk/zoo.cfg | 45 +++++++ src/docker/all_in_one/entrypoint.sh | 104 ++++++++++++++++ src/docker/all_in_one/scripts/install_mysql.sh | 6 + 16 files changed, 682 insertions(+), 3 deletions(-) diff --git a/build/bin/sample.sh b/build/bin/sample.sh index 6bd4990156..c28662feb3 100644 --- a/build/bin/sample.sh +++ b/build/bin/sample.sh @@ -111,7 +111,7 @@ mkdir -p ${KYLIN_HOME}/sample_project/sample_model/metadata cp -rf ${KYLIN_HOME}/sample_project/template/* ${KYLIN_HOME}/sample_project/sample_model/metadata #### Add version info into model -kylin_version=4.0.0.0 +kylin_version=5.0.0.0 echo "kylin version is "$kylin_version sed -i "s/%default_version%/${kylin_version}/g" ${KYLIN_HOME}/sample_project/sample_model/metadata/_global/project/learn_kylin.json sed -i "s/%default_version%/${kylin_version}/g" ${KYLIN_HOME}/sample_project/sample_model/metadata/learn_kylin/dataflow/2d07e878-da28-a203-2d2c-185b4c6656f1.json diff --git a/build/release/release.sh b/build/release/release.sh index 238f872ef7..9ddd41d35c 100755 --- a/build/release/release.sh +++ b/build/release/release.sh @@ -27,8 +27,6 @@ export WITH_THIRDPARTY=0 export WITH_FRONT=1 export PACKAGE_OFFICIAL=0 -export WITH_HIVE1=0 -export WITH_THIRDPARTY=0 export SKIP_COMPILE=0 for PARAM in $@; do diff --git a/src/docker/.gitignore b/src/docker/.gitignore new file mode 100644 index 0000000000..42fcf40e28 --- /dev/null +++ b/src/docker/.gitignore @@ -0,0 +1 @@ +all_in_one/package/* diff --git a/src/docker/all_in_one/Dockerfile_hadoop b/src/docker/all_in_one/Dockerfile_hadoop new file mode 100644 index 0000000000..84143f1a0f --- /dev/null +++ b/src/docker/all_in_one/Dockerfile_hadoop @@ -0,0 +1,73 @@ +# +# 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. +# + +# Docker image with Hadoop/JDK/ZK/HIVE/ installed +FROM ubuntu:20.04 + +# update system tools +RUN apt-get update && apt-get -y install sudo && apt-get -y install wget && apt-get -y install vim + +ENV HADOOP_VERSION 3.2.1 +ENV ZK_VERSION 3.7.1 +ENV HIVE_VERSION 3.1.2 +ENV DEBIAN_FRONTEND=noninteractive +ENV HADOOP_HOME /opt/hadoop-$HADOOP_VERSION +ENV HADOOP_CONF $HADOOP_HOME/etc/hadoop +ENV ZK_HOME /opt/apache-zookeeper-$ZK_VERSION-bin +ENV HIVE_HOME /opt/apache-hive-$HIVE_VERSION-bin +ENV PATH $PATH:$JAVA_HOME/bin:$ZK_HOME/bin:$HADOOP_HOME/bin:$HIVE_HOME/bin: + +USER root +CMD /bin/bash +# change workdir to install Hadoop|JDK|Zookeeper|HIVE +WORKDIR /opt + +# setup jdk +RUN apt-get -y install openjdk-8-jre \ + && wget https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java_8.0.30-1ubuntu20.04_all.deb \ + && dpkg -i mysql-connector-java_8.0.30-1ubuntu20.04_all.deb \ + && cp /usr/share/java/mysql-connector-java-8.0.30.jar /usr/share/java/mysql-connector-java.jar + +ENV JAVA_HOME /usr/lib/jvm/java-1.8.0-openjdk-amd64 + +## install mysql +COPY scripts/install_mysql.sh /opt/ +RUN bash /opt/install_mysql.sh + +## setup hadoop +RUN wget https://archive.apache.org/dist/hadoop/core/hadoop-$HADOOP_VERSION/hadoop-$HADOOP_VERSION.tar.gz \ + && tar -zxf /opt/hadoop-$HADOOP_VERSION.tar.gz \ + && rm -f /opt/hadoop-$HADOOP_VERSION.tar.gz \ + && mkdir -p /data/hadoop +COPY conf/hadoop/* $HADOOP_CONF/ + +## setup zk +RUN wget https://archive.apache.org/dist/zookeeper/zookeeper-$ZK_VERSION/apache-zookeeper-$ZK_VERSION-bin.tar.gz \ + && tar -zxf /opt/apache-zookeeper-$ZK_VERSION-bin.tar.gz \ + && rm -f /opt/apache-zookeeper-$ZK_VERSION-bin.tar.gz \ + && mkdir -p /data/zookeeper +COPY conf/zk/zoo.cfg $ZK_HOME/conf/ + +## setup hive +RUN wget https://archive.apache.org/dist/hive/hive-$HIVE_VERSION/apache-hive-$HIVE_VERSION-bin.tar.gz \ + && tar -zxf /opt/apache-hive-$HIVE_VERSION-bin.tar.gz \ + && rm -f /opt/apache-hive-$HIVE_VERSION-bin.tar.gz \ + && cp /usr/share/java/mysql-connector-java.jar $HIVE_HOME/lib/ \ + && rm -f $HIVE_HOME/lib/guava-19.0.jar \ + && cp $HADOOP_HOME/share/hadoop/common/lib/guava-27.0-jre.jar $HIVE_HOME/lib/ +COPY conf/hive/hive-site.xml $HIVE_HOME/conf/ +COPY conf/hive/hive-site.xml $HADOOP_CONF/ diff --git a/src/docker/all_in_one/Dockerfile_kylin b/src/docker/all_in_one/Dockerfile_kylin new file mode 100644 index 0000000000..fe6a210d70 --- /dev/null +++ b/src/docker/all_in_one/Dockerfile_kylin @@ -0,0 +1,46 @@ +# +# 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. +# + +# Docker image for apache kylin, based on the Hadoop image +FROM hadoop3.2.1-all-in-one-for-kylin5 + +USER root +# make a new workdir +RUN mkdir -p /home/kylin + +# change workdir to install Kylin +WORKDIR /home/kylin + +ENV KYLIN_VERSION 5.0.0 +ENV KYLIN_HOME /home/kylin/apache-kylin-$KYLIN_VERSION-bin + +# TODO: Download Kylin from official website +COPY package/apache-kylin-$KYLIN_VERSION-*.tar.gz /home/kylin/ + +RUN tar -zxf /home/kylin/apache-kylin-$KYLIN_VERSION-*.tar.gz \ + && rm -f /home/kylin/apache-kylin-$KYLIN_VERSION-*.tar.gz \ + && mv /home/kylin/apache-kylin-$KYLIN_VERSION-* $KYLIN_HOME \ + && mkdir -p $KYLIN_HOME/lib/ext \ + && cp $HIVE_HOME/lib/mysql-connector-java.jar $KYLIN_HOME/lib/ext/ \ + && cp $HIVE_HOME/lib/mysql-connector-java.jar $KYLIN_HOME/spark/hive_1_2_2/ + +COPY conf/kylin/kylin.properties.override $KYLIN_HOME/conf/ + +COPY ./entrypoint.sh /home/kylin/entrypoint.sh +RUN chmod u+x /home/kylin/entrypoint.sh + +ENTRYPOINT ["/home/kylin/entrypoint.sh"] diff --git a/src/docker/all_in_one/build_image.sh b/src/docker/all_in_one/build_image.sh new file mode 100755 index 0000000000..058d8b4948 --- /dev/null +++ b/src/docker/all_in_one/build_image.sh @@ -0,0 +1,35 @@ +#!/usr/bin/env bash + +# +# 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. +# + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" +cd ${DIR} +echo "build image in dir "${DIR} + +# TODO: download from the official website +echo "package kylin in local for building image" +rm -rf ${DIR}/package/* +if [[ ! -d ${DIR}/package/ ]]; then + mkdir -p ${DIR}/package/ +fi +${DIR}/../../../build/release/release.sh +cp ${DIR}/../../../dist/apache-kylin-*.tar.gz ${DIR}/package/ + +echo "start to build Hadoop docker image" +docker build -f Dockerfile_hadoop -t hadoop3.2.1-all-in-one-for-kylin5 . +docker build -f Dockerfile_kylin -t apachekylin/apache-kylin-standalone:5.0.0 . diff --git a/src/docker/all_in_one/conf/hadoop/capacity-scheduler.xml b/src/docker/all_in_one/conf/hadoop/capacity-scheduler.xml new file mode 100644 index 0000000000..8f016e2c3b --- /dev/null +++ b/src/docker/all_in_one/conf/hadoop/capacity-scheduler.xml @@ -0,0 +1,134 @@ +<!-- + Licensed 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. See accompanying LICENSE file. +--> +<configuration> + + <property> + <name>yarn.scheduler.capacity.maximum-applications</name> + <value>4</value> + <description> + Maximum number of applications that can be pending and running. + </description> + </property> + + <property> + <name>yarn.scheduler.capacity.maximum-am-resource-percent</name> + <value>0.5</value> + <description> + Maximum percent of resources in the cluster which can be used to run + application masters i.e. controls number of concurrent running + applications. + </description> + </property> + + <property> + <name>yarn.scheduler.capacity.resource-calculator</name> + <value>org.apache.hadoop.yarn.util.resource.DefaultResourceCalculator</value> + <description> + The ResourceCalculator implementation to be used to compare + Resources in the scheduler. + The default i.e. DefaultResourceCalculator only uses Memory while + DominantResourceCalculator uses dominant-resource to compare + multi-dimensional resources such as Memory, CPU etc. + </description> + </property> + + <property> + <name>yarn.scheduler.capacity.root.queues</name> + <value>default</value> + <description> + The queues at the this level (root is the root queue). + </description> + </property> + + <property> + <name>yarn.scheduler.capacity.root.default.capacity</name> + <value>100</value> + <description>Default queue target capacity.</description> + </property> + + <property> + <name>yarn.scheduler.capacity.root.default.user-limit-factor</name> + <value>1</value> + <description> + Default queue user limit a percentage from 0.0 to 1.0. + </description> + </property> + + <property> + <name>yarn.scheduler.capacity.root.default.maximum-capacity</name> + <value>100</value> + <description> + The maximum capacity of the default queue. + </description> + </property> + + <property> + <name>yarn.scheduler.capacity.root.default.state</name> + <value>RUNNING</value> + <description> + The state of the default queue. State can be one of RUNNING or STOPPED. + </description> + </property> + + <property> + <name>yarn.scheduler.capacity.root.default.acl_submit_applications</name> + <value>*</value> + <description> + The ACL of who can submit jobs to the default queue. + </description> + </property> + + <property> + <name>yarn.scheduler.capacity.root.default.acl_administer_queue</name> + <value>*</value> + <description> + The ACL of who can administer jobs on the default queue. + </description> + </property> + + <property> + <name>yarn.scheduler.capacity.node-locality-delay</name> + <value>40</value> + <description> + Number of missed scheduling opportunities after which the CapacityScheduler + attempts to schedule rack-local containers. + Typically this should be set to number of nodes in the cluster, By default is setting + approximately number of nodes in one rack which is 40. + </description> + </property> + + <property> + <name>yarn.scheduler.capacity.queue-mappings</name> + <value></value> + <description> + A list of mappings that will be used to assign jobs to queues + The syntax for this list is [u|g]:[name]:[queue_name][,next mapping]* + Typically this list will be used to map users to queues, + for example, u:%user:%user maps all users to queues with the same name + as the user. + </description> + </property> + + <property> + <name>yarn.scheduler.capacity.queue-mappings-override.enable</name> + <value>false</value> + <description> + If a queue mapping is present, will it override the value specified + by the user? This can be used by administrators to place jobs in queues + that are different than the one specified by the user. + The default is false. + </description> + </property> + +</configuration> diff --git a/src/docker/all_in_one/conf/hadoop/core-site.xml b/src/docker/all_in_one/conf/hadoop/core-site.xml new file mode 100644 index 0000000000..6fe6404e5c --- /dev/null +++ b/src/docker/all_in_one/conf/hadoop/core-site.xml @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="UTF-8"?> +<?xml-stylesheet type="text/xsl" href="configuration.xsl"?> +<!-- + Licensed 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. See accompanying LICENSE file. +--> + +<!-- Put site-specific property overrides in this file. --> + +<configuration> + <property> + <name>hadoop.tmp.dir</name> + <value>/data/hadoop</value> + <description>Abase for other temporary directories.</description> + </property> + <property> + <name>fs.defaultFS</name> + <value>hdfs://localhost:9000</value> + </property> +</configuration> diff --git a/src/docker/all_in_one/conf/hadoop/hdfs-site.xml b/src/docker/all_in_one/conf/hadoop/hdfs-site.xml new file mode 100644 index 0000000000..77b9460eb0 --- /dev/null +++ b/src/docker/all_in_one/conf/hadoop/hdfs-site.xml @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="UTF-8"?> +<?xml-stylesheet type="text/xsl" href="configuration.xsl"?> +<!-- + Licensed 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. See accompanying LICENSE file. +--> + +<!-- Put site-specific property overrides in this file. --> + +<configuration> + <property> + <name>dfs.replication</name> + <value>1</value> + </property> + <property> + <name>dfs.namenode.name.dir</name> + <value>/data/hadoop/dfs/name</value> + </property> + <property> + <name>dfs.datanode.data.dir</name> + <value>/data/hadoop/dfs/data</value> + </property> +</configuration> diff --git a/src/docker/all_in_one/conf/hadoop/mapred-site.xml b/src/docker/all_in_one/conf/hadoop/mapred-site.xml new file mode 100644 index 0000000000..ac8ef33969 --- /dev/null +++ b/src/docker/all_in_one/conf/hadoop/mapred-site.xml @@ -0,0 +1,20 @@ +<?xml version="1.0"?> +<?xml-stylesheet type="text/xsl" href="configuration.xsl"?> +<!-- +Licensed 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. +--> + +<configuration> + <property> + <name>mapreduce.framework.name</name> + <value>yarn</value> + </property> +</configuration> \ No newline at end of file diff --git a/src/docker/all_in_one/conf/hadoop/yarn-site.xml b/src/docker/all_in_one/conf/hadoop/yarn-site.xml new file mode 100644 index 0000000000..f52a27f9f2 --- /dev/null +++ b/src/docker/all_in_one/conf/hadoop/yarn-site.xml @@ -0,0 +1,56 @@ +<?xml version="1.0"?> +<!-- + Licensed 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. See accompanying LICENSE file. +--> +<configuration> + <property> + <name>yarn.resourcemanager.scheduler.class</name> + <value>org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.FairScheduler</value> + </property> + <property> + <name>yarn.scheduler.minimum-allocation-mb</name> + <value>512</value> + </property> + <property> + <name>yarn.scheduler.maximum-allocation-mb</name> + <value>2048</value> + </property> + <property> + <name>yarn.nodemanager.vmem-check-enabled</name> + <value>false</value> + </property> + <property> + <name>yarn.nodemanager.resource.memory-mb</name> + <value>8192</value> + </property> + <property> + <name>yarn.nodemanager.resource.cpu-vcores</name> + <value>4</value> + </property> + <property> + <name>yarn.scheduler.capacity.maximum-am-resource-percent</name> + <value>0.5</value> + </property> + <property> + <name>yarn.nodemanager.disk-health-checker.max-disk-utilization-per-disk-percentage</name> + <value>98.5</value> + </property> + <property> + <name>yarn.nodemanager.aux-services</name> + <value>mapreduce_shuffle</value> + </property> + <property> + <name>yarn.resourcemanager.zk-address</name> + <value>localhost:2181</value> + </property> +</configuration> diff --git a/src/docker/all_in_one/conf/hive/hive-site.xml b/src/docker/all_in_one/conf/hive/hive-site.xml new file mode 100644 index 0000000000..0f19649ded --- /dev/null +++ b/src/docker/all_in_one/conf/hive/hive-site.xml @@ -0,0 +1,44 @@ +<?xml version="1.0" encoding="UTF-8"?> +<?xml-stylesheet type="text/xsl" href="configuration.xsl"?> +<!-- + Licensed 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. See accompanying LICENSE file. +--> + +<!-- Put site-specific property overrides in this file. --> + +<configuration> + <property> + <name>hive.metastore.db.type</name> + <value>mysql</value> + </property> + <property> + <name>javax.jdo.option.ConnectionURL</name> + <value>jdbc:mysql://localhost:3306/hive?createDatabaseIfNotExist=true</value> + </property> + <property> + <name>javax.jdo.option.ConnectionDriverName</name> + <value>com.mysql.jdbc.Driver</value> + </property> + <property> + <name>javax.jdo.option.ConnectionUserName</name> + <value>root</value> + </property> + <property> + <name>javax.jdo.option.ConnectionPassword</name> + <value>123456</value> + </property> + <property> + <name>hive.metastore.schema.verification</name> + <value>false</value> + </property> +</configuration> diff --git a/src/docker/all_in_one/conf/kylin/kylin.properties.override b/src/docker/all_in_one/conf/kylin/kylin.properties.override new file mode 100644 index 0000000000..01f23c950a --- /dev/null +++ b/src/docker/all_in_one/conf/kylin/kylin.properties.override @@ -0,0 +1,56 @@ +# +# 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. +# + +server.port=7070 +kylin.query.init-sparder-async=false + +kylin.env.apache-hadoop-conf-dir=/opt/hadoop-3.2.1/etc/hadoop +kylin.env.apache-hive-conf-dir=/opt/apache-hive-3.1.2-bin/conf +kylin.metadata.url=kylin@jdbc,driverClassName=com.mysql.jdbc.Driver,url=jdbc:mysql://localhost:3306/kylin?useUnicode=true&characterEncoding=utf8,username=root,password=123456,maxTotal=50,maxIdle=8 +kylin.env.zookeeper-connect-string=localhost:2181 +kylin.env.hdfs-working-dir=/kylin + +# Query +kylin.storage.columnar.spark-conf.spark.driver.memory=512M +kylin.storage.columnar.spark-conf.spark.driver.memoryOverhead=512M +kylin.storage.columnar.spark-conf.spark.executor.cores=1 +kylin.storage.columnar.spark-conf.spark.executor.instances=1 +kylin.storage.columnar.spark-conf.spark.executor.memory=1024M +kylin.storage.columnar.spark-conf.spark.executor.memoryOverhead=512M + +# Build +kylin.engine.driver-memory-strategy=2,500 +kylin.engine.spark-conf.spark.driver.memory=512M +kylin.engine.spark-conf.spark.driver.memoryOverhead=512M +kylin.engine.spark-conf.spark.executor.cores=1 +kylin.engine.spark-conf.spark.executor.instances=1 +kylin.engine.spark-conf.spark.executor.memory=1024M +kylin.engine.spark-conf.spark.executor.memoryOverhead=512M + +# Async Query +kylin.query.async-query.spark-conf.spark.executor.cores=1 +kylin.query.async-query.spark-conf.spark.driver.memory=1024M +kylin.query.async-query.spark-conf.spark.executor.memory=1024M +kylin.query.async-query.spark-conf.spark.executor.instances=1 +kylin.query.async-query.spark-conf.spark.executor.memoryOverhead=512M + +# Other +kylin.metadata.random-admin-password.enabled=false +kylin.query.engine.push-down.enable-prepare-statement-with-params=true +kylin.query.calcite.extras-props.FUN=standard,oracle +kylin.circuit-breaker.threshold.project=500 +kylin.engine.resource-request-over-limit-proportion=3.0 diff --git a/src/docker/all_in_one/conf/zk/zoo.cfg b/src/docker/all_in_one/conf/zk/zoo.cfg new file mode 100644 index 0000000000..1a576decbb --- /dev/null +++ b/src/docker/all_in_one/conf/zk/zoo.cfg @@ -0,0 +1,45 @@ +# +# 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. +# + +# 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=/data/zookeeper +# 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 diff --git a/src/docker/all_in_one/entrypoint.sh b/src/docker/all_in_one/entrypoint.sh new file mode 100644 index 0000000000..b2965d7a86 --- /dev/null +++ b/src/docker/all_in_one/entrypoint.sh @@ -0,0 +1,104 @@ +#!/bin/bash + +# +# 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. +# +echo "127.0.0.1 sandbox" >> /etc/hosts + +# clean pid files +rm -f /tmp/*.pid + +# start mysql +service mysql start +if [ ! -f "/home/kylin/first_run" ] +then + mysql -uroot -p123456 -e "CREATE DATABASE IF NOT EXISTS kylin default charset utf8mb4 COLLATE utf8mb4_general_ci;" +fi + +# init schema for hive +if [ ! -f "/home/kylin/first_run" ] +then + schematool -initSchema -dbType mysql +fi + +# start hdfs +if [ ! -f "/home/kylin/first_run" ] +then + hdfs namenode -format +fi + +hdfs --daemon start namenode +hdfs --daemon start datanode + +# start yarn +yarn --daemon start resourcemanager +yarn --daemon start nodemanager + +# start job history server +mapred --daemon start historyserver + +# start zk +rm -rf /data/zookeeper/* +rm -f /data/zookeeper/zookeeper_server.pid +$ZK_HOME/bin/zkServer.sh start + +sleep 10s +mkdir -p $KYLIN_HOME/logs + +function check_hdfs_usability() { + echo "Checking HDFS's service..." + started_hdfs= + ((time_left = 60)) + while ((time_left > 0)); do + hdfs dfs -test -d /tmp + started_hdfs=$? + if [[ $started_hdfs -eq 0 ]]; then + break + fi + sleep 5 + ((timeLeft -= 5)) + done + if [[ $started_hdfs -eq 0 ]]; then + echo "HDFS's service started..." + else + echo "ERROR: Check HDFS's service failed, please check the status of your cluster" + fi +} + +if [ ! -f "/home/kylin/first_run" ] +then + # check hdfs usability first if hdfs service was not started normally + check_hdfs_usability + hdfs dfs -mkdir -p /kylin +fi + +# create sample data at the first time +if [ ! -f "/home/kylin/first_run" ] +then + $KYLIN_HOME/bin/sample.sh >> ${KYLIN_HOME}/logs/kylin-verbose.log 2>&1 +fi + +# start kylin +$KYLIN_HOME/bin/kylin.sh -v start >> ${KYLIN_HOME}/logs/kylin-verbose.log 2>&1 + + + +touch /home/kylin/first_run + +while : +do + sleep 10 +done diff --git a/src/docker/all_in_one/scripts/install_mysql.sh b/src/docker/all_in_one/scripts/install_mysql.sh new file mode 100644 index 0000000000..c3a7ff5d59 --- /dev/null +++ b/src/docker/all_in_one/scripts/install_mysql.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +export DEBIAN_FRONTEND="noninteractive" +debconf-set-selections <<< 'mysql-server mysql-server/root_password password 123456' +debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password 123456' +apt-get install -y mysql-server