pá 10. 11. 2017 v 22:20 odesílatel Chris Baldwin <[email protected]>
napsal:

> I'm trying to figure out how best to create a reporting-only instance of
> Foreman. This is because the reports being run on my production cluster
> have a tendency to overwhelm the DB and cause performance issues.
>
> My current idea:
> Roll out a slave DB that's read-only, roll out a Foreman instance reading
> from the slave, tell all users to run reports against the r/o Foreman. I've
> done the first two items.
>
> My current problem:
> Passenger won't start because the DB is read only.
>
> [ E 2017-11-10 12:53:27.1852 5260/Tr age/Cor/App/Implementation.cpp:304 ]:
> Could not spawn process for application /usr/share/foreman: An error
> occurred while starting up the preloader.
>   Error ID: e350b8ee
>   Error details saved to: /tmp/passenger-error-uysq1A.html
>   Message from application: PG::Error: ERROR:  cannot execute UPDATE in a
> read-only transaction
> : UPDATE "settings" SET "full_name" = NULL WHERE "settings"."category" IN
> ('Setting::DefaultHostgroup') AND "settings"."id" = $1
> (ActiveRecord::StatementInvalid)
>
>
> Is there an easy way to deal with this? While I'd love to find a magical
> bit to flip (didn't find one listed in the docs), I realize there might be
> some additional complexity here. For a limited deployment like this, I
> would consider some form of LB for reads vs writes (limited to this foreman
> instance).
>

Hi Chris,

I don't think there is one: being able to write to a db has always been one
of the assumptions while running and I'm not sure adding the ability to run
read only is feasible long term (with enforcing this ability on all
potential plugins)

I'm not sure its possible, but if you could achieve the read-only mode only
on a subset of tables (I'm sure settings, users and audits would need to be
writable), this could be the way to go. Otherwise, periodic dumps to a
separate rw database would need to be used: maybe others have better
suggestions for this.

-- Ivan


> Versions, OS, etc:
> Foreman 1.12
> PostgreSQL 9.4.9
> RHEL 6
> Puppet 3.8
> (yes, I would love to upgrade, but I'm stuck on this setup for a little
> bit.)
>
> --
> You received this message because you are subscribed to the Google Groups
> "Foreman users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/foreman-users.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Foreman users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to