diff --git a/build.pkr.hcl b/build.pkr.hcl index 05a6743..7a55853 100644 --- a/build.pkr.hcl +++ b/build.pkr.hcl @@ -11,7 +11,8 @@ build { "./files/graphdb-cluster-proxy.service", "./files/install_graphdb.sh", "./files/cloudwatch-agent-config.json", - "./files/prometheus.yaml" + "./files/prometheus.yaml", + "./files/graphdb.env" ] destination = "/tmp/" } diff --git a/files/graphdb-cluster-proxy.service b/files/graphdb-cluster-proxy.service index f93f417..804a820 100644 --- a/files/graphdb-cluster-proxy.service +++ b/files/graphdb-cluster-proxy.service @@ -9,9 +9,9 @@ RestartSec=5s User=graphdb Group=graphdb Environment="GDB_JAVA_OPTS=-Dgraphdb.home=/var/opt/graphdb/cluster-proxy -Dgraphdb.home.conf=/etc/graphdb-cluster-proxy -Dhttp.socket.keepalive=true -Xmx1g" -ExecStart="/opt/graphdb/bin/cluster-proxy" +ExecStart=/opt/graphdb/bin/cluster-proxy TimeoutSec=120 SuccessExitStatus=143 [Install] -WantedBy=multi-user.target \ No newline at end of file +WantedBy=multi-user.target diff --git a/files/graphdb.env b/files/graphdb.env new file mode 100644 index 0000000..9fd428f --- /dev/null +++ b/files/graphdb.env @@ -0,0 +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" diff --git a/files/graphdb.service b/files/graphdb.service index b76ebe6..632b108 100644 --- a/files/graphdb.service +++ b/files/graphdb.service @@ -8,10 +8,10 @@ Restart=on-failure RestartSec=5s User=graphdb Group=graphdb -Environment="GDB_JAVA_OPTS=-Dgraphdb.home=/var/opt/graphdb/node -Dgraphdb.home.conf=/etc/graphdb -Dhttp.socket.keepalive=true -XX:MaxRAMPercentage=85.0 -XX:-UseCompressedOops" -ExecStart="/opt/graphdb/bin/graphdb" +EnvironmentFile=/etc/graphdb/graphdb.env +ExecStart=/opt/graphdb/bin/graphdb TimeoutSec=120 SuccessExitStatus=143 [Install] -WantedBy=multi-user.target \ No newline at end of file +WantedBy=multi-user.target diff --git a/files/install_graphdb.sh b/files/install_graphdb.sh index dc05fec..55c8c85 100644 --- a/files/install_graphdb.sh +++ b/files/install_graphdb.sh @@ -53,6 +53,8 @@ rm graphdb-"${GRAPHDB_VERSION}"-dist.zip mv graphdb-"${GRAPHDB_VERSION}" /opt/graphdb-"${GRAPHDB_VERSION}" ln -s /opt/graphdb-"${GRAPHDB_VERSION}" /opt/graphdb +mv /tmp/graphdb.env /etc/graphdb/graphdb.env + chown -R graphdb:graphdb /etc/graphdb \ /etc/graphdb-cluster-proxy \ /opt/graphdb \