You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by ha...@apache.org on 2019/12/11 16:28:53 UTC
[skywalking] 01/01: Add es7 support to docker
This is an automated email from the ASF dual-hosted git repository.
hanahmily pushed a commit to branch docker-es7
in repository https://gitbox.apache.org/repos/asf/skywalking.git
commit 8a82a892eb1c3ffbc806f137cd9c730db3cc7529
Author: Gao Hongtao <ha...@gmail.com>
AuthorDate: Wed Dec 11 16:23:11 2019 +0000
Add es7 support to docker
---
Makefile | 8 +++-
docker/docker-compose-es7.yml | 56 ++++++++++++++++++++++++++++
docker/oap-es7/Dockerfile.oap-es7 | 42 +++++++++++++++++++++
docker/{oap => oap-es7}/docker-entrypoint.sh | 14 ++++++-
docker/oap-es7/log4j2.xml | 36 ++++++++++++++++++
docker/oap/docker-entrypoint.sh | 12 ++++++
6 files changed, 166 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index 2c3cc12..5970388 100644
--- a/Makefile
+++ b/Makefile
@@ -52,7 +52,7 @@ TAG?=latest
.PHONY: docker docker.all docker.oap
-docker: init build.docker docker.all
+docker: init build.all docker.all
DOCKER_TARGETS:=docker.oap docker.ui
@@ -64,6 +64,12 @@ docker.oap: $(SW_ROOT)/docker/oap/docker-entrypoint.sh
docker.oap: $(SW_ROOT)/docker/oap/log4j2.xml
$(DOCKER_RULE)
+docker.oap-es7: $(SW_OUT)/apache-skywalking-apm-bin-es7.tar.gz
+docker.oap-es7: $(SW_ROOT)/docker/oap-es7/Dockerfile.oap-es7
+docker.oap-es7: $(SW_ROOT)/docker/oap-es7/docker-entrypoint.sh
+docker.oap-es7: $(SW_ROOT)/docker/oap-es7/log4j2.xml
+ $(DOCKER_RULE)
+
docker.ui: $(SW_OUT)/apache-skywalking-apm-bin.tar.gz
docker.ui: $(SW_ROOT)/docker/ui/Dockerfile.ui
docker.ui: $(SW_ROOT)/docker/ui/docker-entrypoint.sh
diff --git a/docker/docker-compose-es7.yml b/docker/docker-compose-es7.yml
new file mode 100644
index 0000000..8b06e57
--- /dev/null
+++ b/docker/docker-compose-es7.yml
@@ -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.
+
+version: '3.3'
+services:
+ elasticsearch:
+ image: docker.elastic.co/elasticsearch/elasticsearch:7.5.0
+ container_name: elasticsearch
+ restart: always
+ ports:
+ - 9200:9200
+ environment:
+ discovery.type: single-node
+ ulimits:
+ memlock:
+ soft: -1
+ hard: -1
+ oap:
+ image: skywalking/oap-es7
+ container_name: oap
+ depends_on:
+ - elasticsearch
+ links:
+ - elasticsearch
+ restart: always
+ ports:
+ - 11800:11800
+ - 12800:12800
+ environment:
+ SW_STORAGE: elasticsearch
+ SW_STORAGE_ES_CLUSTER_NODES: elasticsearch:9200
+ ui:
+ image: skywalking/ui
+ container_name: ui
+ depends_on:
+ - oap
+ links:
+ - oap
+ restart: always
+ ports:
+ - 8080:8080
+ environment:
+ SW_OAP_ADDRESS: oap:12800
diff --git a/docker/oap-es7/Dockerfile.oap-es7 b/docker/oap-es7/Dockerfile.oap-es7
new file mode 100644
index 0000000..8ced58a
--- /dev/null
+++ b/docker/oap-es7/Dockerfile.oap-es7
@@ -0,0 +1,42 @@
+# 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.
+
+FROM openjdk:8u181-jdk-stretch
+
+ENV DIST_NAME=apache-skywalking-apm-bin-es7 \
+ JAVA_OPTS=" -Xms256M " \
+ SW_CLUSTER="standalone" \
+ SW_STORAGE="h2"
+
+COPY "$DIST_NAME.tar.gz" /
+
+RUN set -ex; \
+ tar -xzf "$DIST_NAME.tar.gz"; \
+ rm -rf "$DIST_NAME.tar.gz"; \
+ rm -rf "$DIST_NAME/config/log4j2.xml"; \
+ rm -rf "$DIST_NAME/bin"; rm -rf "$DIST_NAME/webapp"; rm -rf "$DIST_NAME/agent"; \
+ mv "$DIST_NAME" skywalking;
+
+WORKDIR skywalking
+
+COPY log4j2.xml config/
+COPY docker-entrypoint.sh .
+RUN mkdir ext-config; \
+ mkdir ext-libs;
+
+EXPOSE 12800 11800 1234
+
+ENTRYPOINT ["bash", "docker-entrypoint.sh"]
\ No newline at end of file
diff --git a/docker/oap/docker-entrypoint.sh b/docker/oap-es7/docker-entrypoint.sh
similarity index 97%
copy from docker/oap/docker-entrypoint.sh
copy to docker/oap-es7/docker-entrypoint.sh
index c18cd1a..aca6994 100755
--- a/docker/oap/docker-entrypoint.sh
+++ b/docker/oap-es7/docker-entrypoint.sh
@@ -96,7 +96,7 @@ EOT
else
cat <<EOT >> ${var_application_file}
storage:
- elasticsearch:
+ elasticsearch7:
EOT
fi
cat <<EOT >> ${var_application_file}
@@ -200,6 +200,17 @@ configuration:
EOT
}
+generateConfigurationGRPC() {
+ cat <<EOT >> ${var_application_file}
+configuration:
+ grpc:
+ host: \${SW_CONFIGURATION_GRPC_HOST:127.0.0.1}
+ port: \${SW_CONFIGURATION_GRPC_PORT:9555}
+ period: \${SW_CONFIGURATION_GRPC_PERIOD:60}
+ clusterName: \${SW_CONFIGURATION_GRPC_CLUSTER_NAME:"default"}
+EOT
+}
+
generateConfigurationConsul() {
cat <<EOT >> ${var_application_file}
configuration:
@@ -371,6 +382,7 @@ EOT
nacos) generateConfigurationNacos;;
zookeeper) generateConfigurationZookeeper;;
consul) generateConfigurationConsul;;
+ grpc) generateConfigurationGRPC;;
esac
cat <<EOT >> ${var_application_file}
diff --git a/docker/oap-es7/log4j2.xml b/docker/oap-es7/log4j2.xml
new file mode 100644
index 0000000..eb69a89
--- /dev/null
+++ b/docker/oap-es7/log4j2.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ 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.
+ ~
+ -->
+
+<Configuration status="INFO">
+ <Appenders>
+ <Console name="Console" target="SYSTEM_OUT">
+ <PatternLayout charset="UTF-8" pattern="%d - %c -%-4r [%t] %-5p %x - %m%n"/>
+ </Console>
+ </Appenders>
+ <Loggers>
+ <logger name="org.eclipse.jetty" level="INFO"/>
+ <logger name="org.apache.zookeeper" level="INFO"/>
+ <logger name="org.elasticsearch.common.network.IfConfig" level="INFO"/>
+ <logger name="io.grpc.netty" level="INFO"/>
+ <logger name="org.apache.skywalking.oap.server.receiver.istio.telemetry" level="DEBUG"/>
+ <Root level="INFO">
+ <AppenderRef ref="Console"/>
+ </Root>
+ </Loggers>
+</Configuration>
diff --git a/docker/oap/docker-entrypoint.sh b/docker/oap/docker-entrypoint.sh
index c18cd1a..ee34612 100755
--- a/docker/oap/docker-entrypoint.sh
+++ b/docker/oap/docker-entrypoint.sh
@@ -200,6 +200,17 @@ configuration:
EOT
}
+generateConfigurationGRPC() {
+ cat <<EOT >> ${var_application_file}
+configuration:
+ grpc:
+ host: \${SW_CONFIGURATION_GRPC_HOST:127.0.0.1}
+ port: \${SW_CONFIGURATION_GRPC_PORT:9555}
+ period: \${SW_CONFIGURATION_GRPC_PERIOD:60}
+ clusterName: \${SW_CONFIGURATION_GRPC_CLUSTER_NAME:"default"}
+EOT
+}
+
generateConfigurationConsul() {
cat <<EOT >> ${var_application_file}
configuration:
@@ -371,6 +382,7 @@ EOT
nacos) generateConfigurationNacos;;
zookeeper) generateConfigurationZookeeper;;
consul) generateConfigurationConsul;;
+ grpc) generateConfigurationGRPC;;
esac
cat <<EOT >> ${var_application_file}