Zipkin as cluster

158 views
Skip to first unread message

Prabhu shanmughapriyan

unread,
Apr 5, 2018, 11:36:43 AM4/5/18
to zipkin-user
Hi,

Can we run Zipkin as a cluster environment. I have a zipkin which is linked to ElasticSearch Cluster which is working fine. But i am thinking of creating seperate Zipkin nodes.

And does Zipkin does any processing on the spans.? should i allocate any memory to the node?

Adrian Cole

unread,
Apr 5, 2018, 8:12:20 PM4/5/18
to zipki...@googlegroups.com
zipkin servers are designed to be stateless. Even in the rare cases
where there is some caching going on, nodes are not interdependent..
it is just an optimization.
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "zipkin-user" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to zipkin-user...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Prabhu shanmughapriyan

unread,
Apr 5, 2018, 8:28:29 PM4/5/18
to zipki...@googlegroups.com
Thank you.. that is helpful.

Adrian Cole

unread,
Apr 5, 2018, 8:36:11 PM4/5/18
to zipki...@googlegroups.com
no prob!

Shiv Gupta

unread,
Apr 6, 2018, 12:42:37 PM4/6/18
to zipkin-user
Hello Prabhu,

I am also trying to Integrate Zipkin with Elasticsearch , the below i did in my machine -

java -jar zipkin-server-2.6.1-exec.jar STORAGE_TYPE=elasticsearch ES_HOSTS=http://localhost:9200

and Zipkin server is up and running with storage stype Elasticsearch now i want to see the traces in the elasticsearch engine , please let me know what kind of sample demo i can built and make it up and running , any suggestion would be great help.

Prabhu shanmughapriyan

unread,
Apr 6, 2018, 12:54:25 PM4/6/18
to zipki...@googlegroups.com
Hi Shiv,

I did a simple Spring boot app to check this out. I have pasted my pom.xml and application.yml for reference. 


<?xml version="1.0" encoding="UTF-8"?>

<project xmlns="http://maven.apache.org/POM/4.0.0" 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">

<modelVersion>4.0.0</modelVersion>


<groupId>com.prabhu</groupId>

<artifactId>tracing</artifactId>

<version>1.0.0</version>

<packaging>jar</packaging>


<name>tracing-child</name>

<description>Demo project for Spring Boot</description>


<parent>

<groupId>org.springframework.boot</groupId>

<artifactId>spring-boot-starter-parent</artifactId>

<version>2.0.0.RELEASE</version>

<relativePath/>

</parent>


<properties>

<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

<java.version>1.8</java.version>

<spring-cloud.version>Finchley.M9</spring-cloud.version>

</properties>


<dependencies>

<dependency>

<groupId>org.springframework.boot</groupId>

<artifactId>spring-boot-starter-web-services</artifactId>

</dependency>

<dependency>

<groupId>org.springframework.cloud</groupId>

<artifactId>spring-cloud-starter-sleuth</artifactId>

</dependency>

<dependency>

<groupId>org.springframework.cloud</groupId>

<artifactId>spring-cloud-starter-zipkin</artifactId>

</dependency>


<dependency>

<groupId>org.springframework.boot</groupId>

<artifactId>spring-boot-starter-test</artifactId>

<scope>test</scope>

</dependency>

</dependencies>


<dependencyManagement>

<dependencies>

<dependency>

<groupId>org.springframework.cloud</groupId>

<artifactId>spring-cloud-dependencies</artifactId>

<version>${spring-cloud.version}</version>

<type>pom</type>

<scope>import</scope>

</dependency>

</dependencies>

</dependencyManagement>


<build>

<plugins>

<plugin>

<groupId>org.springframework.boot</groupId>

<artifactId>spring-boot-maven-plugin</artifactId>

</plugin>

</plugins>

</build>


<repositories>

<repository>

<id>spring-milestones</id>

<name>Spring Milestones</name>

<url>https://repo.spring.io/milestone</url>

<snapshots>

<enabled>false</enabled>

</snapshots>

</repository>

</repositories>



</project>



server:

  port: 3381


spring:

  application:

    # This ends up as the service name in zipkin

    name: child-service

  zipkin:

#    # Uncomment to send to zipkin, replacing 192.168.99.100 with your zipkin IP address

     baseUrl: http://54.173.72.64:3310/

  sleuth:

    sampler:

      probability: 1


