SCADA-LTS / linux-installer

The Scada-LTS installer development project for Linux
GNU General Public License v2.0
2 stars 1 forks source link

ScadaLTS installer trouble #4

Closed nex2000 closed 9 months ago

nex2000 commented 9 months ago

I installed LTS via linux installer the first time LTS ran but after a reboot I get this error.

Caused by: java.net.ConnectException: Connessione rifiutata (Connection refused)

3-Nov-2023 19:34:57.446 AVVERTENZA [main] org.apache.catalina.core.NamingContextListener.addResource Failed to register in JMX: [javax.naming.NamingExceptio>

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.]] 23-Nov-2023 19:34:58.021 INFORMAZIONI [main] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enabl> 23-Nov-2023 19:35:00.483 AVVERTENZA [main] org.apache.tomcat.jdbc.pool.ConnectionPool.checkPoolConfiguration maxIdle is larger than maxActive, setting maxIdl> 23-Nov-2023 19:35:00.499 GRAVE [main] org.apache.tomcat.jdbc.pool.ConnectionPool.init Unable to create initial connections of pool. com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.

Regards

weschenfelder commented 9 months ago

Hello @nex2000, normally the error reported occurs due to a lack of permission in the installation directory and/or in the database user.

So the community can help, please provide details of how you want to host the service.

~ F. Weschenfelder

nex2000 commented 9 months ago

Thanks for the reply I followed the installation suggestions as described on GIT. I think the problem is on mysql because tomcat works fine I tested it with ScadaBR's WAR file.

weschenfelder commented 9 months ago

Hello @nex2000! To make your learning easier, follow the link below to the installation and initial configuration video for the scada-lts server on Ubuntu server 22.04 LTS. Remember to change passwords to a secure standard with at least 12 characters for the DB root password.

https://drive.google.com/file/d/1kj_MxrUBfLcNv-n5s9Ho-sItSjOgxnpd/view?usp=sharing

nex2000 commented 9 months ago

Hello Thanks a lot about your reply

Your installation is the same as mine except for different passwords.

After installation ScadaBR works perfectly, but no longer works after reboot.

After reboot tomcat start normally but ScadaLts cannot start.

It gives me the error on Catalina log

Limraj commented 9 months ago

Hi @nex2000, and @weschenfelder maybe there is actually missing information that after restarting the system you need to execute these two scripts, which will no longer install everything, because it was done earlier and only the database and the tomcat server will be started:

./mysql_start.sh
./tomcat_start.sh

https://github.com/SCADA-LTS/linux-installer

I have updated the instructions on the main page with 6 points that inform about this.

@weschenfelder thanks for the help.

nex2000 commented 9 months ago

Thanks a lot for all

Yes the trouble was restart the service , but it would be better to add the services to crontab for tomcat it is startup.sh which is for mysql?

Regards

Limraj commented 9 months ago

Hi @nex2000, The current installer is, as far as possible, independent of the configuration of the system on which we run it. In this state, the installer is suitable for both the user and the programmer. Configurations that will be useful to the user will usually require the use of an external database server, not the one from the installer, and there may be different needs, one user will want the application to be launched non-stop, and when it crashes, to be launched automatically, which, for example, makes it difficult for a developer to use such an installer. Moreover, such an installer would require special user permissions, which in general creates potential problems in the use of the installer by users. The current version meets most users' needs, and minimizes potential problems with the installer. If the user requires specific operating modes, he or she must configure it himself or start cooperation with us. We have other tasks on our plate and we can't take care of everything, and this is not something that would be a great inconvenience, it is designed so that you can adapt it to your needs.

Help: https://www.fosslinux.com/111815/a-guide-to-creating-linux-services-with-systemd.htm

Regards, Kamil Jarmusik

weschenfelder commented 9 months ago

Hello, For personal projects I am using CRON to automatically start the services.

If it helps, the link is attached.

https://docs.google.com/document/d/1oR6d0XUAdXsOaIC7kevcG5hJ_KVX0-7vZg1SJpf4zR0/edit

Always remember to adapt it for your use.

Limraj commented 9 months ago

@weschenfelder Thanks for this instruction, the person should be satisfied. Can we include this instruction on the main installer page? If you have the opportunity to create a pullrequest with an update to this manual, we would will be happy to receive it.

The systemd service has the advantage of being able to maintain the operation of these services, e.g. in the event of a failure or accidental stop. Moreover, if we want a more flexible solution, e.g. to start and stop the service multiple times at any time, this also seems to be a good solution.

nex2000 commented 9 months ago

Thanks a lot for your information and help Paul

johnykab commented 9 months ago

Hello, I combined the two scripts into one by passing in external parameters for |start|stop|restart|. Here it is: (https://github.com/SCADA-LTS/linux-installer/files/13694111/scada.zip) Then you can create systemd service like this:

touch /etc/systemd/system/scada.service chmod 664 /etc/systemd/system/scada.service

Edit the new scada.service file so it contains the following: [Unit] Description=Scada Daemon Service After=network.target After=network-online.target

[Service] EnvironmentFile=/etc/environment Type=forking WorkingDirectory=/opt/scada ExecStart=/opt/scada/scada.sh start ExecStop=/opt/scada/scada.sh stop ExecReload=/opt/scada/scada.sh restart SuccessExitStatus=0 SIGINT SIGTERM 130 143

[Install] WantedBy=multi-user.target

For WorkingDirectory set your path to installation. Reload systemd configuration: systemctl daemon-reload Enable scada.service: systemctl enable scada.service

Now you have system service which will starts and stops with system.

Limraj commented 9 months ago

Hi @johnykab, Combining these scripts does not bring anything here, I have described why it should be released in this form, everyone can configure it as they need, e.g. so that the database and scada are startup along with the system. The presented approach based on sleep generally generates errors, it is not the best practice, it depends on the computer load. I'm closing the topic.