Help needed to setup a NC14 cluster

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 !

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.
nginx, php7.1,php-fpm

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

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

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

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

1 Like

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.


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!

Please Help !! =)
share your advice

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.

config.php absolutely the same. Only trusted_domains differ.

Here I spread a config. differences between two configs only in trusted_domains .

$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' => '',
  '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' => '',
'port' => 6379,
'timeout' => 0.0,
  '' => 'stable',

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

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

No more ideas?

I have this in my config.php

  '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.

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

I still get


“reqId”: “7QL0EDTtEMR1laaTuRgx”,
“level”: 2,
“time”: “2019-02-15T08:37:08+00:00”,
“remoteAddr”: “”,
“user”: “–”,
“app”: “core”,
“method”: “POST”,
“url”: “/login”,
“message”: “Login failed: ‘k.kurbanov’ (Remote IP: ‘’)”,
“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”: “”

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

‘loglevel’ = 0,

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

But I need to use a cluster without ldap

All hope for you

I tried to create the following configuration:

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?

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