Skip to content

Instantly share code, notes, and snippets.

@franekrichardson
Last active July 31, 2019 13:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save franekrichardson/136f6341c5031b1eef96cca06f41ba81 to your computer and use it in GitHub Desktop.
Save franekrichardson/136f6341c5031b1eef96cca06f41ba81 to your computer and use it in GitHub Desktop.
fix-metricscluster-uri
#!/bin/bash
set -e
##################################
#
# BUILD THE SCRIPT FILES
cat <<EOF > fix-metricscluster-uri.fssh
import com.fasterxml.jackson.databind.node.TextNode
val res = zk"/services/adminconsole/settings".update { json =>
json.getNodePath("found.adminconsole.regions.ece-region.metrics-cluster").getOptional("server_url").foreach { _ =>
json.setPath("found.adminconsole.regions.ece-region.metrics-cluster.server_url", TextNode.valueOf("http://containerhost:9244"))
}
json
}.result()
println(res)
EOF
docker run --env SHELL_JAVA_OPTIONS='-Dfound.shell.exec=/hostpwd/fix-metricscluster-uri.fssh' \
-v $(pwd):/hostpwd -v ~/.found-shell:/elastic_cloud_apps/shell/.found-shell \
--env SHELL_ZK_AUTH=$(docker exec -it frc-directors-director bash -c 'echo -n $FOUND_ZK_READWRITE') $(docker inspect -f '{{ range .HostConfig.ExtraHosts }} --add-host {{.}} {{ end }}' frc-directors-director) --rm -it $(docker inspect -f '{{ .Config.Image }}' frc-directors-director) \
/elastic_cloud_apps/shell/run-shell.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment