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

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.

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    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    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 :

Translations Ignore


Code Block
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 /etc/fstab . 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

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 0 0 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
languagebash
chown root:root /etc/store-credentials chmod 400 /etc/store-credentials


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

Translations Ignore


Code Block
titleEntrée sécurisée dans / 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 0 0 EOFF


Rôle MAGASIN

L'action peut maintenant être montée. Cela se fait avec la commande :

Translations Ignore


Code Block
languagebash
mount /home/jtel/shared


Après le montage, un court test montre que les fichiers sont accessibles :

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


Sécuriser la monture

L'ajout des éléments suivants à crontab garantira la restauration du montage, même si MAGASIN est redémarré :

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


Cela peut être testé comme suit :

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)