Last active
July 13, 2016 12:26
-
-
Save dawngerpony/58d9cd44d4f033a7094ebdae67452585 to your computer and use it in GitHub Desktop.
Useful Neo4j CoCo commands
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
while true; do | |
echo -n "RED: "; fleetctl ssh neo4j-red@1.service uptime | |
echo -n "BLUE: "; fleetctl ssh neo4j-blue@1.service uptime | |
sleep 15 | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
neo4j-blue-sidekick@1.service 177bf386.../172.24.99.92 inactive dead | |
neo4j-blue@1.service 177bf386.../172.24.99.92 active running | |
neo4j-read-blue-sidekick@1.service 177bf386.../172.24.99.92 inactive dead | |
neo4j-read-red-sidekick@1.service 07c72444.../172.24.151.154 active exited | |
neo4j-red-sidekick@1.service 07c72444.../172.24.151.154 inactive dead | |
neo4j-red@1.service 07c72444.../172.24.151.154 active running |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## measure resource usage on CoreOS box running Neo4j red. | |
fleetctl ssh neo4j-red@1.service top | |
## Check the status of all sidekick processes | |
fleetctl list-units | grep ^neo | grep sidekick | awk '{print $1;}' | xargs -I '{}' fleetctl status {} | |
## Stop all sidekick processes | |
fleetctl list-units | grep ^neo | grep sidekick | awk '{print $1;}' | xargs -I '{}' fleetctl stop {} | |
## Capture the load average of both neo4j boxes every 10 seconds ad infinitum | |
while true; do echo -n "RED: "; fleetctl ssh neo4j-red@1.service uptime; echo -n "BLUE: "; fleetctl ssh neo4j-blue@1.service uptime; sleep 10; done | |
## Moving the above script into its own file I can use tee to capture the output and send it to console as well for convenience. | |
./monitor-load.bash | tee load-average.out | |
## List all services that interact with Neo4j (read/writers and public API services, exclude sidekicks) | |
fleetctl list-units | egrep '(\-rw\-red|\-rw\-neo4j\-red|public\-[a-z]+\-api)' | grep -v sidekick | |
## Shut down all the above Neo4j-related services. | |
fleetctl list-units | egrep '(\-rw\-red|\-rw\-neo4j\-red|public\-[a-z]+\-api)' | grep -v sidekick | awk '{print $1;}' | xargs -I '{}' fleetctl stop {} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Starting all neo4j r/w services: