What are the changes that are needed to be performed to change a hostname/dns alias name for a node once clustering is set-up?

asked 20 Sep '15, 22:51

Aditya's gravatar image

Aditya
10018
accept rate: 6%


Here are the steps to be performed to change hostname/alias name for a node post clustering set-up

Step 1 - Kill Tomcat Process On Master Node:

Stop tomcat using the command - $ /etc/init.d/tomcat stop

On Child Node:

Stop tomcat using the command - $ /etc/init.d/tomcat stop

Step 2 –Modify Profiler.xml On Master Node:

Change Profiler.xml at <main securonix="" directory="">/tomcat-7.0.securonix/conf/Catalina/localhost to connect using the new hostname.

The URL attribute in the XML should be changed from - url="jdbc:mysql://oldmysqlserverhost_master:3306/databasename_master?autoReconnect=true&rewriteBatchedStatements=true" To -url="jdbc:mysql://newmysqlalias_master:3306/databasename_master?autoReconnect=true&rewriteBatchedStatements=true"

On Child Node:

Change Profiler.xmlat <main securonix="" directory="">/tomcat-7.0.securonix/conf/Catalina/localhost to connect using the new hostname.

The URL attribute in the XML should be changed from - url="jdbc:mysql://oldmysqlserverhost_child:3306/databasename_child?autoReconnect=true&rewriteBatchedStatements=true" To -url="jdbc:mysql://newmysqlalias_child:3306/dtabasename_child?autoReconnect=true&rewriteBatchedStatements=true"

Step 3 – Modify hibernate.cfg

On Master Node:

If the child host is being relocated or renamed, edit the hibernate.cfg.<child node="" name="">.xml located at securonix_home/conf/hibernate. Find the property named hibernate.connection.url and change it to point to the new hostname. Perform this action on all master nodes, for all children being relocated.

Before: <property name="hibernate.connection.url">jdbc:mysql://oldmysqlserver_child:3306/database_child</property>

After: <property name="hibernate.connection.url">jdbc:mysql://newmysqlalias_child:3306/database_child</property>

On Child Node:

If the master host is being relocated or renamed, edit the hibernate.cfg.master.xml located at securonix_home/conf/hibernate. Find the property named hibernate.connection.url and change it to point to the new database. Perform this action on all child nodes.

Before: <property name="hibernate.connection.url">jdbc:mysql://oldmysqlserver_master:3306/database_master</property>

After: <property name="hibernate.connection.url">jdbc:mysql://newmysqlalias_master:3306/database_master</property>

Step 4 – Modify Datasource Properties

On Master Node:

The database includes records with references to its old location – these must be changed for the hostname/alias change to be take effect. Run the following query on the master’s database server:

mysql> update datasourcepropertiesdsp, datasources ds set dsp.propertyvalue = replace(dsp.propertyvalue, ‘oldddatabase_hostname’, ‘newdatabase_alias’) where ds.name = ‘SecuronixDB’ and dsp.datasourceid = ds.id;

If the child nodes’s hostnames/aliases are also being changed, run this query on the master database as well (for each child node being relocated):

mysql> update datasourcepropertiesdsp, datasources ds set dsp.propertyvalue = replace(dsp.propertyvalue, ‘olddatabase_host_child’, ‘newdatabase_alias_child’) where ds.name = ‘SecuronixDB_<node nick="" name="">’ and dsp.datasourceid = ds.id;

On Child Node:

No changes necessary.

Step 5 – Modify Application-Context.xml

On Master Node:

The application URL needs to be modified at <main_securonix_dir>/securonix_home/conf/application-context.xml, to reflect the new hostname or alias being used.

Before: <application-settings env="Prod" version="v4.6" url="http://oldhostname_master:8080/Profiler" mode="LIVE">

After: <application-settings env="Prod" version="v4.6" url="http://new_alias_master:8080/Profiler" mode="LIVE"> On Child Node:

The application URL needs to be modified at <main_securonix_dir>/securonix_home/conf/application-context.xml, to reflect the new hostname or alias being used.

