# Qualcuno ha un multisite con Postgres esterno?

**URL:** https://meta.discourse.org/t/does-anyone-have-a-multisite-with-external-postgres/314436
**Category:** Self-hosting
**Tags:** multisite, postgres
**Created:** [1 Luglio 2024, 10:36am UTC](https://meta.discourse.org/t/does-anyone-have-a-multisite-with-external-postgres/314436 "2024-07-01T10:36:33Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Isambard](https://avatars.discourse-cdn.com/v4/letter/i/858c86/32.png) [@Isambard](https://meta.discourse.org/u/Isambard)
#### Post date: [1 Luglio 2024, 10:36am UTC](https://meta.discourse.org/t/does-anyone-have-a-multisite-with-external-postgres/314436/1 "2024-07-01T10:36:33Z")

</div>

Qualcuno esegue il multisito con postgres esterno?

Ho una configurazione multisite come questa:

```plaintext
before_bundle_exec:
    - file:
        path: $home/config/multisite.yml
        contents: |
          example:
           adapter: postgresql
           database: example
            pool: 5
           timeout: 5000
           host_names:
             - example.com

```

Vedo:

```plaintext
I, [2024-07-01T10:26:26.110357 #1] INFO -- : Multisite migrator is running using 1 threads

Migrating default
Migrating example

```

Poi la ricostruzione fallisce su:

`cd /var/www/discourse &amp;&amp; sudo -E -u discourse bundle exec rake multisite:migrate failed with return #&lt;Process::Status: pid 433 ex\nit 1&gt;`

Quando controllo il database, vedo che le tabelle per il database discourse predefinito sono state create, ma nessuna delle altre.

Devo in qualche modo aggiungere anche l’host e la porta postgres alla sezione multisite sopra invece di fare affidamento sulla sezione principale in env? Se sì, qual è la sintassi corretta per host, porta, nome utente e password del database?

---

<div class="post-metadata">

### Author: ![Isambard](https://avatars.discourse-cdn.com/v4/letter/i/858c86/32.png) [@Isambard](https://meta.discourse.org/u/Isambard)
#### Post date: [1 Luglio 2024, 11:00am UTC](https://meta.discourse.org/t/does-anyone-have-a-multisite-with-external-postgres/314436/2 "2024-07-01T11:00:06Z")

</div>

OK. Penso di aver risposto alla mia domanda. Ho aggiunto i parametri del database a ciascun ‘sito’ e ora sembra che stia procedendo.

Quindi questo è interessante in quanto sembra che multisite consenta la flessibilità di database separati per ciascun multisite.

EDIT: confermato, l’aggiunta di dettagli completi del database per ciascun sito ha consentito al bootstrap di procedere.

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [31 Luglio 2024, 11:00am UTC](https://meta.discourse.org/t/does-anyone-have-a-multisite-with-external-postgres/314436/3 "2024-07-31T11:00:39Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
