Re-organize docker files for Zipkin server
Still not quite working: $ docker-compose -f docker-compose.yml -f docker-compose.zipkin.yml up everything starts up fine (once the database is initialized), but the zipkin server is not listening to rabbit (and there are errors in the logs).
This commit is contained in:
@@ -1,20 +0,0 @@
|
||||
query:
|
||||
image: springio/zipkin-server
|
||||
environment:
|
||||
- MYSQL_HOST=storage
|
||||
expose:
|
||||
- 9411
|
||||
ports:
|
||||
- 9411:9411
|
||||
links:
|
||||
- mysql:storage
|
||||
- rabbitmq:messages
|
||||
web:
|
||||
image: openzipkin/zipkin-web:1.25.0
|
||||
ports:
|
||||
- 8080:8080
|
||||
environment:
|
||||
- TRANSPORT_TYPE=http
|
||||
- WEB_LOG_LEVEL=DEBUG
|
||||
links:
|
||||
- query
|
||||
21
spring-cloud-sleuth-zipkin-stream/docker-compose.zipkin.yml
Normal file
21
spring-cloud-sleuth-zipkin-stream/docker-compose.zipkin.yml
Normal file
@@ -0,0 +1,21 @@
|
||||
zipkin:
|
||||
image: springio/spring-cloud-sleuth-zipkin-stream
|
||||
environment:
|
||||
- MYSQL_HOST=mysql
|
||||
- RABBIT_HOST=rabbitmq
|
||||
expose:
|
||||
- 9411
|
||||
ports:
|
||||
- 9411:9411
|
||||
links:
|
||||
- mysql
|
||||
- rabbitmq
|
||||
web:
|
||||
image: openzipkin/zipkin-web:1.25.3
|
||||
ports:
|
||||
- 8080:8080
|
||||
environment:
|
||||
- TRANSPORT_TYPE=http
|
||||
- WEB_LOG_LEVEL=DEBUG
|
||||
links:
|
||||
- zipkin:query
|
||||
@@ -28,19 +28,11 @@
|
||||
<artifactId>spring-boot-configuration-processor</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-stream-rabbit</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<artifactId>objenesis</artifactId>
|
||||
<groupId>org.objenesis</groupId>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
@@ -57,6 +49,16 @@
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-sleuth-stream</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.integration</groupId>
|
||||
<artifactId>spring-integration-jmx</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-stream-binder-rabbit</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-cloud-connectors</artifactId>
|
||||
@@ -89,7 +91,7 @@
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-stream-test-support</artifactId>
|
||||
<artifactId>spring-cloud-stream-binder-local</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@@ -106,23 +108,57 @@
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>${project.basedir}/src/main/resources</directory>
|
||||
</resource>
|
||||
<resource>
|
||||
<directory>${project.build.directory}/generated-resources</directory>
|
||||
</resource>
|
||||
</resources>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<classifier>exec</classifier>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<!-- Serves *only* to filter the Dockerfile so it can get an absolute
|
||||
path for the project -->
|
||||
<id>copy-resources</id>
|
||||
<phase>validate</phase>
|
||||
<goals>
|
||||
<goal>copy-resources</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>${basedir}/target/generated-docker</outputDirectory>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/docker</directory>
|
||||
<filtering>true</filtering>
|
||||
</resource>
|
||||
</resources>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>com.spotify</groupId>
|
||||
<artifactId>docker-maven-plugin</artifactId>
|
||||
<version>0.3.5</version>
|
||||
<version>0.3.8</version>
|
||||
<configuration>
|
||||
<imageName>${docker.image.prefix}/${project.artifactId}</imageName>
|
||||
<dockerDirectory>src/main/docker</dockerDirectory>
|
||||
<dockerDirectory>${basedir}/target/generated-docker</dockerDirectory>
|
||||
<resources>
|
||||
<resource>
|
||||
<targetPath>/</targetPath>
|
||||
<directory>${project.build.directory}</directory>
|
||||
<include>${project.build.finalName}.jar</include>
|
||||
<include>${project.build.finalName}-exec.jar</include>
|
||||
</resource>
|
||||
</resources>
|
||||
</configuration>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
FROM frolvlad/alpine-oraclejdk8
|
||||
VOLUME /tmp
|
||||
ADD spring-cloud-sleuth-zipkin-stream-1.0.0.BUILD-SNAPSHOT.jar app.jar
|
||||
ADD @project.artifactId@-@project.version@-exec.jar app.jar
|
||||
RUN sh -c 'touch /app.jar'
|
||||
EXPOSE 9411
|
||||
CMD ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"]
|
||||
|
||||
@@ -5,10 +5,10 @@ import org.springframework.boot.builder.SpringApplicationBuilder;
|
||||
|
||||
@SpringBootApplication
|
||||
@EnableZipkinStreamServer
|
||||
public class ZipkinQueryServerApplication {
|
||||
public class ZipkinStreamServerApplication {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
new SpringApplicationBuilder(ZipkinQueryServerApplication.class)
|
||||
new SpringApplicationBuilder(ZipkinStreamServerApplication.class)
|
||||
.properties("spring.config.name=zipkin-server").run(args);
|
||||
}
|
||||
|
||||
@@ -2,13 +2,15 @@ server:
|
||||
port: 9411
|
||||
|
||||
spring:
|
||||
rabbitmq:
|
||||
host: ${RABBIT_HOST:localhost}
|
||||
datasource:
|
||||
schema: classpath:/mysql.sql
|
||||
url: jdbc:mysql://${MYSQL_HOST:localhost}/test
|
||||
username: root
|
||||
password: root
|
||||
# Switch this on to create the schema on startup:
|
||||
initialize: false
|
||||
initialize: true
|
||||
continueOnError: true
|
||||
sleuth:
|
||||
enabled: false
|
||||
|
||||
@@ -7,24 +7,23 @@ import org.junit.runner.RunWith;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.IntegrationTest;
|
||||
import org.springframework.boot.test.SpringApplicationConfiguration;
|
||||
import org.springframework.cloud.sleuth.zipkin.stream.ZipkinQueryServerApplication;
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
import org.springframework.test.context.ActiveProfiles;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
|
||||
import io.zipkin.SpanStore;
|
||||
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@SpringApplicationConfiguration(classes = ZipkinQueryServerApplication.class)
|
||||
@SpringApplicationConfiguration(classes = ZipkinStreamServerApplication.class)
|
||||
@IntegrationTest({ "server.port=0", "spring.datasource.initialize=true" })
|
||||
@ActiveProfiles("test")
|
||||
public class ZipkinServerApplicationTests {
|
||||
|
||||
@Autowired
|
||||
private JdbcTemplate jdbcTemplate;
|
||||
private SpanStore store;
|
||||
|
||||
@Test
|
||||
public void contextLoads() {
|
||||
int count = this.jdbcTemplate.queryForObject("SELECT COUNT(*) FROM zipkin_spans",
|
||||
Integer.class);
|
||||
int count = this.store.getServiceNames().size();
|
||||
assertEquals(0, count);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user