Node.JS not starting on all Virtualmin cluster nodes

SYSTEM INFORMATION
OS type and version Almalinux 9.6
Webmin version 2.402
Virtualmin version 7.30.8 Pro
Webserver version httpd-2.4.62-4.el9.x86_64
Related packages SUGGESTED

Running 2 virtualmin servers, with shared storage on NFS to host multiple PHP based websites and it’s working fine. We create the site(s) on server-1 and use the CLI to keep config in sync between the 2 servers.

virtualmin transfer-domain --domain example.org --host server-2 --replication --output --overwrite

Now we need to deploy a NodeJS application and it seems to work fine on server-1 and the nodejs service is started.

But after a sync from server-1 > server-2 we are not able to start the nodejs service on server-2. I am using the same command as before.

virtualmin transfer-domain --domain nodejs.example.org --host server-2 --replication --output --overwrite

Is this setup not supported on Virtualmin or do i need to create the config in a different way?

Thanks.

Okay, I have done some more digging.
It seems that the issue is that the

virtualmin transfer-domain --domain nodejs.example.com --host server-2 --replication --output --overwrite

Does not create the needed systemctl services.

After a replication I created the service on server-2 manually using the same config from server-1

systemctl edit --full --force nodejs-nodejs.example.com-3000.service
systemctl daemon-reload
systemctl enable nodejs-nodejs.example.com-3000.service --now

Then it worked. even after a replication the services are still running.

So maybe this could be a thing to add to the replication feature of virtualmin ?

Kind regards.

1 Like

@Jamie, is this something you have already fixed for upcoming Virtualmin 7.40.0?

Does the same thing happen if you create a test domain with node.js, back it up, delete it, and then restore the backup?

Sorry for the late reply.

I did the following to test.

Deleteded the replicated site on server-2, the systemctl service was not removed, then again i created it manually.

Did a backup of the site on server-1 and restored it on server-2 and the service is also restored at server-2.

Hope that help else let me know :slight_smile:

If you just create a domain and install node.js, does a systemd service to start the node server get created?

And then if you just delete that domain, does the systemd service get removed as well?

If I create the NodeJS with the script installer it creates the service, if I then delete the NodeJS via the script installer it removes the service.
If I delete the site entirely it also removes the service as expected.

Only when I use the CLI to replicate it does the service not work on the destination host.

So the replication basically just does a backup on one system and a restore on the other. If you do this manually, does the Node.JS systemd action get created?

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.