Aktiv/Passive-Cluster
Zur Navigation springen
Zur Suche springen
Grundinstallation
Bei Strato den Punkt Mein Server/Neuinstallation auswählen und dann den Installationsassistent starten.
| Nutzungszweck: | Experteneinsatz |
| Betriebssystem: | CentOS 7 64bit |
| Sprache: | deutsch |
| Partitionierung: | minimal (/boot 1GB, swap 8GB, / 20GB) |
Dann die Neuinstallation durch setzen des Hakens starten.
Root-Partition vergrößern
Das System im Rescue-Modus über die Strato-Oberfläche starten. Nach der Anmeldung als root, die bestehende Raid-Devices starten.
root@h2814988:~# mdadm -A --scan
root@h2814988:~# cat /proc/mdstat
Personalities : [raid0] [raid1] [raid10] [raid6] [raid5] [raid4]
md126 : active raid1 sda1[0] sdb1[1]
1023936 blocks super 1.0 [2/2] [UU]
md127 : active raid1 sda3[0] sdb3[1]
20479872 blocks super 1.0 [2/2] [UU]
unused devices: <none>
Anzeige der Information über das Raid.
root@h2814988:~# mdadm -D /dev/md127
/dev/md127:
Version : 1.0
Creation Time : Mon Feb 4 21:34:05 2019
Raid Level : raid1
Array Size : 20479872 (19.53 GiB 20.97 GB)
Used Dev Size : 20479872 (19.53 GiB 20.97 GB)
Raid Devices : 2
Total Devices : 2
Persistence : Superblock is persistent
Update Time : Tue Feb 5 19:07:19 2019
State : clean
Active Devices : 2
Working Devices : 2
Failed Devices : 0
Spare Devices : 0
Name : h2814988:1 (local to host h2814988)
UUID : a48d1ffe:267e9e65:2bd0b927:2fee1978
Events : 4
Number Major Minor RaidDevice State
0 8 3 0 active sync /dev/sda3
1 8 19 1 active sync /dev/sdb3
Nun mit fdisk die Partitonstabelle der beiden Festplatten ändern.
root@h2814988:~# fdisk /dev/sda
Welcome to fdisk (util-linux 2.25.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Command (m for help): d
Partition number (1-3, default 3): 3
Partition 3 has been deleted.
Command (m for help): n
Partition type
p primary (2 primary, 0 extended, 2 free)
e extended (container for logical partitions)
Select (default p): p
Partition number (3,4, default 3): 3
First sector (10049536-3907029167, default 10049536):
Last sector, +sectors or +size{K,M,G,T,P} (10049536-3907029167, default 3907029167): +100G
Created a new partition 3 of type 'Linux' and of size 100 GiB.
Command (m for help): t
Partition number (1-3, default 3): 3
Hex code (type L to list all codes): fd
Changed type of partition 'Linux' to 'Linux raid autodetect'.
Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Re-reading the partition table failed.: Device or resource busy
The kernel still uses the old table. The new table will be used at the next reboot or after you run partprobe(8) or kpartx(8).
root@h2814988:~# partprobe
und zum Schluß das Raid verhrößern
root@h2814988:~# mdadm --grow /dev/md127 --size=max --assume-clean
mdadm: component size of /dev/md127 has been set to 104857524K
unfreeze
root@h2814988:~# mdadm -D /dev/md127
/dev/md127:
Version : 1.0
Creation Time : Mon Feb 4 21:34:05 2019
Raid Level : raid1
Array Size : 104857524 (100.00 GiB 107.37 GB)
Used Dev Size : 104857524 (100.00 GiB 107.37 GB)
Raid Devices : 2
Total Devices : 2
Persistence : Superblock is persistent
Update Time : Tue Feb 5 19:10:00 2019
State : clean
Active Devices : 2
Working Devices : 2
Failed Devices : 0
Spare Devices : 0
Name : h2814988:1 (local to host h2814988)
UUID : a48d1ffe:267e9e65:2bd0b927:2fee1978
Events : 6
Number Major Minor RaidDevice State
0 8 3 0 active sync /dev/sda3
1 8 19 1 active sync /dev/sdb3
Das System nun über die Strato-Oberfläche wieder normal booten und dann anschließend noch das root-Filesystem vergrößern.
[root@h2814988 ~]# df -h
Dateisystem Größe Benutzt Verf. Verw% Eingehängt auf
/dev/md1 20G 1,1G 18G 6% /
devtmpfs 7,7G 0 7,7G 0% /dev
tmpfs 7,8G 0 7,8G 0% /dev/shm
tmpfs 7,8G 8,6M 7,8G 1% /run
tmpfs 7,8G 0 7,8G 0% /sys/fs/cgroup
/dev/md0 969M 127M 776M 14% /boot
tmpfs 1,6G 0 1,6G 0% /run/user/0
[root@h2814988 ~]# resize2fs /dev/md1
resize2fs 1.42.9[ 144.432758] EXT4-fs (md1): resizing filesystem from 5119968 to 26214381 blocks
(28-Dec-2013)
Das Dateisystem auf /dev/md1 ist auf / eingehängt; Online-Grössenveränderung nötig
old_desc_blocks = 2, new_desc_blocks = 7
[ 144.723033] EXT4-fs (md1): resized filesystem to 26214381
Das Dateisystem auf /dev/md1 ist nun 26214381 Blöcke groß.
[root@h2814988 ~]# df -h
Dateisystem Größe Benutzt Verf. Verw% Eingehängt auf
/dev/md1 99G 1,1G 94G 2% /
devtmpfs 7,7G 0 7,7G 0% /dev
tmpfs 7,8G 0 7,8G 0% /dev/shm
tmpfs 7,8G 8,6M 7,8G 1% /run
tmpfs 7,8G 0 7,8G 0% /sys/fs/cgroup
/dev/md0 969M 127M 776M 14% /boot
tmpfs 1,6G 0 1,6G 0% /run/user/0
Repositories
Zuerst zusätzliche Repositories hinzufügen und das System updaten.
yum -y update
yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -Uvh https://download1.rpmfusion.org/free/el/rpmfusion-free-release-7.noarch.rpm
rpm -Uvh https://download1.rpmfusion.org/nonfree/el/rpmfusion-nonfree-release-7.noarch.rpm
yum -y install logwatch perl-Net-SSLeay perl-Encode-Detect at mlocate vim-enhanced prelink
rpm -Uvh https://prdownloads.sourceforge.net/webadmin/webmin-1.900-1.noarch.rpm
RKhunter
yum install rkhunter
vim /etc/rkhunter.conf
rkhunter --update
rkhunter --propupd