My Ansible/Rundeck host is an Ubuntu 20.04 LTS system. I installed Ansible to tinker and then installed Rundeck. Once I was able to get the two talking and working properly (in my mind), I thought it would be best to move Rundeck to a production level DB engine instead of H2. I installed MySQL on the same host and setup the DB and the DB user as directed in the Rundeck docs. I then modified the RD properties file as the same document instructs but I keep getting a failure to connect to the database.
First it was this error:
WARN internal.JdbcEnvironmentInitiator - HHH000341: Could not obtain connection metadata : Could not connect to address=(host=10.10.140.23)(port=3306)(type=master) : Socket fail to connect to host:10.10.140.23, port:3306. Connection refused (Connection refused)
So then I researched the issue and it suggested to validate the user account in MySQL, grants, access, etc. - It all works from a command line testing in MySQL.
I read in one of my searches that some people had luck with removing the useSSL=false or setting it to true. That led to my next error of:
WARN internal.JdbcEnvironmentInitiator - HHH000341: Could not obtain connection metadata : Could not connect to address=(host=localhost)(port=3306)(type=master) : RSA public key is not available client side (option serverRsaPublicKeyFile)
During my research on this error, I read that I needed to add a property to allow the retrieval of the RSA keys, and I did but it didn't change a thing.
I then downloaded the Oracle MySQL jdbc driver and placed it in the var/lib/rundeck/lib folder and changed the driver class name in the properties file and then I received my but that could not connect. I was able to detect in the system.log output: ' Unable to load class: com.mysql.jc.jdbc.Driver from ClassLoader:org.springframework.boot.loader.'. Obviously the MySQL jdbc driver is not being loaded or possibly found at all. I placed the file in /var/lib/rundeck/lib. Do I need to give the file any special permissions or should it be named something specific. I used wget to download it while in Ubuntu. The file name is mysql-connector-java-8.0.22.jar and it transferred without any issue.
It was pointed out to me that perhaps it was a password problem and I was directed to this link: github.com/gitbucket/gitbucket/issues/…. I made the change to the MySQL account to change the password to use the native password authentication method. Unfortunately that did not help.
At this point I am back on H2 and I am too much of a Linux novice to understand what the issue may be. Can anyone kindly point me in a direction that helps as the Rundeck docks for using a MySQL DB seem to either be old or missing some content as a lot of the searches I have made on trying to resolve the issue directs me to perform things slight differently or all new commands that the Rundeck docs don't even mention.
Thank you in advance for any assistance.
Hi, Charles,
Which driver do you use ? And which RD version ? There were a
change between 3.2.x and 3.3.x. You probably need mariadb driver.
Cheers
Xavier
--
You received this message because you are subscribed to the Google Groups "rundeck-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rundeck-discu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rundeck-discuss/93fd0876-c0c0-4d46-9612-d28ccaa77286n%40googlegroups.com.
-- Xavier Humbert CRT Supervision et Exploitation de Niveau 1 Rectorat de Nancy-Metz 03 83 86 27 39
Hi Charles.
I tested on Ubuntu 20.10 and MySQL 8 (on a remote Centos 7 machine using the Oracle drive as you want) following these steps:
1- Install Rundeck.
2- Download the JDBC driver from here.
3- Create /var/lib/rundeck/lib
directory and extract there the mysql-connector-java-8.0.22.jar
file (from mysql-connector-java-8.0.22.tar.gz
file)
4- Make sure that rundeck
user owns the /var/lib/rundeck/lib
directory and mysql-connector-java-8.0.22.jar
file. I have the following permissions:
root@ubuntu2004:/var/lib/rundeck# ls -ll
total 36
drwxr-x--- 2 rundeck rundeck 4096 Nov 23 20:44 bootstrap
drwxr-x--- 2 rundeck rundeck 4096 Nov 11 20:00 data
drwxr-xr-x 2 rundeck rundeck 4096 Nov 23 20:49 lib
drwxr-x--- 3 rundeck rundeck 4096 Nov 23 20:54 libext
drwxr-s--x 2 rundeck adm 4096 Nov 11 20:00 logs
drwxrwxr-x 2 rundeck rundeck 4096 Nov 23 20:54 projects
drwxrwxr-x 4 rundeck rundeck 4096 Nov 23 20:54 repository
drwxr-x--- 3 rundeck rundeck 4096 Nov 23 20:54 var
drwxr-x--- 2 rundeck rundeck 4096 Nov 11 20:00 work
and the file inside lib
directory:
root@ubuntu2004:/var/lib/rundeck/lib# ls -ll
total 2336
-rw-r--r-- 1 rundeck rundeck 2389216 Sep 10 21:42 mysql-connector-java-8.0.22.jar
5- Edit the rundeck.config properties
file to reference your MySQL 8 instance in this way:
dataSource.url = jdbc:mysql://192.168.33.33/rundeck?autoReconnect=true&useSSL=false&allowPublicKeyRetrieval=true
dataSource.username=rundeckuser
dataSource.password=password
dataSource.driverClassName=com.mysql.cj.jdbc.Driver
# to store projects on backend
rundeck.projectsStorageType=db
Now save the file.
6- Start the Rundeck instance checking the service log: systemctl start rundeckd; tail -f /var/log/rundeck/service.log
.
[2020-11-23T20:54:07,936] INFO rundeckapp.Application - The following profiles are active: production
Configuring Spring Security Core ...
... finished configuring Spring Security Core
[2020-11-23T20:54:26,214] WARN beans.GenericTypeAwarePropertyDescriptor - Invalid JavaBean property 'exceptionMappings' being accessed! Ambiguous write methods found next to actually used [public void grails.plugin.springsecurity.web.authentication.AjaxAwareAuthenticationFailureHandler.setExceptionMappings(java.util.List)]: [public void org.springframework.security.web.authentication.ExceptionMappingAuthenticationFailureHandler.setExceptionMappings(java.util.Map)]
[2020-11-23T20:54:33,063] INFO rundeckapp.BootStrap - Starting Rundeck 3.3.6-20201111 (2020-11-11) ...
[2020-11-23T20:54:33,066] INFO rundeckapp.BootStrap - using rdeck.base config property: /var/lib/rundeck
[2020-11-23T20:54:33,077] INFO rundeckapp.BootStrap - loaded configuration: /etc/rundeck/framework.properties
[2020-11-23T20:54:33,159] INFO rundeckapp.BootStrap - RSS feeds disabled
[2020-11-23T20:54:33,159] INFO rundeckapp.BootStrap - Using jaas authentication
[2020-11-23T20:54:33,164] INFO rundeckapp.BootStrap - Preauthentication is disabled
[2020-11-23T20:54:33,232] INFO rundeckapp.BootStrap - Rundeck is ACTIVE: executions can be run.
[2020-11-23T20:54:33,634] INFO rundeckapp.BootStrap - workflowConfigFix973: applying...
[2020-11-23T20:54:33,647] INFO rundeckapp.BootStrap - workflowConfigFix973: No fix was needed. Storing fix application state.
[2020-11-23T20:54:33,913] INFO rundeckapp.BootStrap - Rundeck startup finished in 930ms
[2020-11-23T20:54:34,081] INFO rundeckapp.Application - Started Application in 28.538 seconds (JVM running for 31.546)
Grails application running at http://localhost:4440 in environment: production
Also, you can check the data source from GUI.
Hope it helps!
On Nov 23, 2020, at 6:44 PM, Charles Pippin <cwpi...@gmail.com> wrote:
To view this discussion on the web visit https://groups.google.com/d/msgid/rundeck-discuss/e6b5a900-7c0b-4530-a99f-bf967f678269n%40googlegroups.com.
You received this message because you are subscribed to a topic in the Google Groups "rundeck-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/rundeck-discuss/aqB1WADmH0I/unsubscribe.
To unsubscribe from this group and all its topics, send an email to rundeck-discu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rundeck-discuss/D068C6EA-61A4-42AF-BA0D-78F513C725D8%40gmail.com.
Your MySQL grants show only localhost. Typically, does your localhost resolve to 127.0.0.1 or to the server’s ip address? Typically, there is an entry in the /etc/hosts file for localhost.
Since you are not specifying “-h” in the mysql client; it is defaulting to localhost as well. If you put “localhost” in your rundeck configuration file for the mysql connect string; is it trying to use the server ip address or 127.0.0.1?
To view this discussion on the web visit https://groups.google.com/d/msgid/rundeck-discuss/CAMiti54WZRzsFdmGZV3ChTVBCtd8k6Chbt37ySq7Y%2BtxgqKXYA%40mail.gmail.com.
Hi Charles,
I tested again putting Rundeck and MySQL 8 (server version: 8.0.22-0ubuntu0.20.04.2 (Ubuntu)
) in the same Ubuntu 20.04 machine and works in this way:
1.- As a best practice update the whole system: apt-get update; apt-get upgrade
.
2.- Install MySQL 8: apt-get install mysql-server
.
3.- Configure it: sudo mysql_secure_installation
(set the root password and follow some steps related to allowing remote root login and test databases).
4.- Enter to MySQL with: mysql -u root -p
.
5.- And I following these steps to create the Rundeck database and user:
CREATE DATABASE rundeck;
CREATE USER 'rundeckuser'@'%' IDENTIFIED BY 'Myp4ssw0rd';
GRANT ALL PRIVILEGES ON rundeck.* TO 'rundeckuser'@'%';
exit;
6.- Download Rundeck .deb
package: wget -c https://dl.bintray.com/rundeck/rundeck-deb/rundeck_3.3.6.20201111-1_all.deb
.
7.- Install Rundeck: dpkg -i rundeck_3.3.6.20201111-1_all.deb
.
8.- Create the lib directory to put the latest MySQL driver: mkdir /var/lib/rundeck/lib
and change the owner from root
user to rundeck
user.
9.- Download the MySQL driver: wget -c https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-8.0.22.tar.gz
.
10.- Uncompress mysql-connector-java-8.0.22.tar.gz
file and put mysql-connector-java-8.0.22.jar
file at /var/lib/rundeck/lib
directory, change the file owner from root
user to rundeck
user.
11.- Edit the /etc/rundeck/rundeck-config.properties
file to add the MySQL config and save it, here my file content (I defined as localhost
):
#loglevel.default is the default log level for jobs: ERROR,WARN,INFO,VERBOSE,DEBUG
loglevel.default=INFO
rdeck.base=/var/lib/rundeck
#rss.enabled if set to true enables RSS feeds that are public (non-authenticated)
rss.enabled=false
# change hostname here
grails.serverURL=http://192.168.33.14:4440
dataSource.dbCreate = update
#dataSource.url = jdbc:h2:file:/var/lib/rundeck/data/rundeckdb;MVCC=true
dataSource.url = jdbc:mysql://localhost/rundeck?autoReconnect=true&useSSL=false&allowPublicKeyRetrieval=true
dataSource.username=rundeckuser
dataSource.password=Myp4ssw0rd
dataSource.driverClassName=com.mysql.cj.jdbc.Driver
# to store projects on backend
rundeck.projectsStorageType=db
# Encryption for key storage
rundeck.storage.provider.1.type=db
rundeck.storage.provider.1.path=keys
rundeck.storage.converter.1.type=jasypt-encryption
rundeck.storage.converter.1.path=keys
rundeck.storage.converter.1.config.encryptorType=custom
rundeck.storage.converter.1.config.password=072d452ca7f620cd
rundeck.storage.converter.1.config.algorithm=PBEWITHSHA256AND128BITAES-CBC-BC
rundeck.storage.converter.1.config.provider=BC
# Encryption for project config storage
rundeck.projectsStorageType=db
rundeck.config.storage.converter.1.type=jasypt-encryption
rundeck.config.storage.converter.1.path=projects
rundeck.config.storage.converter.1.config.password=072d452ca7f620cd
rundeck.config.storage.converter.1.config.encryptorType=custom
rundeck.config.storage.converter.1.config.algorithm=PBEWITHSHA256AND128BITAES-CBC-BC
rundeck.config.storage.converter.1.config.provider=BC
rundeck.feature.repository.enabled=true
12.- Start the Rundeck service checking the output: systemctl start rundeckd; tail -f /var/log/rundeck/service.log
:
Configuring Spring Security Core ...
... finished configuring Spring Security Core
[2020-11-25T11:56:59,284] WARN beans.GenericTypeAwarePropertyDescriptor - Invalid JavaBean property 'exceptionMappings' being accessed! Ambiguous write methods found next to actually used [public void grails.plugin.springsecurity.web.authentication.AjaxAwareAuthenticationFailureHandler.setExceptionMappings(java.util.List)]: [public void org.springframework.security.web.authentication.ExceptionMappingAuthenticationFailureHandler.setExceptionMappings(java.util.Map)]
[2020-11-25T11:57:07,868] INFO rundeckapp.BootStrap - Starting Rundeck 3.3.6-20201111 (2020-11-11) ...
[2020-11-25T11:57:07,869] INFO rundeckapp.BootStrap - using rdeck.base config property: /var/lib/rundeck
[2020-11-25T11:57:07,886] INFO rundeckapp.BootStrap - loaded configuration: /etc/rundeck/framework.properties
[2020-11-25T11:57:07,934] INFO rundeckapp.BootStrap - RSS feeds disabled
[2020-11-25T11:57:07,934] INFO rundeckapp.BootStrap - Using jaas authentication
[2020-11-25T11:57:07,939] INFO rundeckapp.BootStrap - Preauthentication is disabled
[2020-11-25T11:57:08,068] INFO rundeckapp.BootStrap - Rundeck is ACTIVE: executions can be run.
[2020-11-25T11:57:08,564] INFO rundeckapp.BootStrap - workflowConfigFix973: applying...
[2020-11-25T11:57:08,575] INFO rundeckapp.BootStrap - workflowConfigFix973: No fix was needed. Storing fix application state.
[2020-11-25T11:57:08,980] INFO rundeckapp.BootStrap - Rundeck startup finished in 1204ms
[2020-11-25T11:57:09,199] INFO rundeckapp.Application - Started Application in 32.282 seconds (JVM running for 35.209)
Grails application running at http://localhost:4440 in environment: production
13.- Check the data source on the GUI.
Hope it helps!