Why Jolokia is not working with Elassandra? - jmx

I am using elassandra-6.2.3.4 and jolokia-jvm-1.6.0-agent.jar.
But when I start cassandra with ES using below command : -
./cassandra -e
Then it is showing some error related to json-simple and jolokia jar.
So how can I configure jolokia to access cassandra JMX metrics along with elassandra?
Thank in advance.

Without the error log, it hard to say.
If it's related to "JarHell", it is because the elassandra JVM refuses to start when a duplicated class is found in the classpath.
Probably jolokia-1.6.0 and elasandra-6.2.3.4 have a common dependency "json-simple". You may try to remove this class from the jolokia jar...
Repeat the process until all conflicts are solved.

Related

How to enable broker security in confluent-kafka?

i am trying to enable security in kafka.
i tried with Apache Kafka it worked fine,But now we are using confluent-platform docker image to get all confluent services.
Here i dont know how to enable the kafka ssl security ?
i checked in broker container etc/kafka/ but i didnt no in which file we need change the properties
because there are two files 1)Kafka.properties 2)server.properties
so i am so much confused,
can anyone share your suggestion on this?
What docker image do you use? Please, make sure that you are pulling them from hub.docker.com/r/confluentinc/cp-kafka
Usually, the configuration file for Apache Kafka brokers is server.properties. You do not need to inject the whole config file though. You can configure it with environment variables passed to the container. Please, see cp-demo/blob/6.1.0-post/docker-compose.yml as an example.

Expose metrics for Kotlin using JMX_Exporter to prometheus

