Bug 536653 - (RHQ-981) Need to document how "Create Database" button on installer works
Need to document how "Create Database" button on installer works
Product: RHQ Project
Classification: Other
Component: Documentation (Show other bugs)
All All
medium Severity medium (vote)
: ---
: ---
Assigned To: RHQ Project Maintainer
: Task
Depends On:
  Show dependency treegraph
Reported: 2008-10-14 19:17 EDT by Charles Crouch
Modified: 2015-02-01 18:25 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed:
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Charles Crouch 2008-10-14 19:17:00 EDT
The database name you enter on the Create DB screen, is it the database you want to create or the postgres admin database. Do we default the connect url to the right thing?
Comment 1 Joseph Marques 2008-10-14 19:52:48 EDT
quick testing shows me that:

* entering a non-existent db, <blah>, on the "create db" screen will fail with "SQLException: db <blah> does not exist"
* so a try to enter an existing one, just as "postgres" db on a postgres server

other observations:

* it ALWAYS uses "rhq" as the database name, i.e. it ignors the connection url on the installer page, because i had changed the name from "rhq" to "rhq-test"
* create db will fail if the user specified on the installer page is already created
Comment 2 John Mazzitelli 2008-10-15 08:48:34 EDT
Its very simplistic - look at ConfigurationBean lines 346-365 for the answer:

        LOG.info("Will attempt to create user/database 'rhqadmin' using URL [" + getAdminConnectionUrl()
            + "] and admin user [" + getAdminUsername() + "]. Admin password was"
            + (getAdminPassword().length() > 0 ? " not " : " ") + "empty");

        try {
            String sql1, sql2;

            conn = serverInfo.getDatabaseConnection(adminConfig);
            stmt = conn.createStatement();

            if (dbType.equalsIgnoreCase("postgresql")) {
                sql2 = "CREATE DATABASE rhq WITH OWNER = rhqadmin ENCODING = 'SQL_ASCII' TABLESPACE = pg_default";
            } else if (dbType.equalsIgnoreCase("oracle10g")) {
                sql1 = "CREATE USER rhqadmin IDENTIFIED BY rhqadmin";
                sql2 = "GRANT connect, resource TO rhqadmin";
            } else {
                throw new Exception("Unknown database type: " + dbType);
Comment 3 Jay Shaughnessy 2008-10-15 09:14:53 EDT
I wouldn't miss this button if it went away.  It addms more confusion than value.
Comment 4 John Mazzitelli 2008-10-15 09:24:37 EDT
We originally DID NOT have this button - but some folks thought it was easier to people to get installed by having it (i.e. user would just have to install the database, but not create any special RHQ schema or DB within it - pressing this button would issue all the necessary DDL to get the database ready for RHQ).

We should either a) provide more on-screen help or more wiki documentation that explains what this does or b) find out what users think and if its too confusing and not really ever needed, get rid of it

I would not get rid of it "just because" since it provides a feature that could be helpful (we just don't know if people really use it or not).
Comment 5 Charles Crouch 2008-10-15 10:23:53 EDT
I was on the phone with a customer yesterday who were trying to use this feature, and they couldn't get it to work. I *think* the problem was that the default db url in the create db page was /rhq, which obviously doesn't exist by default, I *think* it should be /postgres.
Comment 6 John Mazzitelli 2008-10-15 10:27:52 EDT
the jdbc url needs to be an admin url which is a confusing part.  the url/user/pass needs to be able to connect to the db server as an admin so the DDL will work - so , yes, charles you are correct. the url needed to be /postgres (which is, by default, a URL that can connect to the postgres DB as an admin with rights to create other databases in the server)
Comment 7 Mark Burchard 2009-01-07 16:27:56 EST
It's a bad practice to ever enforce use of a default password the way the Create Database function appears to demand it.  As a general rule, default passwords are forbidden in most production shops, for good reason.  To add to the issue, the JON docs instruct the user to bind postgres to all interfaces (*).  Obviously, you need to do this in order to have multiple Server machines talking to the single DB machine, but the way we ask customers to set up postgres leaves them only postgres host-based security.  Add this a typo/1D10T moment (like the wrong bitmask, say 24 instead of 32) when configuring host security in pg_hba.conf, and you have a DB that's open and has a known user/password combination.

The postgres crash I was seeing was due to using an 8.4 beta.  Comment deleted.
Comment 8 John Mazzitelli 2009-01-07 16:33:43 EST
we might want to consider removing this "create database" button. We currently hardcode the username/password of the created rhq user which as explained in the earlier comment isn't really safe to do.  We currently don't have a way to ask the user for the password to use - which I guess would be the alternative (as opposed to just removing this feature).
Comment 9 John Mazzitelli 2009-01-30 13:28:55 EST
not an issue since we are going to get rid of the "Create Database" button
Comment 10 Red Hat Bugzilla 2009-11-10 16:20:56 EST
This bug was previously known as http://jira.rhq-project.org/browse/RHQ-981
This bug is related to RHQ-200

Note You need to log in before you can comment on or make changes to this bug.