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

On crée Tout d'abord, un répertoire pour monter le 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 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)