Chronos "Force Run" via API - mesos

On Chronos WebUI, I can "Force Run" jobs and immediately get results.
Is it possible to perform "Force Run" via Chronos REST API?
Thank you.

Jobs can be manually triggered with a PUT to /scheduler/job/$JOB_NAME. For example:
curl -L -X PUT chronos-node:8080/scheduler/job/$JOB_NAME
See https://github.com/mesos/chronos#manually-starting-a-job.

Related

Why does ApplicationStart timeout with AWS code deploy?

I am using codedeploy to deploy a springboot app to an ec2. But I keep getting a script timeout error. I event set the timeout to 60 seconds event tho the application always starts up within 20 seconds. The application starts up fine. I run top on the linux instance and see the java process started up. I can then use postman to hit the http status check endpoint and confirm that it has started up successfully. But this is what it looks like in the code deploy console:
The appspec.yml file looks like this
The server_start.sh file looks like this.
Why is this happening? Thanks.
I think this has more to do with how Linux process works than with Code Build. I'm far from being a specialist on that, but according to with AWS documentation, there is a certain way you must use to start your long-running processes, as a Java application
The syntax is:
#!/bin/bash
/tmp/sleep.sh > /dev/null 2> /dev/null < /dev/null &
Replace the sleep by your Java command.
More details here
You should put some some codes of your script to the BeforeInstall or AfterInstall.
remove java -jar application.jar
BeforeInstall – You can use this deployment lifecycle event for preinstall tasks, such as decrypting files and creating a backup of the current version.
Install – During this deployment lifecycle event, the CodeDeploy agent copies the revision files from the temporary location to the final destination folder. This event is reserved for the CodeDeploy agent and cannot be used to run scripts.
AfterInstall – You can use this deployment lifecycle event for tasks such as configuring your application or changing file permissions.
ApplicationStart – You typically use this deployment lifecycle event to restart services that were stopped during ApplicationStop.
Then create another bash script for your ApplicationStart. Put the line your removed earlier on this script.

send event to local datadog agent via shell

I'm trying to send events to my local datadog agent by shell through DataStatsD port. The message is sent without errors but doesn't reach the dashboard.
I use datadog agent in version 6.9 and use datadog documentation:
https://docs.datadoghq.com/developers/dogstatsd/datagram_shell/#send-metrics-and-events-using-dogstatsd-and-the-shell
When I try to send metrics is work fine and I see the metrics in the datadog dashboard but when I send events it's doesn't show in the dashboard.
I also see that when I send event via shell and then check agent status the number of metrics packets go up but the number of events is still 0.
That's the command i run:
~$ title="Event from the shell"
~$ text="This was sent from Bash!"
~$ echo “_e{${#title},${#text}}:$title|$text|#shell,bash"
>/dev/udp/localhost/8125
Edit When I changed the following configuration properties it's work.
The configuration I changed:
1) dogstatsd_non_local_traffic: yes
2) bind_host: localhost

Waiting on Nomad server

I am currently trying to build some integrations tests with Nomad.
For that I try:
nomad agent -dev -config=test.conf&
nomad run test.nomad
which of course fails, since it tries to submit the job before the server is running.
The bad option would be to insert a sleep.
My question is, whether there is a better way to wait until the server is up and accepts jobs.
So a only halfway hacky solution is:
wait_for_agent() {
while test -z $(curl -s http://127.0.0.1:4646/v1/agent/health)
do
sleep 1
done
}
Another hack :-)
nomad agent -dev -config=test.conf && nomad run test.nomad

API + restart the services that restart is required

after adding new parameter and value to the ambari cluster , we need to restart the service to take affect
from ambari GUI restart the service is required , and we can see that because restart button is colored with orange
so my question is
we need API command that restart only the services that restart is required?
in order to restart all relevant services ( that need's restart ) the following syntax is the answer
curl -u admin:admin -H "X-Requested-By: ambari" -X POST -d '{"RequestInfo":{"command":"RESTART","context":"Restart all required services","operation_level":"host_component"},"Requests/resource_filters":[{"hosts_predicate":"HostRoles/stale_configs=true"}]}' http://amb25101.example.com:8080/api/v1/clusters/plain_ambari/requests

Marathon event subscriptions

have been trying to enable event subscriptions. I found the Marathon REST API. I attempted to restart marathon with the "--event_subscriber http_callback" and created the "event_subscriber" and "http_endpoints". When i restart it shows " --http_endpoints http://localhost:1234/" and I am running "nc -l -p 1234" to listen to the port. I am not getting anything when i create new apps.
It seems that i am having trouble enabling it. As i keep getting the error.
"http event callback system is not running on this Marathon instance. Please re-start this instance with \"--event_subscriber http_callback\"
Maybe i am missing something? Any help is much appreciated. Thanks.
Issue resolved! i fixed it by running the following command
marathon --jar --master zk://your_ip:5050,your_ip:5050,your_ip:5050/mesos --event_subscriber http_callback
and to get it to take restart marathon on ALL masters
sudo service marathon restart
Once back up check the page and you should be good to go.

Resources