Help needed to setup a NC14 cluster


#1

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


#2

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


#3

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


#4

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


#5

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


SSL cert for nextcloud docker container
#6

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!


#7

Please Help !! =)
share your advice


#8

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.


#9

config.php absolutely the same. Only trusted_domains differ.
=(


#10

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',
);

#11

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


#12

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


#13

@nickvergessen
@Starfish
@JasonBayton
No more ideas?


#14

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.


#15

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”
}


#16

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


#17

‘loglevel’ = 0,

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

But I need to use a cluster without ldap


#18

All hope for you