Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1999791

Summary: Insert instructions to configure pulpcore to use external database
Product: Red Hat Satellite Reporter: Joniel Pasqualetto <jpasqual>
Component: DocumentationAssignee: Marie Hornickova <mdolezel>
Status: CLOSED CURRENTRELEASE QA Contact: satellite-doc-list
Severity: medium Docs Contact:
Priority: medium    
Version: 6.9.0CC: dmule, gtalreja, mdolezel, ryandeussing, saydas
Target Milestone: Unspecified   
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-02-28 19:01:40 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Joniel Pasqualetto 2021-08-31 18:07:58 UTC
Document URL: 

https://access.redhat.com/documentation/en-us/red_hat_satellite/6.9/html-single/administering_red_hat_satellite/index#migrating-from-internal-databases-to-external-databases_admin

Section Number and Name: 

3.5. Installing PostgreSQL
3.6. Migrating to External Databases

Describe the issue: 

Instructions talk about foreman and candlepin DBs and parameters to configure those 2 databases to be on the external DB.

However, there is no reference for the DB pulpcore, which also needs to be created and configured properly with its own configuration options.

Suggestions for improvement: 

Add steps to create a pulpcore database
Add steps to migrate from pulpcore to the external DB
Add steps to configure pulpcore options to use the external DB. Example:

~~~
satellite-installer \
  --foreman-proxy-content-pulpcore-postgresql-db-name pulpcore    \ 
  --foreman-proxy-content-pulpcore-postgresql-host  <db_hostname> \
  --foreman-proxy-content-pulpcore-postgresql-port  <db_port>     \
  --foreman-proxy-content-pulpcore-postgresql-user  <db_username> \
  --foreman-proxy-content-pulpcore-postgresql-password <db_password>
~~~

Additional information:

Comment 2 Sayan Das 2021-09-24 05:13:41 UTC
From Sat 6.10 Beta docs i.e. 

https://access.redhat.com/documentation/en-us/red_hat_satellite/6.10-beta/html-single/installing_satellite_server_from_a_connected_network/index#installing-postgresql_satellite

4.13.4. Configuring Satellite to use External Databases --> Reflects the satellite-installer options for foreman \ candlepin \ pulpcore db

But the section before that i.e. 4.13.3. Installing PostgreSQL , is missing the steps for creating pulpcore db. It only talks about foreman and candlepin at step 10 and 12.


Is this expected?

Comment 4 Sayan Das 2022-02-17 10:33:08 UTC
The steps here in https://access.redhat.com/documentation/%20ja-jp/red_hat_satellite/6.10/html/installing_satellite_server_from_a_disconnected_network/performing-additional-configuration#preparing-a-host-for-external-databases_satellite is broken .

To explain further:

In "3.10.3. Installing PostgreSQL" 

Point 10:

CREATE USER "pulpcore" WITH PASSWORD 'Pulpcore_Password';

Point 12:

PGPASSWORD='Pulpcore_Password' psql -h postgres.example.com -p 5432 -U pulpcore -d pulpcore -c "SELECT 1 as ping"

As you can see, we suggest creating pulpcore user


but by default the user satellite creates is pulp in an internal DB. So this installer flag always points to "pulp" user

--foreman-proxy-content-pulpcore-postgresql-user  User of the Pulpcore PostgreSQL database. (current: "pulp")


Since at "3.10.4. Configuring Satellite to use External Databases" we suggest running following with no pulpcore database user mentioned:

satellite-installer --scenario satellite \
  --foreman-db-host postgres.example.com \
  --foreman-db-password Foreman_Password \
  --foreman-db-database foreman \
  --foreman-db-manage false \
  --katello-candlepin-db-host postgres.example.com \
  --katello-candlepin-db-name candlepin \
  --katello-candlepin-db-password Candlepin_Password \
  --katello-candlepin-manage-db false \
  --foreman-proxy-content-pulpcore-manage-postgresql false \
  --foreman-proxy-content-pulpcore-postgresql-host postgres.example.com \
  --foreman-proxy-content-pulpcore-postgresql-db-name pulpcore \
  --foreman-proxy-content-pulpcore-postgresql-password Pulpcore_Password


It fails:

2022-02-17 03:50:42 [DEBUG ] [configure] /Stage[main]/Pulpcore::Database/Pulpcore::Admin[migrate --noinput]/Exec[pulpcore-manager migrate --noinput]/unless:     conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
2022-02-17 03:50:42 [DEBUG ] [configure] /Stage[main]/Pulpcore::Database/Pulpcore::Admin[migrate --noinput]/Exec[pulpcore-manager migrate --noinput]/unless: django.db.utils.OperationalError: FATAL:  password authentication failed for user "pulp"


So the correct command would be:


satellite-installer --scenario satellite \
  --foreman-db-host postgres.example.com \
  --foreman-db-password Foreman_Password \
  --foreman-db-database foreman \
  --foreman-db-manage false \
  --katello-candlepin-db-host postgres.example.com \
  --katello-candlepin-db-name candlepin \
  --katello-candlepin-db-password Candlepin_Password \
  --katello-candlepin-manage-db false \
  --foreman-proxy-content-pulpcore-manage-postgresql false \
  --foreman-proxy-content-pulpcore-postgresql-host postgres.example.com \
  --foreman-proxy-content-pulpcore-postgresql-db-name pulpcore \
  --foreman-proxy-content-pulpcore-postgresql-password Pulpcore_Password \
  --foreman-proxy-content-pulpcore-postgresql-user pulpcore



 @mdolezel  , If possible, Can you have someone on it and get this one line change performed in the said documentation please?

Comment 10 Marie Hornickova 2022-02-28 19:01:40 UTC
The update documentation has been published on Red Hat Customer Portal:

https://access.redhat.com/documentation/en-us/red_hat_satellite/6.10/html-single/installing_satellite_server_from_a_disconnected_network/index#configuring-satellite-to-use-external-databases_satellite

Therefore, I'm closing this BZ. Please, feel free to reopen if needed.

Thank you!