웹사이트 검색

ISPConfig 3.1을 사용하여 Debian 8.4 Jessie에 웹, 이메일 및 MySQL 데이터베이스 클러스터 설치


이 튜토리얼은 ISPConfig 3 제어판이 있는 Debian 8에서 중복성, 고가용성 및 로드 밸런싱에 사용할 클러스터된 웹, 이메일, 데이터베이스 및 DNS 서버의 설치에 대해 설명합니다. MySQL 마스터/마스터 복제는 서버 간에 MySQL 클라이언트 데이터베이스를 복제하는 데 사용되고 Unison은 /var/www(웹 사이트)를 동기화하는 데 사용되며 메일은 Dovecot과 동기화됩니다.

1 일반 사항

이 설정에는 하나의 마스터 서버(ISPConfig 제어판 인터페이스를 실행)와 웹(apache), 이메일(postfix 및 dovecot), dns(bind) 및 데이터베이스(MySQL 또는 MariaDB) 서비스를 미러링하는 하나의 슬레이브 서버가 있습니다. 마스터 서버의.

클러스터 설정을 설치하려면 Debian 8.4 최소 설치와 동일한 ISPConfig 버전이 포함된 두 개의 서버가 필요합니다.

내 예에서는 두 서버에 대해 다음 호스트 이름과 IP 주소를 사용합니다.

마스터 서버

호스트 이름: server1.example.tld
IP 주소: 192.168.0.105
IPv6 주소: 2001:db8::1

슬레이브 서버

호스트 이름: server2.example.tld
IP 주소: 192.168.0.106
IPv6 주소: 2001:db8::2

다음 설치 단계에서 이러한 호스트 이름 또는 IP 주소가 나타날 때마다 서버의 IP 및 호스트 이름과 일치하도록 변경해야 합니다.

모든 명령은 루트 사용자로 실행해야 합니다. MySQL의 루트 암호를 사용하여 MySQL에 로그인하여 MySQL을 변경해야 하는 경우:

mysql -u root -p

2 마스터 서버 설치

먼저 마스터 서버에 ISPConfig를 설치해야 합니다. 이 서버에 ISPConfig를 이미 설치한 경우 설치를 건너뛸 수 있습니다(기존 설치가 최신인지 확인).

The Perfect Server - Debian 8.4 Jessie(Apache2, BIND, Dovecot, ISPConfig 3.1)에 따라 마스터 서버에 ISPConfig를 설치합니다.

슬레이브 서버를 /etc/hosts 파일에 추가

vi /etc/hosts

그래서 그것은 다음과 같습니다 :

127.0.0.1       localhost
192.168.0.105   server1.example.tld server1
2001:db8::1 server1.example.tld server1 192.168.0.106 server2.example.tld
2001:db8::2 server2.example.tld # The following lines are desirable for IPv6 capable hosts ::1 localhost ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters ff02::3 ip6-allhosts

3 슬레이브 서버 준비

The Perfect Server - Debian 8.4 Jessie(Apache2, BIND, Dovecot, ISPConfig 3.1)에서 1~19단계를 실행합니다.

아직 server2에 ISPConfig를 설치하지 마세요.

/etc/hosts 파일에 마스터 서버 추가

vi /etc/hosts

그래서 그것은 다음과 같습니다 :

127.0.0.1       localhost
192.168.0.105   server1.example.tld
2001:db8::1 server1.example.tld 192.168.0.106 server2.example.tld server2
2001:db8::2 server2.example.tld server2 # The following lines are desirable for IPv6 capable hosts ::1 localhost ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters ff02::3 ip6-allhosts

4 Server1에서 Server2로 키리스 로그인

서버 2:

암호를 사용하여 일시적으로 server2에 루트 로그인을 허용합니다. /etc/sshd_config 열기:

vi /etc/ssh/sshd_config

그리고 변화

PermitRootLogin without-password

에게

PermitRootLogin yes

그런 다음 ssh-daemon을 다시 시작하십시오.

service ssh restart

server1에서:

개인/공용 키 쌍을 만듭니다.

ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa): <-- ENTER
Created directory '/root/.ssh'.
Enter passphrase (empty for no passphrase): <-- ENTER
Enter same passphrase again: <-- ENTER
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
f3:d0:62:a7:24:6f:f0:1e:d1:64:a9:9f:12:6c:98:5a
The key's randomart image is:
+---[RSA 2048]----+
|                 |
|           .     |
|          +      |
|       + *       |
|      E S +      |
|     o O @ .     |
|    .   B +      |
|       o o       |
|        .        |
+-----------------+

암호를 입력하지 않는 것이 중요합니다. 그렇지 않으면 사람의 상호 작용 없이는 미러링이 작동하지 않으므로 간단히 ENTER를 누르십시오!

다음으로 공개 키를 server2.example.tld에 복사합니다.

ssh-copy-id -i /root/.ssh/id_rsa.pub 
The authenticity of host '192.168.0.106 (192.168.0.106)' can't be established.
ECDSA key fingerprint is 25:d8:7a:ee:c2:4b:1d:92:a7:3d:16:26:95:56:62:4e.
Are you sure you want to continue connecting (yes/no)? <-- yes (you will see this only if this is the first time you connect to server2)
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
's password: <- enter root password from server2

이제 머신에 로그인해 보십시오.

ssh 

그리고 /root/.ssh/authorized_keys를 확인하여 예상하지 못한 추가 키를 추가하지 않았는지 확인하십시오.

cat /root/.ssh/authorized_keys
ssh-dss AAAAB3NzaC1kc3MAAACBAPhiAexgEBexnw0rFG8lXwAuIsca/V+lhmv5lhF3BqUfAbL7e2sWlQlGhxZ8I2UnzZK8Ypffq6Ks+lp46yOs7MMXLqb7JBP9gkgqxyEWqOoUSt5hTE9ghupcCvE7rRMhefY5shLUnRkVH6hnCWe6yXSnH+Z8lHbcfp864GHkLDK1AAAAFQDddQckbfRG4C6LOQXTzRBpIiXzoQAAAIEAleevPHwi+a3fTDM2+Vm6EVqR5DkSLwDM7KVVNtFSkAY4GVCfhLFREsfuMkcBD9Bv2DrKF2Ay3OOh39269Z1rgYVk+/MFC6sYgB6apirMlHj3l4RR1g09LaM1OpRz7pc/GqIGsDt74D1ES2j0zrq5kslnX8wEWSHapPR0tziin6UAAACBAJHxgr+GKxAdWpxV5MkF+FTaKcxA2tWHJegjGFrYGU8BpzZ4VDFMiObuzBjZ+LrUs57BiwTGB/MQl9FKQEyEV4J+AgZCBxvg6n57YlVn6OEA0ukeJa29aFOcc0inEFfNhw2jAXt5LRyvuHD/C2gG78lwb6CxV02Z3sbTBdc43J6y 

암호를 사용한 루트 로그인을 허용하지 않습니다. /etc/sshd_config 열기:

vi /etc/ssh/sshd_config

그리고 변화

PermitRootLogin yes

에게

PermitRootLogin without-password

그런 다음 ssh-daemon을 다시 시작하십시오.

service ssh restart

server2에서 로그아웃:

exit
logout
Connection to 192.168.0.106 closed.

이제 server1로 돌아왔습니다.