# Help needed to setup a NC14 cluster

**URL:** <https://help.nextcloud.com/t/help-needed-to-setup-a-nc14-cluster/39707>\
**Category:** ℹ️ Support\
**Tags:** nc14\
**Created:** [October 23, 2018, 11:31am UTC](https://help.nextcloud.com/t/help-needed-to-setup-a-nc14-cluster/39707 "2018-10-23T11:31:59Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![benoit\_touron](https://help.nextcloud.com/letter_avatar/benoit_touron/32/5_5575768a8748004e209b776fc1b2916d.png) [@benoit\_touron](https://help.nextcloud.com/u/benoit_touron)\
**Post date:** [October 23, 2018, 11:32am UTC](https://help.nextcloud.com/t/help-needed-to-setup-a-nc14-cluster/39707/1 "2018-10-23T11:32:00Z")

</div>

Hi,  
I am trying to install NextCloud 14. I have 2 apache HTTP servers and 1 database (master-slave replication with Galera).  
I installed NC on the 2 nodes, pointing to the same database and all went right.  
I have issues when I log in the first server. The users I create/update on the 2nd server are not usable on the first (bad credentials).  
I guess there must use the same key on the 2 servers to cipher the passwords, but I can’t find how to setup this.  
Please help !  
Ben

---

<div class="post-metadata">

**Author:** ![Finalls](https://help.nextcloud.com/letter_avatar/finalls/32/5_5575768a8748004e209b776fc1b2916d.png) [@Finalls](https://help.nextcloud.com/u/Finalls)\
**Post date:** [February 12, 2019, 7:50am UTC](https://help.nextcloud.com/t/help-needed-to-setup-a-nc14-cluster/39707/2 "2019-02-12T07:50:17Z")

</div>

UP,  
I have the same problemma. With two servers. If I log in on the first one and switch to the second one then everything is ok. And no back. Help.  
haproxy  
nginx, php7.1,php-fpm

database : postgress.  
Redis cash and php session.  
NC 15.04

---

<div class="post-metadata">

**Author:** ![JimmyKater](https://help.nextcloud.com/user_avatar/help.nextcloud.com/jimmykater/32/4850_2.png) [@JimmyKater](https://help.nextcloud.com/u/JimmyKater)\
**Post date:** [February 12, 2019, 8:34am UTC](https://help.nextcloud.com/t/help-needed-to-setup-a-nc14-cluster/39707/3 "2019-02-12T08:34:11Z")

</div>

@JasonBayton don’t YOU run a cluster of NCs already? so perhaps you would have some hints for those guys? 😉

---

<div class="post-metadata">

**Author:** ![JasonBayton](https://help.nextcloud.com/user_avatar/help.nextcloud.com/jasonbayton/32/297_2.png) [@JasonBayton](https://help.nextcloud.com/u/JasonBayton)\
**Post date:** [February 12, 2019, 9:07am UTC](https://help.nextcloud.com/t/help-needed-to-setup-a-nc14-cluster/39707/4 "2019-02-12T09:07:35Z")

</div>

I did indeed run a cluster for a time, but mostly for testing 🙂

Here’s my writeup, let me know if you get stuck @Finalls

> **[Experimenting with clustering and data replication in Nextcloud with MariaDB...](https://bayton.org/2017/06/experimenting-with-clustering-and-data-replication-in-nextcloud-with-mariadb-galera-and-syncthing/)**
>
> Update
> After discussions with the Nextcloud team and guys at TU Berlin, the below could be officially supported with some small changes. See the updates noted against the challenges. A rewrite or additional post will be coming soon to address and...

---

<div class="post-metadata">

**Author:** ![Finalls](https://help.nextcloud.com/letter_avatar/finalls/32/5_5575768a8748004e209b776fc1b2916d.png) [@Finalls](https://help.nextcloud.com/u/Finalls)\
**Post date:** [February 12, 2019, 1:26pm UTC](https://help.nextcloud.com/t/help-needed-to-setup-a-nc14-cluster/39707/5 "2019-02-12T13:26:44Z")

</div>

![nx-bad](https://help.nextcloud.com/uploads/default/original/2X/5/5a2b1685cb76da34c7c7b17002f663498d7590c0.png)

Here is a diagram. Everything works until one of the nodes fails. With the fall of Nextcloud APP01. Everyone switches to Nextcloud APP02. Authorization is working.  
Turn on APP01 and turn off APP02 Authorization error.  
Turn on APP02 and turn off APP01 running.Authorization is working.

@JasonBayton

---

<div class="post-metadata">

**Author:** ![JasonBayton](https://help.nextcloud.com/user_avatar/help.nextcloud.com/jasonbayton/32/297_2.png) [@JasonBayton](https://help.nextcloud.com/u/JasonBayton)\
**Post date:** [February 13, 2019, 10:32am UTC](https://help.nextcloud.com/t/help-needed-to-setup-a-nc14-cluster/39707/6 "2019-02-13T10:32:28Z")

</div>

I vaguely recall this may have been due to session storage. @nickvergessen gave me a tip on that I then used to get everything working!

---

<div class="post-metadata">

**Author:** ![Finalls](https://help.nextcloud.com/letter_avatar/finalls/32/5_5575768a8748004e209b776fc1b2916d.png) [@Finalls](https://help.nextcloud.com/u/Finalls)\
**Post date:** [February 13, 2019, 10:37am UTC](https://help.nextcloud.com/t/help-needed-to-setup-a-nc14-cluster/39707/7 "2019-02-13T10:37:56Z")

</div>

> [@JasonBayton](#):
>
> @nickvergessen

Please Help !! =)  
share your advice

---

<div class="post-metadata">

**Author:** ![Starfish](https://help.nextcloud.com/letter_avatar/starfish/32/5_5575768a8748004e209b776fc1b2916d.png) [@Starfish](https://help.nextcloud.com/u/Starfish)\
**Post date:** [February 13, 2019, 11:42am UTC](https://help.nextcloud.com/t/help-needed-to-setup-a-nc14-cluster/39707/8 "2019-02-13T11:42:00Z")

</div>

This may be a VERY stupid question, but in your `config.php` file, does the `instance_id` parameter differ? We saw some funky stuff too, and once we made sure that the `config.php` files were exact matches (only changing the trusted domain parameter to the individual servers) it seemed to solve a lot of things for us.

---

<div class="post-metadata">

**Author:** ![Finalls](https://help.nextcloud.com/letter_avatar/finalls/32/5_5575768a8748004e209b776fc1b2916d.png) [@Finalls](https://help.nextcloud.com/u/Finalls)\
**Post date:** [February 13, 2019, 1:40pm UTC](https://help.nextcloud.com/t/help-needed-to-setup-a-nc14-cluster/39707/9 "2019-02-13T13:40:55Z")

</div>

config.php absolutely the same. Only trusted\_domains differ.  
=(

---

<div class="post-metadata">

**Author:** ![Finalls](https://help.nextcloud.com/letter_avatar/finalls/32/5_5575768a8748004e209b776fc1b2916d.png) [@Finalls](https://help.nextcloud.com/u/Finalls)\
**Post date:** [February 14, 2019, 7:52am UTC](https://help.nextcloud.com/t/help-needed-to-setup-a-nc14-cluster/39707/10 "2019-02-14T07:52:39Z")

</div>

Here I spread a config. differences between two configs only in trusted\_domains .

> **config.php**
>
> > ```
> > <?php
> > $CONFIG = array (
> > 'instanceid' => 'o ******* 9',
> > 'passwordsalt' => 'asdasdasAd/9RjckasdasdUdcdda5G',
> > 'secret' => 'asdasdasdqw',
> > 'trusted_domains' => 
> > array (
> > 0 => 'data-test. *****.ru',
> > 1 => 'nextcloud01p',
> > ),
> > 
> > 'datadirectory' => '/var/www/nextcloud/data',
> > 'overwrite.cli.url' => 'https://data-test. ******.ru',
> > 'overwritehost' => 'data-test. *****.ru',
> > 'overwriteprotocol' => 'https',
> > 'dbtype' => 'pgsql',
> > 'version' => '15.0.4.0',
> > 'dbname' => 'nextcloud',
> > 'dbhost' => 'localhost',
> > 'dbuser' => 'nextcloud',
> > 'dbpassword' => 'Vsadasd1',
> > 'dbtableprefix' => 'oc_',
> > 'installed' => true,
> > 'mail_from_address' => 'data',
> > 'mail_smtpmode' => 'smtp',
> > 'mail_smtpauthtype' => 'LOGIN',
> > 'mail_domain' => ' *****.ru',
> > 'loglevel' => 0,
> > 'maintenance' => false,
> > 'mail_smtphost' => 'smtp. *****.ru',
> > 'mail_smtpport' => '25',
> > 'session_lifetime' => 3600,
> > 'richdocuments' => 
> > array (
> > 'verify_peer_off' => true,
> > ),
> > 'skeletondirectory' => '',
> > 'versions_retention_obligation' => '7,auto',
> > 'has_internet_connection' => true,
> > 'log_rotate_size' => '104857600',
> > 'updatechecker' => true,
> > 'theme' => '',
> > 'proxy' => 'proxy. *****.ru:8080',
> > 'filelocking.enabled' => false,
> > 'memcache.locking' => '\\OC\\Memcache\\Redis',
> > 'memcache.local' => '\\OC\\Memcache\\Redis',
> > 'redis' => 
> > array (
> > 'host' => '10.0.1.57',
> > 'port' => 6379,
> > 'timeout' => 0.0,
> > ),
> > 'updater.release.channel' => 'stable',
> > );
> > 
> > ```

---

<div class="post-metadata">

**Author:** ![Starfish](https://help.nextcloud.com/letter_avatar/starfish/32/5_5575768a8748004e209b776fc1b2916d.png) [@Starfish](https://help.nextcloud.com/u/Starfish)\
**Post date:** [February 14, 2019, 7:56am UTC](https://help.nextcloud.com/t/help-needed-to-setup-a-nc14-cluster/39707/11 "2019-02-14T07:56:03Z")

</div>

Did you map your NFS to `/var/www/nextcloud/data`?

---

<div class="post-metadata">

**Author:** ![Finalls](https://help.nextcloud.com/letter_avatar/finalls/32/5_5575768a8748004e209b776fc1b2916d.png) [@Finalls](https://help.nextcloud.com/u/Finalls)\
**Post date:** [February 14, 2019, 9:28am UTC](https://help.nextcloud.com/t/help-needed-to-setup-a-nc14-cluster/39707/12 "2019-02-14T09:28:02Z")

</div>

Yes /var/www/nextcloud/data - This is NFS

---

<div class="post-metadata">

**Author:** ![Finalls](https://help.nextcloud.com/letter_avatar/finalls/32/5_5575768a8748004e209b776fc1b2916d.png) [@Finalls](https://help.nextcloud.com/u/Finalls)\
**Post date:** [February 14, 2019, 3:48pm UTC](https://help.nextcloud.com/t/help-needed-to-setup-a-nc14-cluster/39707/13 "2019-02-14T15:48:49Z")

</div>

@nickvergessen  
@Starfish  
@JasonBayton  
No more ideas?

---

<div class="post-metadata">

**Author:** ![Starfish](https://help.nextcloud.com/letter_avatar/starfish/32/5_5575768a8748004e209b776fc1b2916d.png) [@Starfish](https://help.nextcloud.com/u/Starfish)\
**Post date:** [February 15, 2019, 6:51am UTC](https://help.nextcloud.com/t/help-needed-to-setup-a-nc14-cluster/39707/14 "2019-02-15T06:51:09Z")

</div>

I have this in my config.php

```auto
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'filelocking.ttl' => 3600,
  'filelocking.enabled' => 'true',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'redis' => 
  array (
    'host' => 'IP_of_Redis_Server',
    'port' => 6379,
  ),

```

Note the `memcache.distritbuted` variable, and that I use APCu for local memcache.

I should note to you that we use LDAP for user provisioning, so not sure how local user provisioning would work. We have no issues atm regarding your symptoms, but as I said, we use LDAP.

---

<div class="post-metadata">

**Author:** ![Finalls](https://help.nextcloud.com/letter_avatar/finalls/32/5_5575768a8748004e209b776fc1b2916d.png) [@Finalls](https://help.nextcloud.com/u/Finalls)\
**Post date:** [February 15, 2019, 8:57am UTC](https://help.nextcloud.com/t/help-needed-to-setup-a-nc14-cluster/39707/15 "2019-02-15T08:57:41Z")

</div>

Thanks for the advice, But it did not help me.

I still get

> **Error**
>
> {  
> “reqId”: “7QL0EDTtEMR1laaTuRgx”,  
> “level”: 2,  
> “time”: “2019-02-15T08:37:08+00:00”,  
> “remoteAddr”: “10.218.11.45”,  
> “user”: “–”,  
> “app”: “core”,  
> “method”: “POST”,  
> “url”: “/login”,  
> “message”: “Login failed: ‘k.kurbanov’ (Remote IP: ‘10.218.11.45’)”,  
> “userAgent”: “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36”,  
> “version”: “15.0.4.0”  
> }

---

<div class="post-metadata">

**Author:** ![Starfish](https://help.nextcloud.com/letter_avatar/starfish/32/5_5575768a8748004e209b776fc1b2916d.png) [@Starfish](https://help.nextcloud.com/u/Starfish)\
**Post date:** [February 15, 2019, 10:00am UTC](https://help.nextcloud.com/t/help-needed-to-setup-a-nc14-cluster/39707/16 "2019-02-15T10:00:15Z")

</div>

Could you bump the log level to more verbose maybe? And output that?

---

<div class="post-metadata">

**Author:** ![Finalls](https://help.nextcloud.com/letter_avatar/finalls/32/5_5575768a8748004e209b776fc1b2916d.png) [@Finalls](https://help.nextcloud.com/u/Finalls)\
**Post date:** [February 15, 2019, 2:10pm UTC](https://help.nextcloud.com/t/help-needed-to-setup-a-nc14-cluster/39707/17 "2019-02-15T14:10:37Z")

</div>

‘loglevel’ = 0,

Installed openldap.  
Everything is working. And without ldap, no.

But I need to use a cluster without ldap

---

<div class="post-metadata">

**Author:** ![Finalls](https://help.nextcloud.com/letter_avatar/finalls/32/5_5575768a8748004e209b776fc1b2916d.png) [@Finalls](https://help.nextcloud.com/u/Finalls)\
**Post date:** [February 19, 2019, 2:56pm UTC](https://help.nextcloud.com/t/help-needed-to-setup-a-nc14-cluster/39707/18 "2019-02-19T14:56:44Z")

</div>

> [@Finalls](#):
>
> @nickvergessen

All hope for you

---

<div class="post-metadata">

**Author:** ![sciurius](https://help.nextcloud.com/user_avatar/help.nextcloud.com/sciurius/32/13896_2.png) [@sciurius](https://help.nextcloud.com/u/sciurius)\
**Post date:** [March 11, 2020, 3:33pm UTC](https://help.nextcloud.com/t/help-needed-to-setup-a-nc14-cluster/39707/20 "2020-03-11T15:33:07Z")

</div>

I tried to create the following configuration:

![](https://help.nextcloud.com/uploads/default/original/2X/b/b9a67414e53b780ee50560b2e9ff33a854c211c9.png)

The original setup was data, database and nc on a single server (NC1). Now a second server NC2 is running in parallel using the database and data (SMB mount).

The config.php on the servers is near identical (in particular, instance\_id, password\_salt, secret, database, data). No distributed cache. Currently, DNS announces NC1 to be the ‘cloud’. For testing, a local DNS override makes it possible to use NC2 as cloud on a single PC only.

Problem: I can login to NC2 and everything works. Logging in to NC1 gives username/password incorrect. I can request a password reset, change the password to its original value, and login to NC1, once. And then the username/password is incorrect again.  
NC2 continues to work with the same credentials as always.

All other clients on the network that use NC1 (with the same credentials as always) stopped working.

I must be overlooking something… But what?

---

<div class="post-metadata">

**Author:** ![EmreCan](https://help.nextcloud.com/letter_avatar/emrecan/32/5_5575768a8748004e209b776fc1b2916d.png) [@EmreCan](https://help.nextcloud.com/u/EmreCan)\
**Post date:** [March 15, 2020, 7:54pm UTC](https://help.nextcloud.com/t/help-needed-to-setup-a-nc14-cluster/39707/21 "2020-03-15T19:54:07Z")

</div>

If you find the solution, can you write me and I’m trying to set up the same system with 2 nodes

[Next page](https://help.nextcloud.com/t/help-needed-to-setup-a-nc14-cluster/39707.md?page=2)