I am trying to use JMX_Exporter for my kotlin code to expose metrics to prometheus in order to show it in Grafana. I have gone through many articles and tried to understand how could it be done. I have found below two links useful and trying to achieve using those.
https://github.com/prometheus/jmx_exporter
https://www.openlogic.com/blog/monitoring-java-applications-prometheus-and-grafana-part-1
What i did so far is, created a folder 'prometheus-jmx' in root directory and added mentioned JAR and config.yml file in that folder. Then, i added below parameter to my dockerfile.
CMD java -Xms128m -Xmx256m -javaagent:./jmx_prometheus_javaagent-0.12.0.jar=8080:./config.yml -Dconfig.file=config/routing.conf -cp jagathe-jar-with-
dependencies.jar:./* com.bmw.otd.agathe.AppKt
My prometheus is running in my OpenShift cluster along with my application. I could scrape metrics for my other applications/deployments like Jenkins, SonarQube etc without any modifications in deployment.yml of Prometheus.
My application is running properly now on OpenShift and from application's pod, I can scrape metrics by using below command.
curl http://localhost:portNumber
But on promethus UI, I cant see any JVM or JMX related metric.
Can someone please tell me where and what am i doing wrong? Any kind of help would be appreciated.
After trying many things, I came to know that I needed to expose the port of my application's container in order to let Prometheus or other deployments to know. After exposing the port, I could see my application under targets on Prometheus and I could scrape all JMX and JVM metrics. Hope this would help someone in future...

Unable to follow "Sandbox" links from Mesos UI

I have three physical nodes with docker installed on each of them. I configured Mesos,Marathon,Hadoop,Flink and Zookeeper on them. I can see all UI in my browser and run a Flink application in Marathon.
The problem is that Mesos UI shows me that Flink is running, but when I click on SandBox, I see this error:
Failed to connect to agent '16657705-0573-410a-aef3-e2bb4119092c-S0' on '//50592e835da1:5051/slave(1)/state?jsonp=JSON_CALLBACK'.
Potential reasons:
The agent is not accessible
The agent timed out or went offline
I know it is related to Mesos configuration, but I have no idea what is wrong.
I wrote MESOS_HOSTNAME in /etc/hosts, but it did not work. Also, I sat MESOS_HOSTNAME=IP in mesos-agent-env.sh, but it did not work.
Would you please guide me how I can solve the issue?
Any help would be really appreciated.
Problem solved.
According to the Apache Mesos site, The hostname the agent node should report, or that the master should advertise in ZooKeeper.. I forgot to use --hostname=SlaveIP in slave command; after using it, every thing ran without any errors.
/home/mesos-1.7.2/build/bin/mesos-slave.sh
--master=10.32.0.2:5050,10.32.0.3:5050 --hostname=10.32.0.4
--work_dir=/var/run/mesos --log_dir=/var/log/mesos
--systemd_enable_support=false

how to mange dependent docker services

I have two dockers one containing a Cassandra server and one containing a jetty server which has my application.
both dockers use chef-solo for configuration and for running tasks after the jetty and the Cassandra start.
in the Cassandra docker, we run the keyspace creation after the server has started.
and in the jetty, we preload data into the system after the server started.
the problem is that I need to know when the Cassandra docker has completed its initialization before I can start the jetty because in order to preload the data I need a connection to thew Cassandra.
my question is how can this be achieved?
is there a docker commend that can notify the system my docker is ready?
is there a way to check the chef if it completed its initialization?
perhaps I need another approach?
suggestions will be welcomed.
No, there's no native way to do this in Docker - and the reasoning for that is because it's not how containers should be used. Your image is your application; and provisioning should not be happening upon coming online.
What you should do here is add your Chef scripts into a Dockerfile and build your image from it; that way you're ready to go when you run the application.
However if you'd like to control start-up order; you wait for the container to be running before starting another; but it will not wait until it is "ready". Further reading on this can be found here.
Good luck!

Neo4j server failed to start in openshift

I want to create a social network in django framework in Openshift then I need at least a graph db (like Neo4j)and a relational db (like Mysql). I had trouble in add Neo4j to my project because openshift has not any cartridge for it. then I decide to install it with DIY, but I don't understand the functionality of start and stop files in .openshift/action hooks.Then I doing the following steps to install neo4j on server:
1.ssh to my account:
ssh 1238716...#something-prolife.rhcloud.com
2.go in a folder that have permission to write (I go to app-root/repo/ and mkdir test in it) and download the neo4j package from here. and extract it to the test folder that I created before :
tar -xvzf neo4j-community-1.9.4-unix.tar.gz
3.and finally run the neo4j file and start it:
neo4j-community-1.9.4/bin/neo4j start
but I see these logs and can't run the neo4j:
process [3898]... waiting for server to be ready............ Failed
to start within 120 seconds.
Neo4j Server may have failed to start, please check the logs.
how can I run this database in openshift ? where I am wrong ? and where is the logs in please check the logs?
I've developed an openshift cartridge that fixes the permission issue in openshift. I had to change the class HostBoundSocketFactory and SimpleAppServer in neo4j just to bind without using the 0 port, but using an openshift available port.
You can check at: https://github.com/danielnatali/openshift-neo4j-cartridge
it's working for me.
I would also not place it in the app-root/repo but instead I would put it in app-root/data.
You also need to use the IP of the gear - I think the env. variable is something like OPENSHIFT_INTERAL_IP. 127.0.0.1 is not available for binding but I think the ports should be open.
There are 2 ways neo4j can run : embedded or standalone(exposed via a rest service).
Standalone is what you are trying to do. I think the right way to setup neo4j would be by writing a cartridge for openshift, and then add the cartridge to your gear. There has been some discussion about this, but it seems that nobody has taken the time to do this. Check https://www.openshift.com/forums/openshift/neo4j-cartridge. If you decide to write your own cartridge, i might assist. Here are the docs: https://www.openshift.com/developers/download-cartridges.
The other option is running in embedded mode, which i have used. You need to set up a Java EE application(because neo4j embedded mode libraries are available only with java), and put the neo4j libraries in your project. Then, you would expose some routes, check for parameters and run your neo4j queries inside the servlets.

Resources