MySQL jdbc reconnect issue after system restart #38
Replies: 3 comments 2 replies
-
There as no know issues with MySQL or MariaDB. MariaDB is the most commonly used database with EJBCA. Looks like there is some custom RSA public key needed. How did you configure the connection settings on the server? |
Beta Was this translation helpful? Give feedback.
-
How did you set up MySQL? Listening on localhost looks strange? |
Beta Was this translation helpful? Give feedback.
-
I just tested on an Ubuntu 20.04 with a standard MariaDB server. Database running locally on the host, container running on the host as well (on separate docker network of course). If worked well, created tables, filled tables with data and ended up with the server running. from the container point of view, it's not localhost but the docker host, therefore 172.26.0.1 as IP. |
Beta Was this translation helpful? Give feedback.
-
I am running the ejbca-ce docker image on an Ubuntu Linux system. I have it connecting via JDBC to my database. When I reboot my system, both MySQL and Docker (and the ejbca instance within docker) come up without issue but EJBCA wont connect to mysql until I manually run a simple query against my ejbca database using the mysql command line
2022-05-12 20:15:54,997+0000 ERROR [org.ejbca.ui.cli.jdbc.JdbcTool] (main) Could not connect to address=(host=localhost)(port=3306)(type=master) : RSA public key is not available client side (option serverRsaPublicKeyFile not set)
2022-05-12 20:15:54,998+0000 INFO [org.ejbca.ui.cli.jdbc.JdbcTool] (main) Done.
It will log this entry until I log into the system and manually run
vmCert:~$ mysql -u user -p pass ejbca_db
mysql> show tables;
mysql> quit
I did check netstat directly after the reboot and before I ran simple work around:
netstat -l | grep mysql
tcp 0 0 localhost:mysql 0.0.0.0:* LISTEN
And I see that it's listening from the start. Not sure if I have a connection mis-configuration or is this a known issue with MySQL? Other than writing a cron job to periodically show tables, is their a clean way to ensure the database connection is ready to go once MySQL is up and running and listening?
Thanks,
Brian
Beta Was this translation helpful? Give feedback.
All reactions