Skip to content
Snippets Groups Projects
Commit 36581a72 authored by Antoine Schildknecht's avatar Antoine Schildknecht
Browse files

Add doc for HA deployment

parent 80cdb262
No related branches found
No related tags found
No related merge requests found
# HA deployment
## Prerequisites
* root access on the computer used for the deployment, with the following :
* SSH access to every computers of the deployment scope
* `git` package
* An account on [mirismanager](https://mirismanager.ubicast.eu)
## Configuration on miris manager
Go to the [miris manager](https://mirismanager.ubicast.eu/) web page corresponding to the mediaserver.
Go to the ERP webpage of the server.
In the `Mot de passe` tab clic on `Nouvel identifiant` and fill the fields as following (keep default value if the field is not mentionned) :
```sh
Type d'identifiant : Database
Mot de passe : <Générer un mot de passe complexe avec le bouton associé>
Avancé : <Cocher>
Lien : localhost:54321
```
Clic on `Envoyer`
You can check in `Exporter tous les identifiants > envsetup` that the `DB_PORT='54321'` line is showing.
## Installation scripts preparation
On the computer used for the deployment, go to the `/root` folder.
Get the latest deployment scripts :
```sh
cd /root
git clone https://git.ubicast.net/mediaserver/envsetup
cd envsetup
```
Configure the environment as described [here](./install.md)
## HA inventory configuration
Make a copy of the example inventory :
```sh
cp -r inventories/exemple-ha inventories/<client-ha>
```
Configure the following :
* `inventories/<client-ha>/hosts` : change the IP addresses according to the real deployment environment
* `inventories/<client-ha>/group_vars/all.yml` : adapt the IP addresses following the `server pgX` and `server msX` statements
* `inventories/<client-ha>/host_vars/*.yml` : in every file put the skyreach API key in place of the `changeme` statement
## Verification
Before deploying, check that every computer is accessible from ansible with the following command :
```sh
ansible -i inventories/<client-ha> -m ping all
```
If a computer response is `UNREACHABLE`, check if he is powered on and accessible through SSH
## Deployment
You can deploy the environment with the following command :
```sh
make deploy-ha i=inventories/<client-ha>
```
# Known error (patched in the next skyreach release)
If the following error is encountered during the deployment :
```sh
[...]
Action "init" failed:
Database creation failed. The following command exited with code 2:
PGPASSWORD='*****' psql -w -q -A -h localhost -p 5432 -U postgres -c "CREATE USER skyreach WITH PASSWORD '******';"
psql: FATAL: password authentication failed for user "postgres"
FATAL: password authentication failed for user "postgres"
[...]
```
It may be linked to a current skyreach bug (a patch is waiting to be deployed at the time of writing) causing it not to take the DB_PORT from mirismanager configuration in account (5432 instead of 54321 for HA).
You can edit the skyreach configuration manual with the following command :
```sh
ansible -i inventories/<client-ha> -m shell -a "sed -i \"s/'PORT': .*/'PORT': '54321'/g\" /home/skyreach/htdocs/skyreach_site/settings_override.py" ms1
```
and then deploy again as described in the previous section
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment