Editing
PostgreSQL
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
* Configuraties ** [[Stand Alone]] ** [[Primary en Standby]] ** [[HA Cluster]] * [[Toepassingen]] * [[Standaard opzet onderdelen PostgreSQL]] * [[PostgreSQL rollen en privileges]] = HA Cluster = In PostgreSQL spreekt men altijd van een cluster, omdat serieuze toepassingen voor ononderbroken werking een terugval op een kopie van de database nodig hebben. Een cluster bestaat in dat geval uit tenminste één Primary en één Standby node. De standby neemt de taak van primary op zich als de primary stopt.<br> Een High Availability Cluster (HA) gaat verder en voldoet aan de volgende criteria: * Het cluster bestaat uit één primary node en twee standby nodes * Automatische failover met minimale downtime, met beveiliging tegen een terugkomende node die primary claimt * Efficiënte afhandeling van connection met behulp van pooling * Afscherming van de database nodes door middel van een proxy * Afsplitsing van zware lees queries met load balancing op de standby nodes Het [[Webhuis PostgreSQL Cluster]] is opgezet met Patroni, HAProxy, etcd en PGBouncer. = Toepassingen = MySQL is op het moment de meest gebruikte database voor Mediawiki. Webhuis is de wiki in het verleden begonnen met een MySQL backend, maar is overgestapt PostgreSQL als standaard database backend. == Mediawiki == === Installatie === De installatie procedure met de PostgreSQL backend is een beetje gammel, maar als je eenmaal een PostgreSQL database hebt gaat het soepel. ==== Webserver ==== <pre> # apt-get install mediawiki php-pgsql </pre> In /etc/php/7.3/apache2/php.ini uncomment: <pre> extension=pdo_pgsql extension=pgsql </pre> ==== PostgreSQL Server ==== Als de database is geïnstalleerd is de volgende voorbereiding op de import uit MySQL noodzakelijk, vanwege andere afhandeling van de autoincrement op keys in tabllen. In PostgreSQL doen we dat met een sequence. <pre> create sequence page_id_seq owned by page.page_id; alter table page alter page_id set default nextval('page_id_seq'); create sequence pagecontent_old_id_seq owned by pagecontent.old_id; alter table pagecontent alter old_id set default nextval('pagecontent_old_id_seq'); create sequence revision_rev_id_seq owned by revision.rev_id; alter table revision alter rev_id set default nextval('revision_rev_id_seq'); create sequence job_job_id_seq owned by job.job_id; alter table job alter job_id set default nextval('job_job_id_seq'); </pre> === Migratie === <pre> php importDump.php --conf /etc/mediawiki/LocalSettings.php ~/tmp/mediawiki-dump.xml --username-prefix='wiki_database_rolename' </pre> <hr/> Terug naar: [[Voorpagina]]
Summary:
Please note that all contributions to Webhuis wiki are considered to be released under the GNU Free Documentation License 1.3 or later (see
Project:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Voorpagina
Cobol and PostgreSQL
PostgreSQL
CFEngine
Proxmox
Webhuis Kennisbank
Basale infra
Webhuis bouwstenen
Webhuis configuratie
Webhuis Infra
Webhuis Support
Webhuis Raspberry
Opzet Applicaties
Business Applicaties
Community portal
Current events
Recent changes
Random page
Help
sitesupport
Tools
What links here
Related changes
Special pages
Page information