1. install and configure Virtualbox Virtual Machine Ubuntu 12.04 and set dual-nic
Configure two NICs for ubuntu, one connected to the Host, Host-Only, and the other connected to the Internet, Bridge.
The virtual network card of the Intranet can be set to add a new virtual network card in the global Preference of virtualbox, and set to static, that is, DHCP is canceled.
My settings are as follows:
IP 192.168.56.1
Mask limit 255.0
Enter the VM to set the NIC device:
Sudo vim/etc/network/interfaces
# The loopback network interface
Auto lo
Iface lo inet loopback
# The primary network interface
Auto eth0
Iface eth0 inet dhcp
# The second eth1
Auto eth1
Iface eth1 inet static
Address 192.168.56.2
Netmask 255.255.255.0
Note that no gateway is set for eth1 (internal network). The default gateway can only have one gateway, which is the default gateway for eth2 on the Internet.
Then execute:
/Etc/init. d/networking restart
In this way, you can ping 192.168.56.1 or www.bkjia.com!
2. Add a new SATA disk device to the VM, with a capacity of 8 GB and mounted to/mnt/cdrom:
Mount/dev/sdb1/mnt/cdrom
3. insert an 8g usb flash drive to the host and mount it to/mnt/cdrom.
Mount/dev/sdb1/mnt/cdrom
4. Install and compile DRBD
Download the source code from the official network. I use drbd-8.4.4.tar.gz. Compile the kernel module drbd. ko on the host and Virtual Machine respectively and load it to the kernel:
Modprobe drbd
Installation Process reference: http://www.drbd.org/users-guide/p-build-install-configure.html
DRBD for Linux high availability (HA) CLUSTERS
DRBD Chinese application guide PDF
Installation and configuration notes for DRBD in CentOS 6.3
High-availability MySQL based on DRBD + Corosync
Install and configure DRBD in CentOS 6.4
DRBD details: click here
DRBD: click here