Connecting to remote Database

Hi Guys, I hope everyone is doing great today? This is my second day of trying my hands on Nextcloud, so far so good. However, I want to use my system in production hence I don’t want to have a single sever installation.
I have decided to do this simple architecture:

Haproxy - Load balancer

Application & Web servers

Databases - MYSQL

I have been able to install the MYSQL database for a master master replication and its working fine.
I have installed the Nextcloud but where I am stock is how to tell nextcloud that I am using an external database and where to configure the parameters to allow installation wizard pick up the database. I would appreciate any help I can get.

Thanks

Hi @skillspec,

did you install Nextcloud via Software Center? You may edit /usr/share/nextcloud/config/config.php to set db host and credentials, see Nextcloud docs.

Do you use Nethservers for your haproxy mysql replication scenario?

1 Like

Ehi Beshel welcome here! Did you try @mrmarkuz’s input? Any news?
Did you check this yet?

I have been away and had very limited access to the internet hence I couldn’t reply.

This is the manual I used to build my nextcloud

However, I skipped the database part since I have already installed and clustered the MYSQL database.

I believe that since the database cluster is working very well the next step in my lap work is to install just one server of the nextcloud then connect to any of the database.
Once that is achieve then the next step which is pretty simple to to build a second nextlcoud server and cluster it using HAproxy.
At the moment when I run this command to finish the installation

sudo -u www-data php occ maintenance:install --database “mysql” --database-name “nextcloud” --database-user “nextcloud” --database-pass “YOURdbPASSWORD” --admin-user “ncadmin” --admin-pass “YOURadminPASSWORD”

its failing

Sorry, I don’t get where NethServer is in your scenario…with NethServer you are able to just install Nextcloud from Software Center, no need to setup manually.

On NethServer apache user is used instead of www-data so this may be the reason the command is not working. Do you get error messages on screen or in /var/log/messages?

yes I got error message that looks like that