I have tested this with two Ubuntu 8.10 hosts (both x86_64). I can't say anything whether this also works on i386 systems because I haven't tested it.
I do not issue any guarantee that this will work for you!
1 Preliminary Note
I'm using two Ubuntu 8.10 servers here as my KVM hosts:
- server1.example.com: IP address 192.168.0.100
- server2.example.com: IP address 192.168.0.101
The servers are located in a private network with a DHCP server (on the router, IP 192.168.0.1). Enomalism usage might be different if you use it in a public network.
I'm running all the steps in this tutorial with root privileges, so make sure you're logged in as root:
sudo su
Please check if your CPU supports hardware virtualization - if this is the case, the command
egrep '(vmx|svm)' --color=always /proc/cpuinfo
should display something, e.g. like this:
root@server1:~# egrep '(vmx|svm)' --color=always /proc/cpuinfo
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext
fxsr_opt rdtscp lm 3dnowext 3dnow rep_good nopl pni cx16 lahf_lm cmp_legacy svm extapic cr8_legacy 3dnowprefetch
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext
fxsr_opt rdtscp lm 3dnowext 3dnow rep_good nopl pni cx16 lahf_lm cmp_legacy svm extapic cr8_legacy 3dnowprefetch
root@server1:~#
If nothing is displayed, then your processor doesn't support hardware virtualization, and you must stop here.
server1 will be the "master" in this setup and server2 the "slave", i.e., server2 will use the MySQL database on server1 and the directory /opt/enomalism2/repo (via NFS). (Of course, it's also possible to create a dedicated NFS server and export /opt/enomalism2/repo to both nodes.)
2 Setup On server1
server1:
server1 must be set up according to page 1 of this tutorial: KVM Virtualization With Enomalism 2 On An Ubuntu 8.10 Server
After you've set up Enomalism2, we must edit /etc/mysql/my.cnf so that MySQL listens on all interfaces (so that server2 can connect to this MySQL server later on) - comment out the line bind-address = 127.0.0.1:
vi /etc/mysql/my.cnf
[...] |
Then we restart MySQL:
/etc/init.d/mysql restart
Now check that networking is enabled. Run
netstat -tap | grep mysql
The output should look like this:
root@server1:~# netstat -tap | grep mysql
tcp 0 0 *:mysql *:* LISTEN 6724/mysqld
root@server1:~#
Then we connect to MySQL...
mysql -u root -p
... and create a database user that is allowed to connect to the enomalism2 database remotely (use the same database user and password that you used in the scripts/init-db.sh step when you set up Enomalism2):
grant all on enomalism2.* to enomalism@'%' identified by 'enomalismpassword';
FLUSH PRIVILEGES;
quit
To install an NFS server, we run:
aptitude install nfs-kernel-server nfs-common portmap
We must export the /opt/enomalism2/repo directory. We must modify /etc/exports where we "export" our NFS shares. We specify /opt/enomalism2/repo as NFS share and tell NFS to make accesses to /opt/enomalism2/repo as root (to learn more about /etc/exports, its format and available options, take a look at
man 5 exports
)
vi /etc/exports
# /etc/exports: the access control list for filesystems which may be exported |
(The no_root_squash option makes that /opt/enomalism2/repo will be accessed as root.)
Whenever we modify /etc/exports, we must run
exportfs -a
afterwards to make the changes effective.
3 Setup On server2
server2:
server2 must be set up according to page 1 of this tutorial, but with small differences: KVM Virtualization With Enomalism 2 On An Ubuntu 8.10 Server
I will outline the differences here - the rest is as described in the other tutorial:
When you copy the Enomalism2 configuration file, make sure you use the correct hostname (server2.example.com instead of server1.example.com):
cp server2.example.com.cfg config/server2.example.com.cfg
When you edit that file, make sure you fill in the correct IP address (192.168.0.101), and what is even more important, that you use the IP address of server1 (192.168.0.100) instead of localhost in the sqlobject.dburi line:
vi config/server2.example.com.cfg
[...] |
Now after the
/etc/init.d/libvirt-bin restart
part, we must configure NFS. Install the NFS client as follows:
aptitude install nfs-common portmap
Then mount the remote /opt/enomalism2/repo directory to /opt/enomalism2/repo:
mount 192.168.0.100:/opt/enomalism2/repo /opt/enomalism2/repo
To make sure that the NFS share gets mounted automatically when the client boots, open /etc/fstab and append the following line:
vi /etc/fstab
[...] |
After the NFS setup is finished, you can go on in the KVM Virtualization With Enomalism 2 On An Ubuntu 8.10 Server tutorial with the
scripts/enomalism2.sh start
command.
Finally, open http://192.168.0.101:8080/install in a browser (not just http://192.168.0.101:8080!) - this will complete the cluster node setup on server2:
Afterwards, you have two control panels, one on server1 (http://192.168.0.100:8080/) and one on server2 (http://192.168.0.101:8080/). It doesn't matter which one you use, they look and do the same.
Under Virtual Infrastructure > Infrastructure, you should now see both cluster nodes,...
... and you can now start deploying virtual machines on that cluster (as shown in KVM Virtualization With Enomalism 2 On An Ubuntu 8.10 Server):
4 Links
- Enomalism/Enomaly: http://www.enomalism.com/
- Ubuntu: http://www.ubuntu.com/
No comments:
Post a Comment