Before: <application-settings env="Prod" version="v4.6" url="http://oldhostname_master:8080/Profiler" mode="LIVE">

After: <application-settings env="Prod" version="v4.6" url="http://new_alias_master:8080/Profiler" mode="LIVE">

Step 6 – Provide User Permissions

On Master Node:

At the MySQL command line prompt, provide the necessary permissions for the database account used by Securonix to access the database.

$ mysql –u username -p

mysql> grant all privileges on . to username@aliasname identified by 'password'; mysql> grant super on . to username@aliasname identified by 'password';

Repeat the above commands for all the master and the child aliases/hostnames

mysql> flush privileges;

On Child Node:

At the MySQL command line prompt, provide the necessary permissions to the database account used by Securonix to access the database.

$ mysql –u username -p

mysql> grant all privileges on . to username@aliasname identified by 'password'; mysql> grant super on . to username@aliasname identified by 'password';

Repeat the above commands for all the master and the child aliases/hostnames

mysql> flush privileges;

Step 7 (Optional) – Changing node names On Child Node:
To change the node names for child nodes -

$ cd $SECURONIX_HOME/conf

Edit the application-context.xml file to update the nodename in the clustering tag.

Change <clustering enabled="true" master="false" nodename="&lt;old_nodename&gt;" healthcheckinterval="30" syncnodesinterval="5" resourcegroupspernode="150" &gt;<="" p="">

to <clustering enabled="true" master="false" nodename="&lt;new_nodename&gt;" healthcheckinterval="30" syncnodesinterval="5" resourcegroupspernode="150" &gt;<="" p="">

Once the application is up, login on the master and check the status of the cluster. Perform an activity import and run policy

If the node name of the master nodes [in the clustering tag on application-context.xml] are changed, the following changes are to be done on the child server.

$ cd $SECURONIX_HOME/conf/hibernate/
$ mv hibernate.cfg.<oldmaster_nodename>.xml hibernate.cfg.<newmaster_nodename>.xml Repeat the above steps for each master node changed

On Master Node: If the node names of the child nodes [in the clustering tag on application-context.xml] are changed, the following changes are to be done on the Master server.

$ cd $SECURONIX_HOME/conf/hibernate/
$ mv hibernate.cfg.<oldchild_nodename>.xml hibernate.cfg.<newchild_nodename>.xml

Repeat the above steps for each child node changed

The database includes records with references to the child node's old node names – these must be changed for the nodename change to be take effect. Run the following query on the master’s database server for each child nodename changed -

mysql> update clustermaster set name = 'new_child_nodename' where name = 'old_child_nodename';

To change the node-name of the master,

$ cd $SECURONIX_HOME/conf

Edit the application-context.xml file to update the nodename in the clustering tag.

Change <clustering enabled="true" master="false" nodename="master" healthcheckinterval="30" syncnodesinterval="5" resourcegroupspernode="150"/>

to <clustering enabled="true" master="true" nodename="&lt;new_nodename&gt;" healthcheckinterval="30" syncnodesinterval="5" resourcegroupspernode="150" &gt;<="" p="">

Step 8 – Start Tomcat and Verify Migration On Master Node: Now that all changes have been made, we can start tomcat and verify the upgrade. Tomcat can be brought up again by running the startup script.

$ /etc/init.d/tomcat start

Once the application is up, login and check the status of the cluster. Perform an activity import and run policy violations to ensure proper operation.

On Child Node:
Now that all changes have been made, we can start tomcat and verify the upgrade. Tomcat can be brought up again by running the startup script.

$ /etc/init.d/tomcat start

Once the application is up, login on the master and check the status of the cluster. Perform a manual sync from the clustering console to ensure proper operation.

link

answered 20 Sep '15, 23:00

Aditya's gravatar image

Aditya
10018
accept rate: 6%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×4
×1
×1

Asked: 20 Sep '15, 22:51

Seen: 1,465 times

Last updated: 20 Sep '15, 23:00