Rocks Cluster : Editing Network Configurations

After installing Rocks, and dirtying your hands playing with the configurations, then to your horror you realize that the setting you put for your eth0 and eth1 is not like you intended. Or you want to edit the IP address for eth0 or eth1 as given by your network administrator. So, what you can do?

In Rocks, the configuration is store in configuration files and mysql database. So, how to edit the network configuration?

First, login into your mysql console.

$ mysql -u root -p
Enter password :


Enter your root password for the machine. For example, if you use 'abcd1234' (don't use this password, it is a weakest password), put in 'abcd1234'.

You can view current databases available in your server.

mysql> show databases;
+-----------+
| Database |
+-----------+
| cluster |
| mysql |
| test |
| wordpress |
+-----------+
4 rows in set (0.00 sec)


You can ignore mysql, test and wordpress unless you want to do something on the 3 databases. For now, we will concentrate on cluster database.

mysql> use cluster;
Database changed

You can use show tables command on the console to list all the tables available in the cluster database. But for now, I will concentrate on network table.

mysql> select * from networks;
+----+------+-------------------+-------------+---------------+---------------+
| ID | Node | MAC | IP | Netmask | Gateway | Name | Device | Module | Options | Comment |
+----+------+-------------------+-------------+---------------+---------------+
| 1 | 1 | theMac1| 192.168.1.3 | 255.255.255.0 | 192.168.1.254 | yourhost.yourdomain | eth0 | 3c59x | NULL | NULL |
| 2 | 1 | theMac2 | 192.168.0.1 | 255.255.255.0 | NULL | yourhost | eth1 | tg3 | NULL | NULL |
+----+------+-------------------+-------------+---------------+---------------+
2 rows in set (0.00 sec)


As you can see from the list, most of the network configuration is in the database. So, let say if you want to change the IP address from local into public IP use by your organization. And lets say the device that will bear the changes fall into eth0. So, do this sql statement.

mysql> update networks set ip='into.your.org.ip' where device='eth0';


Exit from mysql. Then execute this statement.

$ dbreport ifcfg eth0 yourhostname >> /etc/sysconfig/network-scripts/ifcfg-eth0

Restart your network or reboot your system to make sure the changes took effect.

This article is a part to help me in building the cluster and prevent me from digging into the Rocks mailing list. ;)

No comments: