Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Content imported from a Scroll Translations translation file.
Sv translation
languageen

Table of Contents
maxLevel3
printablefalse

Introduction

Regardless of the function a server is to perform, except STORE, the first step is to mount the STORE to the machine. The first VM to be set up should therefore be the role STORE.

Confiture

Configure STORE Mount

First a directory to mount STORE is created. STORE will be mounted in /home/jtel/shared. The path for the mount point is created with the following commands:

Translations Ignore


Code Block
mkdir /home/jtel/shared
chown jtel:jtel /home/jtel/shared


Mount with Credentials in fstab

The mount is then configured in the /etc/fstab file. The file can be edited with a text editor, or the following command will append the required line to the file:

Status
colourRed
titleCaution Password

Translations Ignore


Code Block
cat <<EOFF >> /etc/fstab
//acd-store/shared    /home/jtel/shared    cifs    user=jtel,password=<password>,uid=jtel,gid=jtel,file_mode=0755,dir_mode=0755,vers=3.0    0    0
EOFF


Notes:

  • If an external STORE is being mounted, it my be necessary to supply a domain name. In this case add the following in the options part of the fstab entry:
  • domain=DOMAINNAME

Mount with external Credentials file

To mount with the credentials stored in a separate file, proceed as follows.

Create a file, for example in /etc/store_credentials with the following content:

Status
colourRed
titleCaution Password

Translations Ignore


Code Block
domain=MYDOMAIN
username=jtel
password=<password>


Next, secure the file permissions:

Translations Ignore


Code Block
languagebash
chown root:root /etc/store-credentials
chmod 400 /etc/store-credentials


And finally, add the /etc/fstab entry:

Translations Ignore


Code Block
titleSecure entry in / etc / fstab
cat <<EOFF >> /etc/fstab
//acd-store/shared    /home/jtel/shared    cifs    credentials=/etc/jtel-credentials,uid=jtel,gid=jtel,file_mode=0755,dir_mode=0755,vers=3.0    0    0
EOFF


Mount STORE

The share can now be mounted. This is done with the command:

Translations Ignore


Code Block
languagebash
mount /home/jtel/shared


After mounting, a short test shows that the files can be accessed:

Translations Ignore


Code Block
[root@acd-db2 ~]# ls -la /home/jtel/shared/
total 52
drwxr-xr-x.  9 jtel jtel 4096 Mar 30 10:35 .
drwx------.  6 jtel jtel 4096 Jun 12 17:03 ..
drwxr-xr-x.  5 jtel jtel 4096 Mar 22 12:13 Data
drwxr-xr-x.  4 root root 4096 Jun 14 08:37 Import
drwxr-xr-x.  7 jtel jtel 4096 Jun 13 15:37 JTEL
drwxr-xr-x. 16 jtel jtel 4096 Mar 23 15:55 JTELCarrierPortal
drwxr-xr-x.  3 jtel jtel 4096 Jun 13 15:40 LogFiles
drwxr-xr-x.  3 jtel jtel 4096 Feb 10 12:49 LogFilesCall


Securing the Mount

Adding the following to crontab will ensure that the mount is restored, even if STORE is rebooted:

Translations Ignore


Code Block
languagebash
cat <<EOFF >> /etc/crontab
*/1  *  *  *  * root bash -c "if [ ! -d /home/jtel/shared/Data/system ]; then mount /home/jtel/shared ; fi"
EOFF


This can be tested as follows:

Translations Ignore


Code Block
languagebash
ls /home/jtel/shared
(files are there and are listed)
 
umount /home/jtel/shared
ls /home/jtel/shared
(files are no longer there and are not listed)

... Wait up to one minute
 
ls /home/jtel/shared
(files are there and are listed)





Sv translation
languagede

Status
colourRed
titleTHIS PAGE IS ONLY AVAILABLE IN ENGLISH

Sv translation
languagefr

Introduction

