From 12b41c1d14f292754647dd5f6c8d07aea3b96656 Mon Sep 17 00:00:00 2001 From: ascrutae Date: Sat, 17 Dec 2016 17:38:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=83=A8=E5=88=86=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker-compose.yml | 32 +++++++++++++++++ pom.xml | 9 +++++ skywalking-alarm/docker/Dockerfile | 0 skywalking-alarm/docker/docker-entrypoint.sh | 5 +++ skywalking-alarm/pom.xml | 15 ++++++-- .../src/main/resources/config.properties | 2 +- .../pom.xml | 8 +---- .../skywalking-routing/docker/Dockerfile | 0 .../docker/docker-entrypoint.sh | 5 +++ .../src/main/resources/config.properties | 4 +-- .../skywalking-storage/docker/Dockerfile | 0 .../docker/docker-entrypoint.sh | 5 +++ .../src/main/resources/config.properties | 2 +- skywalking-webui/docker/Dockerfile | 18 ++++++++++ skywalking-webui/docker/config.properties | 3 ++ skywalking-webui/docker/docker-entrypoint.sh | 16 +++++++++ skywalking-webui/docker/jdbc.properties | 8 +++++ skywalking-webui/pom.xml | 35 ++++++++++++++++--- .../src/main/resources/config.properties | 3 +- .../src/main/resources/jdbc.properties | 2 +- .../resources/spring/application-jdbc.xml | 15 +++++--- .../src/main/{sql => resources}/table.mysql | 0 22 files changed, 163 insertions(+), 24 deletions(-) create mode 100644 docker-compose.yml create mode 100644 skywalking-alarm/docker/Dockerfile create mode 100644 skywalking-alarm/docker/docker-entrypoint.sh create mode 100644 skywalking-storage-center/skywalking-routing/docker/Dockerfile create mode 100644 skywalking-storage-center/skywalking-routing/docker/docker-entrypoint.sh create mode 100644 skywalking-storage-center/skywalking-storage/docker/Dockerfile create mode 100644 skywalking-storage-center/skywalking-storage/docker/docker-entrypoint.sh create mode 100644 skywalking-webui/docker/Dockerfile create mode 100644 skywalking-webui/docker/config.properties create mode 100644 skywalking-webui/docker/docker-entrypoint.sh create mode 100644 skywalking-webui/docker/jdbc.properties rename skywalking-webui/src/main/{sql => resources}/table.mysql (100%) diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000000..6ba72dfb4b --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,32 @@ +version: '2' +services: + skywalking-webui: + image: skywalking/skywalking-webui:2.0-2016 + expose: + - "8080" + ports: + - "8080:8080" + depends_on: + - mysql-server + - registry-center-server + links: + - mysql-server + - registry-center-server + environment: + - MYSQL_URL=mysql-server:3306 + - REGISTRY_CENTER_URL=registry-center-server:2181 + + + mysql-server: + image: mysql:5.6 + expose: + - "3306" + environment: + MYSQL_DATABASE: test + MYSQL_ROOT_PASSWORD: root + STARTUP_SQL: /Users/xin/workbench/sky-walking/skywalking-webui/src/main/sql/table.mysql + + registry-center-server: + image: zookeeper:3.4.9 + expose: + - "2181" \ No newline at end of file diff --git a/pom.xml b/pom.xml index fbeb2e0a87..e9b544e1be 100644 --- a/pom.xml +++ b/pom.xml @@ -24,6 +24,7 @@ UTF-8 1.8 1.6.4 + 0.4.13 @@ -71,6 +72,14 @@ ${project.build.sourceEncoding} + + com.spotify + docker-maven-plugin + ${docker.plugin.version} + + true + + diff --git a/skywalking-alarm/docker/Dockerfile b/skywalking-alarm/docker/Dockerfile new file mode 100644 index 0000000000..e69de29bb2 diff --git a/skywalking-alarm/docker/docker-entrypoint.sh b/skywalking-alarm/docker/docker-entrypoint.sh new file mode 100644 index 0000000000..e377e6a4cb --- /dev/null +++ b/skywalking-alarm/docker/docker-entrypoint.sh @@ -0,0 +1,5 @@ +#!/bin/bash + + + +exec "$@" \ No newline at end of file diff --git a/skywalking-alarm/pom.xml b/skywalking-alarm/pom.xml index f593da0311..916d589eb3 100644 --- a/skywalking-alarm/pom.xml +++ b/skywalking-alarm/pom.xml @@ -1,10 +1,13 @@ 4.0.0 + + skywalking + com.a.eye + 2.0-2016 + - com.a.eye skywalking-alarm - 2.0-2016 jar skywalking-alarm @@ -98,6 +101,14 @@ + + com.spotify + docker-maven-plugin + ${docker.plugin.version} + + true + + diff --git a/skywalking-alarm/src/main/resources/config.properties b/skywalking-alarm/src/main/resources/config.properties index 16ad6fb36e..4bd1e299ec 100644 --- a/skywalking-alarm/src/main/resources/config.properties +++ b/skywalking-alarm/src/main/resources/config.properties @@ -35,7 +35,7 @@ coordinator.check_all_process_thread_interval=500 #数据库驱动类 db.driver_class=com.mysql.jdbc.Driver #数据库连接地址 -db.url=jdbc:mysql://localhost:3307/test +db.url=jdbc:mysql://localhost:3306/test #数据库用户名 db.user_name=root #数据库密码 diff --git a/skywalking-sniffer/skywalking-toolkit-activation/skywalking-toolkit-trace-context-activation/pom.xml b/skywalking-sniffer/skywalking-toolkit-activation/skywalking-toolkit-trace-context-activation/pom.xml index cedea041ae..873703d8ed 100644 --- a/skywalking-sniffer/skywalking-toolkit-activation/skywalking-toolkit-trace-context-activation/pom.xml +++ b/skywalking-sniffer/skywalking-toolkit-activation/skywalking-toolkit-trace-context-activation/pom.xml @@ -2,7 +2,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - skywalking-application-toolkit + skywalking-toolkit-activation com.a.eye 2.0-2016 @@ -12,12 +12,6 @@ jar skywalking-toolkit-trace-context-activation - http://maven.apache.org - - - UTF-8 - - com.a.eye diff --git a/skywalking-storage-center/skywalking-routing/docker/Dockerfile b/skywalking-storage-center/skywalking-routing/docker/Dockerfile new file mode 100644 index 0000000000..e69de29bb2 diff --git a/skywalking-storage-center/skywalking-routing/docker/docker-entrypoint.sh b/skywalking-storage-center/skywalking-routing/docker/docker-entrypoint.sh new file mode 100644 index 0000000000..e377e6a4cb --- /dev/null +++ b/skywalking-storage-center/skywalking-routing/docker/docker-entrypoint.sh @@ -0,0 +1,5 @@ +#!/bin/bash + + + +exec "$@" \ No newline at end of file diff --git a/skywalking-storage-center/skywalking-routing/src/main/resources/config.properties b/skywalking-storage-center/skywalking-routing/src/main/resources/config.properties index d5e0a4a97b..73d4b53120 100644 --- a/skywalking-storage-center/skywalking-routing/src/main/resources/config.properties +++ b/skywalking-storage-center/skywalking-routing/src/main/resources/config.properties @@ -7,7 +7,7 @@ server.port=23000 # the type of registry center (default: zookeeper) #registrycenter.type=zookeeper # the connect url that registry center -registrycenter.connect_url=127.0.0.1:2181 +registrycenter.connect_url=localhost:2181 # auth schema that registry center #registrycenter.auth_schema= # the auth info that registry center @@ -21,7 +21,7 @@ registrycenter.connect_url=127.0.0.1:2181 # #disruptor.flush_size=100 # the connect url for alarm -alarm.redis_server=127.0.0.1:6379 +alarm.redis_server=localhost:6379 # #alarm.alarm_off_flag=true # diff --git a/skywalking-storage-center/skywalking-storage/docker/Dockerfile b/skywalking-storage-center/skywalking-storage/docker/Dockerfile new file mode 100644 index 0000000000..e69de29bb2 diff --git a/skywalking-storage-center/skywalking-storage/docker/docker-entrypoint.sh b/skywalking-storage-center/skywalking-storage/docker/docker-entrypoint.sh new file mode 100644 index 0000000000..e377e6a4cb --- /dev/null +++ b/skywalking-storage-center/skywalking-storage/docker/docker-entrypoint.sh @@ -0,0 +1,5 @@ +#!/bin/bash + + + +exec "$@" \ No newline at end of file diff --git a/skywalking-storage-center/skywalking-storage/src/main/resources/config.properties b/skywalking-storage-center/skywalking-storage/src/main/resources/config.properties index 73cde8873f..fffcb3b474 100644 --- a/skywalking-storage-center/skywalking-storage/src/main/resources/config.properties +++ b/skywalking-storage-center/skywalking-storage/src/main/resources/config.properties @@ -23,7 +23,7 @@ server.port=34000 #registrycenter.auth_schema= # # the registry center connect url (Default: zookeeper) -registrycenter.connect_url=127.0.0.1:2181 +registrycenter.connect_url=localhost:2181 # # the prefix of path that each storage node register #registrycenter.path_prefix=/skywalking/storage_list/ diff --git a/skywalking-webui/docker/Dockerfile b/skywalking-webui/docker/Dockerfile new file mode 100644 index 0000000000..8db4c5947e --- /dev/null +++ b/skywalking-webui/docker/Dockerfile @@ -0,0 +1,18 @@ +FROM tomcat:8.0.39-jre8 + +ENV JPDA_ADDRESS="8000" \ + JPDA_TRANSPORT="dt_socket" \ + MYSQL_URL=localhost:3306 \ + MYSQL_USER=root \ + MYSQL_PASSWORD=root \ + REGISTRY_CENTER_URL=localhost:2181 + +COPY skywalking /usr/local/tomcat/webapps/skywalking +COPY classes /usr/local/tomcat/webapps/skywalking/WEB-INF/classes/ +COPY jdbc.properties /usr/local/tomcat/webapps/skywalking/WEB-INF/classes/ +COPY config.properties /usr/local/tomcat/webapps/skywalking/WEB-INF/classes/ +COPY docker-entrypoint.sh / +RUN chmod +x /docker-entrypoint.sh + +ENTRYPOINT ["/docker-entrypoint.sh"] +CMD ["catalina.sh", "jpda", "run"] \ No newline at end of file diff --git a/skywalking-webui/docker/config.properties b/skywalking-webui/docker/config.properties new file mode 100644 index 0000000000..7202e1517e --- /dev/null +++ b/skywalking-webui/docker/config.properties @@ -0,0 +1,3 @@ +# the registry center connect url (Default: zookeeper) +registrycenter.connect_url={registry_center_url} + diff --git a/skywalking-webui/docker/docker-entrypoint.sh b/skywalking-webui/docker/docker-entrypoint.sh new file mode 100644 index 0000000000..b4dc6c0be5 --- /dev/null +++ b/skywalking-webui/docker/docker-entrypoint.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +# replace all variables +echo "replace mysql-server with $MYSQL_URL" +eval sed -i -e 's/\{mysql-server\}/$MYSQL_URL/' /usr/local/tomcat/webapps/skywalking/WEB-INF/classes/jdbc.properties + +echo "replace mysql-username with $MYSQL_USER" +eval sed -i -e 's/\{mysql-username\}/$MYSQL_USER/' /usr/local/tomcat/webapps/skywalking/WEB-INF/classes/jdbc.properties + +echo "replace mysql-password with $MYSQL_PASSWORD" +eval sed -i -e 's/\{mysql-password\}/$MYSQL_PASSWORD/' /usr/local/tomcat/webapps/skywalking/WEB-INF/classes/jdbc.properties + +echo "replace registry_center_url with $REGISTRY_CENTER_URL" +eval sed -i -e 's/\{registry_center_url\}/$REGISTRY_CENTER_URL/' /usr/local/tomcat/webapps/skywalking/WEB-INF/classes/config.properties + +exec "$@" \ No newline at end of file diff --git a/skywalking-webui/docker/jdbc.properties b/skywalking-webui/docker/jdbc.properties new file mode 100644 index 0000000000..062c973476 --- /dev/null +++ b/skywalking-webui/docker/jdbc.properties @@ -0,0 +1,8 @@ +jdbc.driverClassName=com.mysql.jdbc.Driver +jdbc.url=jdbc:mysql://{mysql-server}/test +jdbc.username={mysql-username} +jdbc.password={mysql-password} +jdbc.maxTotal=200 +jdbc.maxIdle=50 +jdbc.maxWaitMillis=1000 +jdbc.defaultAutoCommit=false diff --git a/skywalking-webui/pom.xml b/skywalking-webui/pom.xml index be0972269b..607732a8b0 100644 --- a/skywalking-webui/pom.xml +++ b/skywalking-webui/pom.xml @@ -1,4 +1,5 @@ - 4.0.0 @@ -14,9 +15,6 @@ 4.1.6.RELEASE - - skywalking - @@ -117,4 +115,33 @@ + + + skywalking + + + com.spotify + docker-maven-plugin + ${docker.plugin.version} + + false + ${project.basedir}/docker + skywalking/skywalking-webui + + ${project.version} + + + + /skywalking + ${project.build.directory}/${project.build.finalName} + + + /classes + ${project.build.directory}/classes + + + + + + diff --git a/skywalking-webui/src/main/resources/config.properties b/skywalking-webui/src/main/resources/config.properties index 55a951b34d..aadfafb389 100644 --- a/skywalking-webui/src/main/resources/config.properties +++ b/skywalking-webui/src/main/resources/config.properties @@ -1,4 +1,3 @@ - # the registry center connect url (Default: zookeeper) -registrycenter.connect_url=127.0.0.1:2181 +registrycenter.connect_url=localhost:2181 diff --git a/skywalking-webui/src/main/resources/jdbc.properties b/skywalking-webui/src/main/resources/jdbc.properties index 7b7ad2e459..e2268c97f1 100644 --- a/skywalking-webui/src/main/resources/jdbc.properties +++ b/skywalking-webui/src/main/resources/jdbc.properties @@ -1,5 +1,5 @@ jdbc.driverClassName=com.mysql.jdbc.Driver -jdbc.url=jdbc:mysql://localhost:3307/test +jdbc.url=jdbc:mysql://localhost:3306/test jdbc.username=root jdbc.password=root jdbc.maxTotal=200 diff --git a/skywalking-webui/src/main/resources/spring/application-jdbc.xml b/skywalking-webui/src/main/resources/spring/application-jdbc.xml index 494cd25dc2..226d37e09c 100644 --- a/skywalking-webui/src/main/resources/spring/application-jdbc.xml +++ b/skywalking-webui/src/main/resources/spring/application-jdbc.xml @@ -3,6 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:aop="http://www.springframework.org/schema/aop" + xmlns:jdbc="http://www.springframework.org/schema/jdbc" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/tx @@ -10,10 +11,12 @@ http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd http://www.springframework.org/schema/aop - http://www.springframework.org/schema/aop/spring-aop-3.0.xsd"> + http://www.springframework.org/schema/aop/spring-aop-3.0.xsd + http://www.springframework.org/schema/jdbc + http://www.springframework.org/schema/jdbc/spring-jdbc-3.0.xsd"> - + @@ -21,15 +24,19 @@ + class="org.springframework.jdbc.core.JdbcTemplate" lazy-init="true"> + class="org.springframework.jdbc.datasource.DataSourceTransactionManager" lazy-init="true"> + + + + diff --git a/skywalking-webui/src/main/sql/table.mysql b/skywalking-webui/src/main/resources/table.mysql similarity index 100% rename from skywalking-webui/src/main/sql/table.mysql rename to skywalking-webui/src/main/resources/table.mysql -- GitLab