diff --git a/files/graphdb.env b/files/graphdb.env index 9fd428f..5802dd3 100644 --- a/files/graphdb.env +++ b/files/graphdb.env @@ -1 +1 @@ -GDB_JAVA_OPTS="-Dgraphdb.home=/var/opt/graphdb/node -Dgraphdb.home.conf=/etc/graphdb -Dhttp.socket.keepalive=true -XX:MaxRAMPercentage=85.0 -XX:-UseCompressedOops" +GDB_JAVA_OPTS="-javaagent:/opt/graphdb/applicationinsights-agent.jar -Dgraphdb.home=/var/opt/graphdb/node -Dgraphdb.home.conf=/etc/graphdb -Dhttp.socket.keepalive=true -XX:MaxRAMPercentage=85.0 -XX:-UseCompressedOops" diff --git a/files/graphdb_backup b/files/graphdb_backup index 4dbd197..52ca5a7 100644 --- a/files/graphdb_backup +++ b/files/graphdb_backup @@ -18,6 +18,10 @@ retry_count=0 perform_backup() { while [ "$retry_count" -lt "$max_retries" ]; do + current_time=$(date +"%T %Y-%m-%d") + echo "#####################################" + echo "Begin backup creation ${current_time}" + echo "#####################################" start_time=$(date +%s) response_code=$(curl -X POST --write-out %{http_code} --silent --output /dev/null \ @@ -62,11 +66,11 @@ IS_CLUSTER=$( if [ "$IS_CLUSTER" == 200 ]; then # Checks if the current GraphDB instance is Leader, otherwise exits. if [ "$NODE_STATE" != "LEADER" ]; then - echo "The current node is not the leader, but $NODE_STATE" + echo "The current node is not the leader, but $NODE_STATE. Exiting" exit 0 fi - perform_backup + perform_backup | tee -a /var/opt/graphdb/node/graphdb_backup.log elif [ "$IS_CLUSTER" == 503 ]; then - perform_backup + perform_backup | tee -a /var/opt/graphdb/node/graphdb_backup.log fi diff --git a/files/install_graphdb.sh b/files/install_graphdb.sh index b25eb79..7098dbe 100644 --- a/files/install_graphdb.sh +++ b/files/install_graphdb.sh @@ -112,6 +112,14 @@ echo 'fs.file-max = 262144' | tee -a /etc/sysctl.conf sysctl -p +echo "##################################################" +echo "# Setting Azure Application Insights agent #" +echo "##################################################" + +wget -P /opt/graphdb/ https://github.com/microsoft/ApplicationInsights-Java/releases/download/3.4.19/applicationinsights-agent-3.4.19.jar +ln -s /opt/graphdb/applicationinsights-agent-3.4.19.jar /opt/graphdb/applicationinsights-agent.jar +chown graphdb:graphdb /opt/graphdb/applicationinsights-agent.jar + echo "###################################" echo "# Provisioning Backup Script #" echo "###################################"