Quelle que soit la fonction qu'un serveur doit remplir, à l'exception du MAGASIN, la première étape consiste à monter le MAGASIN sur la machine. La première VM à mettre en place doit donc être le rôle MAGASIN.

Configurer le montage du MAGASIN

Tout d'abord, un répertoire pour monter MAGASIN est créé. MAGASIN sera monté dans / home / jtel / shared. Le chemin du point de montage est créé à l'aide des commandes suivantes

Table of Contents
maxLevel3
printablefalse

Einführung

Unabhängig von der Funktion die ein Server übernehmen soll, ausser STORE (der den Datenbereich sich selbst zur Verfügung stellt), wird das Datenbereich angebunden. Als erster VM sollte also die Rolle STORE fertig eingerichtet sein.

Anbinden des Datenbereiches

Als erstes wird eine Verbindung zum gemeinsamen Datenbereich hergestellt. Hierfür wird der Pfad für den Einhängepunkt mit folgenden Befehlen erstellt :

Translations Ignore


Connect Datastore - create directory
Code Block
title
mkdir /home/jtel/shared
 chown jtel:jtel /home/jtel/shared


Monter avec les références dans le fstab

La monture est ensuite configurée dans le fichier Im Anschluss wird die Verbindung in die Datei /etc/fstab konfiguriert. Die Datei kann mit einem Texteditor bearbeitet werden. Folgender Eintrag muss exemplarisch in die Datei eingefügt werden (password mit den entsprechenden Passwort ersetzen):

Translations Ignore
Code Block
titleAdditional entry in / etc / fstab
cat <<EOFF >> /etc/fstab
//acd-store/shared    /home/jtel/shared    cifs    user=jtel,password=<password>,uid=jtel,gid=jtel,file_mode=0755,dir_mode=0755    0    0
EOFF

. Le fichier peut être édité avec un éditeur de texte, ou la commande suivante ajoutera la ligne requise au fichier :

Status
colourRed
titleMot de passe de précaution

ACHTUNG: um alte File-Shares (SMB 1.0) anzubinden unter CentOS 7.x ist folgender Eintrag nötig:

Translations Ignore


title
Code Block
Additional entry in / etc / fstab
cat <<EOFF >> /etc/fstab
 //acd-store/shared    /home/jtel/shared    cifs    user=jtel,password=<password>,uid=jtel,gid=jtel,file_mode=0755,dir_mode=0755,vers=1.0    0 0    0
EOFF

Der erste Block der Zeile beschreibt den UNC der Freigabe. Hier muss gegebenenfalls der Name des Rechners (hier acd-lb) angepasst werden. Der dritte Block enthält unter anderem die Zugangsdaten zur Freigabe. Sollte hier auch Domainname notwendig sein, kann dieser mit einem zusätzlichen Parameter domain=DOMAINNAME durch Komma getrennt hinzugefügt werden. Ist es aus Sicherheitsgründen gewünscht, die Zugangsdaten nicht in der Datei /etc/fstab zu speichern, die aus systemimmanenten Gründen keine spezielle Leseeinschränkungen hat, so können diese in eine separate Datei ausgelagert werden. Eine solche Datei hätte dann folgendes Format (password mit den entsprechenden Passwort ersetzen):

Translations Ignore
Code Block
titleFile with separate access data
domain=MYDOMAIN
username=jtel
password=<password>
Diese Datei kann an einem beliebigen sinnvollen Ort (z.B. ins Home-Verzeichnis von root oder direkt ins /etc Verzeichnis) abgelegt werden und mit Nur-Leserechte für root ausgestattet werden. Unter der Annahme dass eine solche Datei den Namen /etc/jtel-credentials tragen würde, werden die Berechtigungen der Datei mit folgenden Befehlen gesichert
EOFF


Notes:

  • Si un MAGASIN externe est monté, il est nécessaire de fournir un nom de domaine. Dans ce cas, ajoutez ce qui suit dans la partie options de l'entrée fstab :
  • domain=DOMAINNAME

