0

Setup SonarQube Version 6.4 (build 25310) and have it running after having issue not opening 9000 from previous question: Setting up SonarQube on AWS using EC2

Now I am trying to setup PostGres via AWS RDS:

  1. Setup PostgreSQL 9.6.2
  2. Configure security for Sonar EC2 instance to allow inbound rules:
  3. PostGreSQl/TCP/5432/0.0.0.0/0, ::/0
  4. PostGreSQl/TCP/5432/Anywhere/0.0.0.0/0, ::/0
  5. PostGreSQl/TCP/5432/Custom/Sonar Security group --> group for the sonar instance
  6. VI sonar.properties file
  7. sonar.jdbc.username=XXXXXX --> Username used during RDS setup
  8. sonar.jdbc.password=XXXXXX --> Password used during RDS setup
  9. sonar.jdbc.url=jdbc:sonardbpostgre.XXXXXXXXX.us-east-1.rds.amazonaws.com:5432
  10. cd ../bin/linux-x86-64/
  11. ./sonar.sh restart

From what I can tell something in my config is not happy as it does try to start as I can see the pid come up but then it immediately gets killed.

Any suggestions?

If I uncomment the changes in the changes in sonar.properties it comes back up after restart.

Here is what I see after I try adding the config for the DB:

root@ip-172- linux-x86-64]# ls
lib  SonarQube.pid  sonar.sh  wrapper
[root@ip-172- linux-x86-64]# ./sonar.sh restart
Stopping SonarQube...
Stopped SonarQube.
Starting SonarQube...
Started SonarQube.
[root@ip-172- linux-x86-64]# ls
lib  sonar.sh  wrapper
[root@ip-172- linux-x86-64]# ls
lib  sonar.sh  wrapper
[root@ip-172- linux-x86-64]# ./sonar.sh restart
Stopping SonarQube...
SonarQube was not running.
Starting SonarQube...
Started SonarQube.
[root@ip-172- linux-x86-64]# ls
lib  SonarQube.pid  sonar.sh  wrapper
[root@ip-172- linux-x86-64]# ls
lib  sonar.sh  wrapper
isaac weathers
  • 1,436
  • 4
  • 27
  • 52
  • ```2017-06-22 16:13:01 UTC::@:[2882]:WARNING: unrecognized configuration parameter "rds.logical_replication"``` This was the only log I saw in the DB instance – isaac weathers Jun 22 '17 at 17:11
  • 2
    And what do you see in your SonarQube server logs? – G. Ann - SonarSource Team Jun 22 '17 at 17:46
  • `WrapperSimpleApp: Encountered an error running main: org.sonar.process.MessageException: Bad format of JDBC URL: jdbc:sonardbpostgre.XXXXXXX.us-east-1.rds.amazonaws.com:5432 org.sonar.process.MessageException: Bad format of JDBC URL: jdbc:sonardbpostgre.XXXXXX.us-east-1.rds.amazonaws.com:5432 ` Is there a particular format? – isaac weathers Jun 22 '17 at 19:06
  • Updated the jdca URL to include ` jdbc:postgresql://sonardbpostgre.~` and still won't come up but got this from the web.log and saw this:`java.lang.IllegalStateException: Can not connect to database. Please check connectivity and settings (see the properties prefixed by 'sonar.jdbc.').` so tracing that out – isaac weathers Jun 22 '17 at 20:01

1 Answers1

3

Format of JDBC URL for PostgreSQL is jdbc:postgresql://<host>/<database>. In your case the property should look like sonar.jdbc.url=jdbc:postgresql://xxx.us-east-1.rds.amazonaws.com:5432/sonarqube.

Simon Brandhof
  • 5,137
  • 1
  • 21
  • 28
  • `017-06-22 20:54:15 UTC:172.31.22.8(38022):XXXXXX@sonarqube:[31172]:FATAL: database "sonarqube" does not exist` – isaac weathers Jun 22 '17 at 20:54
  • 1
    @isaacweathers , you need to create first `sonarqube` database in your postgres DB server by using `create database sonarqube` command, you can do by using some command line client to postgres. – Amit Jun 23 '17 at 04:21
  • Ah. Makes sense. Let me try that out this morning and see if that helps. Thanks @AmitK – isaac weathers Jun 23 '17 at 14:20
  • That was it @AmitK -- Made more sense once I logged in via `pgadmin4-1.5` -- definitely a useful tool for PostGre. Upvoted your answer. Thanks again. Is there a link to configuring the EC2 instance runinng sonarqube in AWS to use ELB/SSL and a Route53 domain or should I just look in the docs? – isaac weathers Jun 23 '17 at 15:10
  • 1
    @isaacweathers , glad again i am able to help you here. i am not sure if there is a consolidate link with all the requirement although you can just follow the various other link for each steps. – Amit Jun 23 '17 at 15:18