diff --git a/setup/start/logrotate/platform b/setup/start/logrotate/platform index 655a7c45f..ab6971a5d 100644 --- a/setup/start/logrotate/platform +++ b/setup/start/logrotate/platform @@ -8,7 +8,6 @@ /home/yellowtent/platformdata/logs/postgresql/*.log /home/yellowtent/platformdata/logs/sftp/*.log /home/yellowtent/platformdata/logs/redis-*/*.log -/home/yellowtent/platformdata/logs/collectd/*.log /home/yellowtent/platformdata/logs/turn/*.log /home/yellowtent/platformdata/logs/updater/*.log { # only keep one rotated file, we currently do not send that over the api diff --git a/setup/start/systemd/cloudron-resize-fs.service b/setup/start/systemd/cloudron-resize-fs.service index 26b431929..60c01267a 100644 --- a/setup/start/systemd/cloudron-resize-fs.service +++ b/setup/start/systemd/cloudron-resize-fs.service @@ -4,7 +4,7 @@ [Unit] Description=Cloudron FS Resizer -Before=docker.service collectd.service mysql.service sshd.service nginx.service +Before=docker.service mysql.service sshd.service nginx.service After=cloud-init.service [Service] diff --git a/src/metrics.js b/src/metrics.js index 6b0481088..362e99515 100644 --- a/src/metrics.js +++ b/src/metrics.js @@ -206,7 +206,7 @@ async function sendToGraphite() { return new Promise((resolve) => { const client = new net.Socket(); - client.connect(constants.GRAPHITE_PORT, '127.0.0.1', () => { + client.connect(constants.GRAPHITE_PORT, constants.GRAPHITE_SERVICE_IPv4, () => { const now = Math.floor(Date.now() / 1000); for (const metric of graphiteMetrics) { diff --git a/src/scripts/restartservice.sh b/src/scripts/restartservice.sh index 00bd65815..63026340b 100755 --- a/src/scripts/restartservice.sh +++ b/src/scripts/restartservice.sh @@ -31,8 +31,6 @@ elif [[ "${service}" == "nginx" ]]; then fi elif [[ "${service}" == "docker" ]]; then systemctl restart --no-block docker -elif [[ "${service}" == "collectd" ]]; then - systemctl restart --no-block collectd elif [[ "${service}" == "box" ]]; then systemctl reload --no-block box else diff --git a/src/services.js b/src/services.js index 83af0c5db..36a7e9640 100644 --- a/src/services.js +++ b/src/services.js @@ -1781,7 +1781,6 @@ async function startGraphite(existingInfra) { const readOnly = !serviceConfig.recoveryMode ? '--read-only' : ''; const cmd = serviceConfig.recoveryMode ? '/bin/bash -c \'echo "Debug mode. Sleeping" && sleep infinity\'' : ''; - // port 2003 is used by collectd const runCmd = `docker run --restart=unless-stopped -d --name=graphite \ --hostname graphite \ --net cloudron \ @@ -1793,7 +1792,6 @@ async function startGraphite(existingInfra) { -m ${memoryLimit} \ --memory-swap -1 \ --ip ${constants.GRAPHITE_SERVICE_IPv4} \ - -p 127.0.0.1:2003:2003 \ -v ${paths.PLATFORM_DATA_DIR}/graphite:/var/lib/graphite \ --label isCloudronManaged=true \ ${readOnly} -v /tmp -v /run ${image} ${cmd}`; @@ -1808,9 +1806,6 @@ async function startGraphite(existingInfra) { await shell.bash(runCmd, { encoding: 'utf8' }); if (existingInfra.version !== 'none' && existingInfra.images.graphite !== image) await docker.deleteImage(existingInfra.images.graphite); - - // restart collectd to get the disk stats after graphite starts. currently, there is no way to do graphite health check - setTimeout(async () => await safe(shell.sudo([ RESTART_SERVICE_CMD, 'collectd' ], {})), 60000); } async function setupProxyAuth(app, options) { @@ -2123,11 +2118,6 @@ async function statusGraphite() { async function restartGraphite() { await docker.restartContainer('graphite'); - - setTimeout(async () => { - const [error] = await safe(shell.sudo([ RESTART_SERVICE_CMD, 'collectd' ], {})); - if (error) debug(`restartGraphite: error restarting collected. ${error.message}`); - }, 60000); } async function teardownOauth(app, options) {