Montage avec fichier d'identification externe

Pour monter avec les justificatifs stockés dans un fichier séparé, procédez comme suit.

Créez un fichier, par exemple dans /etc/store_credentials avec le contenu suivant :

Status
colourRed
titleMot de passe de précaution

Translations Ignore


Code Block
domain=MYDOMAIN username=jtel password=<password>


Ensuite, il faut sécuriser les autorisations de fichiers :

Translations Ignore


Code Block
languagebashtitleBackup of the access data file
chown root:root /etc/jtelstore-credentials
 chmod 400 /etc/jtelstore-credentials
In der Datei 


Et enfin, ajoutez l'entrée /etc/fstab

 würde der Eintrag dann folgendermaßen aussehen.

:

Translations Ignore


Code Block
titleSecure entry in Entrée sécurisée dans / etc / fstab
//acd-store/shared	/home/jtel/shared	cifs	credentials=/etc/jtel-credentials,uid=jtel,gid=jtel,file_mode=0755,dir_mode=0755	0	0

ACHTUNG: um alte File-Shares (SMB 1.0) anzubinden unter CentOS 7.x ist folgender Eintrag nötig:

Translations Ignore
Secure entry in
Code Block
title
cat <<EOFF >> /etc/fstab
 //acd-store/shared	 /home/jtel/shared	 cifs	 credentials=/etc/jtel-credentials,uid=jtel,gid=jtel,file_mode=0755,dir_mode=0755,vers=1.0	0	0 0 0 EOFF


Rôle MAGASIN

L'action peut maintenant être montée. Cela se fait avec la commande Nach dem Konfigurieren der Verbindung kann die Freigabe nun eingehängt werden. Dies erfolgt mit dem Befehl :

Translations Ignore


Code Block
title
languagebashConnect the share
mount /home/jtel/shared


Nach dem Verbinden zeigt ein kurzer Test, dass auf die Dateien zugegriffen werden kannAprès le montage, un court test montre que les fichiers sont accessibles :

Translations Ignore


title
Code Block
Access test
[root@acd-db2 ~]# ls -la /home/jtel/shared/
 total 52
 drwxr-xr-x.  9 jtel jtel 4096 Mar 30 10:35 .
 drwx------.  6 jtel jtel 4096 Jun 12 17:03 ..
 drwxr-xr-x.  5 jtel jtel 4096 Mar 22 12:13 Data
 drwxr-xr-x.  4 root root 4096 Jun 14 08:37 Import
 drwxr-xr-x.  7 jtel jtel 4096 Jun 13 15:37 JTEL
 drwxr-xr-x. 16 jtel jtel 4096 Mar 23 15:55 JTELCarrierPortal
 drwxr-xr-x.  3 jtel jtel 4096 Jun 13 15:40 LogFiles
 drwxr-xr-x.  3 jtel jtel 4096 Feb 10 12:49 LogFilesCall

Sicherstellung des Mounts


Sécuriser la monture

L'ajout des éléments suivants à crontab garantira la restauration du montage, même si MAGASIN est redémarré Crontab anpassen, sodass der Mount selbst wiederhergestellt wird, und somit die Boot-Reihenfolge der Systeme auch unwichtig ist :

Translations Ignore


Code Block
title
languagebashSecuring the mount
cat <<EOFF >> /etc/crontab
 */1  *  *  *  * root bash -c "if [ ! -d /home/jtel/shared/Data/system ]; then mount /home/jtel/shared ; fi"
 EOFF


Dies kann wie folgt getestet werdenCela peut être testé comme suit :

Translations Ignore


Code Block
title
languagebashTesting ensuring the mount
ls /home/jtel/shared
 (files are there and are listed)
  
 umount /home/jtel/shared
 ls /home/jtel/shared
 (files are no longer there and are not listed)

 ... Wait up to one minute
  
 ls /home/jtel/shared
 (files are there and are listed)