Sv translation |
---|
|
Creating the Store with LVMMost of our Linux / CentOS installations work with LVM. This guide describes how to install the STORE role on a system using LVM. Step 1 - Determining the current config |
Erstellen des Stores mit LVM
Die meisten Linux / CentOS Installationen von uns arbeiten mit LVM. Diese Anleitung beschreibt, wie die Rolle STORE auf ein System mittels LVM installiert werden kann.
...
| Anzeige der disksFreierPlatzanzeigenPartitionenanzeigenFestplattenanzeigenFallsdiePlattenochnichtgesehenwerden kann, dannBus neu scannenbus
echo "- - -" > /sys/class/scsi_host/host0/scan
# |
| PhysischeVolumesanzeigendiedurch verwaltet werdenLogischeVolumesanzeigendiedurch verwaltet werdenLogischeVolumeGruppenanzeigendiedurch verwaltet werdenWoistwasgemounted |
Die Informationen oben werden nun gebraucht. Die Konfiguration sollte geprüft werden, nicht das bereits ein LVM für das Storage vorgesehen ist.
Schritt 2 - Anlegen einer neuen Partition
Hier ist es erforderlich, dass man weiß, wo der zusätzlicher Platz zu finden ist. Es gibt 2 Varianten - entweder eine neue Platte, oder eine erweiterte Platte.
In beiden Fällen, wird eine neue Partition angelegt. Hier in diesen Beispiel, wurde eine neue Platte genutzt, die auf /dev/sdb zu finden ist.
Die Befehle unten sowie die Partitionsnummer (bei einer vorhandenen Platte ist die Partition dann nicht mehr zwingend 1), entsprechend anpassen.
Code Block |
---|
language | bash |
---|
title | Partitionierung mit fdisk |
---|
|
fdisk /dev/sdb
# --> Bearbeiten der Partitionen auf /dev/sda
n
# --> Neue Partition anlegen
p
# --> Neue primary partition
1
# --> Neue Partition 1 anlegen (Ausgabe bei fdisk -1 oben betrachten)
Enter
# --> Bestätigung dass der erste verfügbarer Zylinder verwendet werden soll
Enter
# --> Bestätigung dass der letzte verfügbarer Zylinder verwendet werden soll (ergibt in Summe die maximale Größe)
t
# --> Typ der Partition ändern
8e
# --> Linux LVM
w
# --> Wenn OK, schreiben
reboot now |
Schritt 3 - Hereinnahme in LVM - Device Erzeugen
The information above is now needed. The configuration should be checked, maybe an LVM is already planned for the storage. Step 2 - Create a new partition Here it is necessary to know where to find the additional space. There are 2 variants - either a new plate, or an extended plate. In both cases, a new partition is created. Here in this example, a new disk was used, which can be found on /dev/sdb Adjust the commands below and the partition number (for an existing disk, the partition is then no longer necessarily 1) accordingly. Anzeige von Discs Translations Ignore |
---|
Code Block |
---|
language | bash |
---|
title | Partitioning with fdisk |
---|
| fdisk /dev/sdb
# --> Edit the partitions on /dev/sda
n
# --> Create new partition
p
# --> New primary partition
1
# --> Create new partition 1 (view output at fdisk -1 above)
Enter
# --> Confirmation that the first available cylinder should be used
Enter
# --> Confirmation that the last available cylinder is to be used (gives the maximum size in total)
t
# --> Change partition type
8e
# --> Linux LVM
w
# --> When OK, write
reboot now |
|
Step 3 - Inclusion in LVM - Create Device Translations Ignore |
---|
Code Block |
---|
language | bash |
---|
title | Create device for LVM |
---|
| # Here is the previous edition of /dev/sd* --> this is the new record (the 1st partition on /dev/sdb, i.e. the second hard disk, newly created partition)
lvm pvcreate /dev/sdb1 |
|
Step 4 - Create Volume Group Translations Ignore |
---|
Code Block |
---|
language | bash |
---|
title | Create LVM |
---|
| lvm vgcreate "vg_jtelshared" /dev/sdb1 |
|
Step 5 - Create Logical Volume Translations Ignore |
---|
Code Block |
---|
language | bash |
---|
title | Create LVM |
---|
| lvm lvcreate -l +100%FREE vg_jtelshared -n lv_jtelshared |
|
Step 6 - Create File System Translations Ignore |
---|
Code Block |
---|
language | bash |
---|
title | Create file system |
---|
| mkfs.xfs -L data /dev/vg_jtelshared/lv_jtelshared |
|
Step 7 - Prepare Mount Point Translations Ignore |
---|
Code Block |
---|
language | bash |
---|
title | Prepare mount point |
---|
| mkdir /srv/jtel
mkdir /srv/jtel/shared
chown -R jtel:jtel /srv/jtel/shared |
|
Step 8 - Set and mount the mount point in fstab fstab entry: Translations Ignore |
---|
Code Block |
---|
language | bash |
---|
title | vi /etc/fstab |
---|
| vi /etc/fstab
...
(add the following line)
/dev/mapper/vg_jtelshared-lv_jtelshared /srv/jtel/shared xfs defaults 0 0 |
|
And mount: Translations Ignore |
---|
Code Block |
---|
| mount /srv/jtel/shared |
|
Step 9 - Check interim result
Translations Ignore |
---|
Code Block |
---|
language | bash |
---|
title | Check final result |
---|
| df -h |
|
There should be an entry for /srv/jtel/shared with corresponding free space. Install Samba and lsof Translations Ignore |
---|
Code Block |
---|
| yum -y install samba samba-client lsof |
|
Translations Ignore |
---|
Code Block |
---|
| cat <<EOFF > /etc/samba/smb.conf
[global]
workgroup = SAMBA
security = user
passdb backend = tdbsam
printing = cups
printcap name = cups
load printers = yes
cups options = raw
min protocol = NT1
ntlm auth = yes
[homes]
comment = Home Directories
valid users = %S, %D%w%S
browseable = No
read only = No
inherit acls = Yes
[printers]
comment = All Printers
path = /var/tmp
printable = Yes
create mask = 0600
browseable = No
[print$]
comment = Printer Drivers
path = /var/lib/samba/drivers
write list = root
create mask = 0664
directory mask = 0775
[shared]
comment = jtel ACD Shared Directory
read only = no
public = yes
writable = yes
locking = yes
path = /srv/jtel/shared
guest ok = yes
create mask = 0644
directory mask = 0755
force user = jtel
force group = jtel
acl allow execute always = True
EOFF
sed -i -e "s/MYGROUP/WORKGROUP/g" /etc/samba/smb.conf |
|
Setup SeLinux, jtel User access and Firewall for SambaReplace <password> with the password for the jtel user: Translations Ignore |
---|
Code Block |
---|
title | SeLinux, jtel User, Firewall |
---|
| setsebool -P samba_enable_home_dirs=on samba_export_all_rw=on use_samba_home_dirs=on use_nfs_home_dirs=on
printf '<password>\n<password>\n' | smbpasswd -a -s jtel
firewall-cmd --zone=public --add-port=445/tcp --add-port=139/tcp --add-port=138/udp --add-port=137/udp --permanent
firewall-cmd --reload |
|
If necessary, add further users to samba - replacing password with the actual password for the user. Here, for example, the windows administrator user: Translations Ignore |
---|
Code Block |
---|
| useradd -m Administrator
printf '<password>\n<password>\n' | smbpasswd -a -s Administrator
|
|
Test SAMBA Translations Ignore |
---|
Code Block |
---|
| systemctl enable nmb
systemctl enable smb
systemctl start nmb
systemctl start smb |
|
Manually link /home/jtel/shared Translations Ignore |
---|
Code Block |
---|
title | link /home/jtel/shared |
---|
| ln -s /srv/jtel/shared /home/jtel/shared |
|
Test the file mount Translations Ignore |
---|
Code Block |
---|
| # From the windows machines:
dir \\acd-store\shared |
|
|
Sv translation |
---|
|
Erstellen des Stores mit LVMDie meisten Linux / CentOS Installationen von uns arbeiten mit LVM. Diese Anleitung beschreibt, wie die Rolle STORE auf ein System mittels LVM installiert werden kann. Schritt 1 - Feststellen der aktuellen config Translations Ignore |
---|
Code Block |
---|
language | bash |
---|
title | Display of discs |
---|
| # Show free space
df -h
# Partitionen anzeigen
fdisk -l
# Show partitions
ls /dev/sd*
# If the disk cannot yet be seen, re-scan the SCSI bus
echo "- - -" > /sys/class/scsi_host/host0/scan
# View physical volumes managed by LVM
lvm pvs
# Display logical volumes managed by LVM
lvm lvs
# Display logical volume groups managed by LVM
lvm vgs
# Where is what mounted
mount |
|
Die Informationen oben werden nun gebraucht. Die Konfiguration sollte geprüft werden, nicht das bereits ein LVM für das Storage vorgesehen ist. Schritt 2 - Anlegen einer neuen Partition Hier ist es erforderlich, dass man weiß, wo der zusätzlicher Platz zu finden ist. Es gibt 2 Varianten - entweder eine neue Platte, oder eine erweiterte Platte. In beiden Fällen, wird eine neue Partition angelegt. Hier in diesen Beispiel, wurde eine neue Platte genutzt, die auf /dev/sdb zu finden ist. Die Befehle unten sowie die Partitionsnummer (bei einer vorhandenen Platte ist die Partition dann nicht mehr zwingend 1), entsprechend anpassen. Display of discs Translations Ignore |
---|
Code Block |
---|
language | bash |
---|
title | Partitioning with fdisk |
---|
| fdisk /dev/sdb
# --> Edit the partitions on /dev/sda
n
# --> Create new partition
p
# --> New primary partition
1
# --> Create new partition 1 (view output at fdisk -1 above)
Enter
# --> Confirmation that the first available cylinder should be used
Enter
# --> Confirmation that the last available cylinder is to be used (gives the maximum size in total)
t
# --> Change partition type
8e
# --> Linux LVM
w
# --> When OK, write
reboot now |
|
Schritt 3 - Hereinnahme in LVM - Device Erzeugen Translations Ignore |
---|
Code Block |
---|
language | bash |
---|
title | Create device for LVM |
---|
| # Here is the previous edition of /dev/sd* --> this is the new record (the 1st partition on /dev/sdb, i.e. the second hard disk, newly created partition)
lvm pvcreate /dev/sdb1 |
|
Schritt 4 - Volume Group anlegen Translations Ignore |
---|
Code Block |
---|
language | bash |
---|
title | Create LVM |
---|
| lvm vgcreate "vg_jtelshared" /dev/sdb1 |
|
Schritt 5 - Logical Volume anlegen Translations Ignore |
---|
Code Block |
---|
language | bash |
---|
title | Create LVM |
---|
| lvm lvcreate -l +100%FREE vg_jtelshared -n lv_jtelshared |
|
Schritt 6 - File System erzeugen Translations Ignore |
---|
Code Block |
---|
language | bash |
---|
title | Create file system |
---|
| mkfs.xfs -L data /dev/vg_jtelshared/lv_jtelshared |
|
Schritt 7 - Mount Point vorbereiten Translations Ignore |
---|
Code Block |
---|
language | bash |
---|
title | Prepare mount point |
---|
| mkdir /srv/jtel
mkdir /srv/jtel/shared
chown -R jtel:jtel /srv/jtel/shared |
|
Schritt 8 - Mount Point in fstab festlegen und mounten fstab Eintrag: Translations Ignore |
---|
Code Block |
---|
language | bash |
---|
title | vi /etc/fstab |
---|
| vi /etc/fstab
...
(add the following line)
/dev/mapper/vg_jtelshared-lv_jtelshared /srv/jtel/shared xfs defaults 0 0 |
|
Und mounten: Translations Ignore |
---|
Code Block |
---|
| mount /srv/jtel/shared |
|
Schritt 9 - Zwischenergebnis prüfen
Translations Ignore |
---|
Code Block |
---|
language | bash |
---|
title | Check final result |
---|
| df -h |
|
Es sollte ein Eintrag für /srv/jtel/shared existieren mit entsprechend freier Platz. Install Samba and lsof Translations Ignore |
---|
Code Block |
---|
| yum -y install samba samba-client lsof |
|
Translations Ignore |
---|
Code Block |
---|
| cat <<EOFF > /etc/samba/smb.conf
[global]
workgroup = SAMBA
security = user
passdb backend = tdbsam
printing = cups
printcap name = cups
load printers = yes
cups options = raw
min protocol = NT1
ntlm auth = yes
[homes]
comment = Home Directories
valid users = %S, %D%w%S
browseable = No
read only = No
inherit acls = Yes
[printers]
comment = All Printers
path = /var/tmp
printable = Yes
create mask = 0600
browseable = No
[print$]
comment = Printer Drivers
path = /var/lib/samba/drivers
write list = root
create mask = 0664
directory mask = 0775
[shared]
comment = jtel ACD Shared Directory
read only = no
public = yes
writable = yes
locking = yes
path = /srv/jtel/shared
guest ok = yes
create mask = 0644
directory mask = 0755
force user = jtel
force group = jtel
acl allow execute always = True
EOFF
sed -i -e "s/MYGROUP/WORKGROUP/g" /etc/samba/smb.conf |
|
Setup SeLinux, jtel User access and Firewall for SambaReplace <password> with the password for the jtel user: Translations Ignore |
---|
Code Block |
---|
title | SeLinux, jtel User, Firewall |
---|
| setsebool -P samba_enable_home_dirs=on samba_export_all_rw=on use_samba_home_dirs=on use_nfs_home_dirs=on
printf '<password>\n<password>\n' | smbpasswd -a -s jtel
firewall-cmd --zone=public --add-port=445/tcp --add-port=139/tcp --add-port=138/udp --add-port=137/udp --permanent
firewall-cmd --reload |
|
If necessary, add further users to samba - replacing password with the actual password for the user. Here, for example, the windows administrator user: Translations Ignore |
---|
Code Block |
---|
| useradd -m Administrator
printf '<password>\n<password>\n' | smbpasswd -a -s Administrator
|
|
Test SAMBA Translations Ignore |
---|
Code Block |
---|
| systemctl enable nmb
systemctl enable smb
systemctl start nmb
systemctl start smb |
|
Manually link /home/jtel/shared Translations Ignore |
---|
Code Block |
---|
title | link /home/jtel/shared |
---|
| ln -s /srv/jtel/shared /home/jtel/shared |
|
Test the file mount Translations Ignore |
---|
Code Block |
---|
| # From the windows machines:
dir \\acd-store\shared |
|
|
Sv translation |
---|
|
Créer le magasin avec LVMLa plupart de nos installations Linux / CentOS fonctionnent avec LVM. Ce guide décrit comment installer le rôle MAGASIN sur un système utilisant LVM. Étape 1 - Détermination de la configuration actuelle Translations Ignore |
---|
Code Block |
---|
language | bash |
---|
title | Affichage de disques |
---|
| # Show free space df -h # Show partitions fdisk -l # Show partitions ls /dev/sd* # If the disk cannot yet be seen, re-scan the SCSI bus echo "- - -" > /sys/class/scsi_host/host0/scan # View physical volumes managed by LVM lvm pvs # Display logical volumes managed by LVM lvm lvs # Display logical volume groups managed by LVM lvm vgs # Where is what mounted mount |
|
Les informations ci-dessus sont maintenant nécessaires. La configuration doit être vérifiée, peut-être qu'un LVM est déjà prévu pour le stockage. Étape 2 - Créer une nouvelle partition Ici, il faut savoir où trouver l'espace supplémentaire. Il existe 2 variantes : soit une nouvelle plaque, soit une plaque étendue. Dans les deux cas, une nouvelle partition est créée. Dans cet exemple, un nouveau disque a été utilisé, qui peut être trouvé sur /dev/sdb Ajustez les commandes ci-dessous et le numéro de partition (pour un disque existant, la partition n'est alors plus nécessairement 1) en conséquence. Affichage du disque Translations Ignore |
---|
Code Block |
---|
language | bash |
---|
title | Partitionnement avec fdisk |
---|
| fdisk /dev/sdb # --> Modifier les partitions sur /dev/sda n # --> Créer une nouvelle partition p # --> Nouvelle partition primaire 1 # --> Créer une nouvelle partition 1 (voir la sortie sur fdisk -1 ci-dessus) Entrer # --> Confirmer que le premier cylindre disponible doit être utilisé Entrer # --> Confirmer que le dernier cylindre disponible doit être utilisé (donne la taille maximale au total) t # --> Modifier le type de partition 8e # --> LVM Linux w # --> Quand c'est bon, écrire "reboot now" |
|
Étape 3 - Inclusion dans LVM - Créer un Appareil Translations Ignore |
---|
Code Block |
---|
language | bash |
---|
title | Créer un appareil pour LVM |
---|
| # Here is the previous edition of |
|
|
Code Block |
---|
language | bash |
---|
title | Device für LVM erzeugen |
---|
|
# Hier die Ausgabe vorher vondashieristdieneue Plattedie1.Partitionaufsdb, sprich die zweite Festplatte, neu angelegte Partition)
sdb, i.e. the second hard disk, newly created partition) lvm pvcreate /dev/sdb1 |
|
|
...
...
Créer un groupe de volume Translations Ignore |
---|
Code Block |
---|
language | bash |
---|
title | Créer LVM |
---|
|
|
| anlegen | lvm vgcreate "vg_jtelshared" /dev/sdb1 |
|
|
...
Étape 5 - Créer un volume logique Translations Ignore |
---|
Code Block |
---|
language | bash |
---|
title | Créer LVM |
---|
|
|
| anlegen | lvm lvcreate -l +100%FREE vg_jtelshared -n lv_ |
| jtelshared |
...
Étape 6 - Création d'un système de fichiers | File System erzeugenCréer un système de fichiers |
| mkfs.xfs -L data /dev/vg_jtelshared/lv_jtelshared |
|
|
...
...
Préparer le point de monture | Mount | vorbereiten
chown -R jtel:jtel /srv/jtel/shared |
|
|
...
...
Définir et monter le point de montage dans le fstab entrée fstab : |
...
|
---|
Code Block |
---|
language | bash |
---|
title | vi /etc/fstab |
---|
| vi /etc/fstab |
|
folgendeZeilehinzufügen
/dev/mapper/vg_jtelshared-lv_jtelshared /srv/jtel/shared |
| xfs noauto,noatime,nodiratime 0 |
...
...
...
Vérification du résultat interime
| Endergebnis prüfenVérifier le résultat final |
| df -h |
|
|
...
Il devrait y avoir une entrée pour /srv/jtel/shared |
...
avec l'espace libre correspondant. |
...
...
et lsof | Install | yum -y install samba samba-client lsof |
|
|
...
| Configure | cat <<EOFF > /etc/samba/smb.conf |
|
workgroup = SAMBA
workgroup = SAMBA security = user |
|
= NT1
comment = Home Directories |
|
= No
inherit acls = Yes
[printers]
= No inherit acls = Yes [printers] comment = All Printers |
|
Drivers
Drivers path = /var/lib/samba/drivers |
|
comment = jtel ACD Shared Directory |
|
= yes
acl allow execute always = True |
|
sed -i -e "s/MYGROUP/WORKGROUP/g" /etc/samba/smb.conf |
|
|
...
Configuration de SeLinux, jtel |
...
Accès utilisateur et pare-feu pour Samba |
Replace <password> with the password for the jtel user:
Remplacez <password> par le mot de passe de l'utilisateur de jtel : Translations Ignore |
---|
Code Block |
---|
title | SeLinux, utilisateur jtel |
---|
|
|
| User | Firewall | setsebool -P samba_enable_home_dirs=on samba_export_all_rw=on use_samba_home_dirs=on use_nfs_home_dirs=on |
|
printf '<password>\n<password>\n' | smbpasswd -a -s jtel |
|
firewall-cmd --zone=public --add-port=445/tcp --add-port=139/tcp --add-port=138/udp --add-port=137/udp --permanent |
|
|
...
Si nécessaire, ajoutez d'autres utilisateurs à samba - en remplaçant le mot de passe par le mot de passe réel de l'utilisateur. Ici, par exemple, l'utilisateur administrateur de Windows : | More Plus d'utilisateurs de SAMBA |
|
|
| users
printf '<password>\n<password>\n' | smbpasswd -a -s Administrator |
|
Test SAMBA | Start
|
...
Lien manuel /home/jtel/shared | link | ln -s /srv/jtel/shared /home/jtel/shared |
|
|
...
Tester le fichier mount | Test file mountTester la monture du fichier |
| # From the windows machines: |
|
lb
|