there is no specific code changes needed if you are using latest spring boot starter parent.

If you are using earlier than this version,, you might need to set up this bean in your Spring boot config java

/**

 * this is needed for OpenZipkin to work

 * 

 * @return

 */

@Bean

public AlwaysSampler alwaysSampler() {

return new AlwaysSampler();

}



--

---
You received this message because you are subscribed to the Google Groups "zipkin-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to zipkin-user+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Thanks and Regards....

Prabhu Shan

Shiv Gupta

unread,
Apr 6, 2018, 2:21:49 PM4/6/18
to zipkin-user
thanks prabhu for sharing valuable info since i am colpletely new to this spring world not sure what to do , if you can provide sample app and steps tp run then it would be great.
To unsubscribe from this group and stop receiving emails from it, send an email to zipkin-user...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Prabhu shanmughapriyan

unread,
Apr 6, 2018, 2:47:57 PM4/6/18
to zipki...@googlegroups.com
Ok np.. Will send it out over weekend 

Shiv Gupta

unread,
Apr 6, 2018, 2:55:43 PM4/6/18
to zipkin-user
Thanks a lot prabhu please also do mention steps to make it run with zipkin.

Shiv Gupta

unread,
Apr 9, 2018, 4:40:45 AM4/9/18
to zipkin-user
Prabhu, would you please share the above .

Prabhu shanmughapriyan

unread,
Apr 10, 2018, 8:12:45 AM4/10/18
to zipki...@googlegroups.com
Shiv,


It maven spring boot project. 

  1. Extract the jar file 
  2. Import using eclipse as maven project
  3. Change the Zipkin URL in the application.yml file 
  4. Start the Spring boot application from - TracingChildApplication.java
  5. Open browser and hit http://localhost:3381/trace/success
  6. You should see something similar provided if the Zipkin is setup properly.




To unsubscribe from this group and stop receiving emails from it, send an email to zipkin-user+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Shiv Gupta

unread,
Apr 10, 2018, 10:08:38 AM4/10/18
to zipkin-user
Thanks Prabhu for sharing this, so just an ask my zipkin has to be up and running before starting this app right? and do we need any other app/webserver to start this application?

Prabhu shanmughapriyan

unread,
Apr 10, 2018, 10:31:56 AM4/10/18
to zipki...@googlegroups.com
Yes.. zipkin must be running and no need for app server as spring boot embeds tomcat.. so just start as a simple java application. 

Shiv Gupta

unread,
Apr 10, 2018, 12:25:46 PM4/10/18
to zipkin-user
Hello Prabhu ,

I tried to run this but getting error below-

Exception in thread "main" java.lang.NoClassDefFoundError: org/springframework/context/ApplicationContextInitializer
at org.springframework.boot.SpringApplication.<init>(SpringApplication.java:266)
at org.springframework.boot.SpringApplication.<init>(SpringApplication.java:247)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1246)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1234)
at com.prabhu.child.TracingChildApplication.main(TracingChildApplication.java:23)
Caused by: java.lang.ClassNotFoundException: org.springframework.context.ApplicationContextInitializer
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 5 more


the below is YML file -

server:
  port: 3381

spring:
  application:
    # This ends up as the service name in zipkin
    name: child-service
  zipkin:
#    # Uncomment to send to zipkin, replacing 192.168.99.100 with your zipkin IP address
  sleuth:
    sampler:
      probability: 1


Please suggest.

Prabhu shanmughapriyan

unread,
Apr 10, 2018, 12:47:50 PM4/10/18
to zipki...@googlegroups.com
Shiv,

Since this is nothing to do with Zipkin, i think it is not wise to flood the groups inbox on non-Zipkin related issues. You can ping me in hangout, we will see what is the issue in your case. I think this is some issue with eclipse setup.

To unsubscribe from this group and stop receiving emails from it, send an email to zipkin-user+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Shiv Gupta

unread,
Apr 11, 2018, 9:38:24 AM4/11/18
to zipkin-user
Thanks a lot prabhu, now i am able to see the traces to zipkin UI now my question is since i started zipkin with Elasticsearch storage , so i would i be able to see the traces in the kibana if so how?
Reply all
Reply to author
Forward
0 new messages