Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #23589, #23590 - Handle remote dbs during service actions #178

Merged
merged 1 commit into from
May 17, 2018

Conversation

mbacovsky
Copy link
Member

When service command is used on deployment with remote dbs we
do not have access to the DB services. We try to access the DB
and log the status. On service start we make sure the remote DB
is up and running.

When service command is used on deployment with remote dbs we
do not have access to the DB services. We try to access the DB
and log the status. On service start we make sure the remote DB
is up and running.
@iNecas
Copy link
Member

iNecas commented May 15, 2018

Ack codewise, deferring to @ntkathole with testing.

@alda519
Copy link
Contributor

alda519 commented May 16, 2018

Postgres looks quite good. If only one of [foreman, candlepin] is remote, then

# foreman-maintain service status --only postgresql
...
● postgresql.service - PostgreSQL database server
   Loaded: loaded (/etc/systemd/system/postgresql.service; enabled; vendor preset: disabled)
   Active: active (running) since Mon 2018-05-14 09:42:00 CEST; 36min ago
...
For Foreman DB the service is on remote host. The DB is UP.

If both are remote, then postgresql service is not installed at all and foreman-maintain service skips postgres completely, which seems ok to me.

Remote mongo works only if it is up

# foreman-maintain service status --only rh-mongodb34-mongod 
...
For Pulp DB the service is on remote host. The DB is UP.

because it cannot check version and use mongo 2.6 by default (quite related to http://projects.theforeman.org/issues/23498)

And I noticed that
# foreman-maintain service start --only postgresql,rh-mongodb34-mongod does not show
...the service is on remote host. The DB is UP. lines in terminal because they are overwritten by \r| All services started...

@mbacovsky
Copy link
Member Author

@alda519 oh, good catch with the mongo being down. That is a nasty gap in my plan. I'll try to address this in the other PR (#179).

The overwritten messages are intentional as this is the same behavior for other services. The message should be also logged for eventual troubleshooting. I believe that when the service is down the message is visible in the output. When everything is okay users do not care much about the details.

@alda519
Copy link
Contributor

alda519 commented May 17, 2018

Well, in that case I am fine here.

@iNecas iNecas merged commit d8586d5 into theforeman:master May 17, 2018
@iNecas
Copy link
Member

iNecas commented May 17, 2018

Thanks @mbacovsky and @alda519

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants