Description:
At some time you may need to change the hostname of the SpectroSERVER. Once the hostname is changed on the server, the same should be updated in Spectrum application as well. This can be done by means of a perl script and some additional configuration changes.
Solution:
In order to update the new hostname in the Spectrum configuration files we need to follow the below process
ChangeHostname_Spectrum.pl <new hostname> Output: ChangeHostname_Spectrum.pl new_hostname Updating .hostrc Updating .installrc Updating UI-CONFIG.testme Updating LS/.locrc Updating LS/.natfwrc Updating SS/.natfwrc Updating SS/DDM/.natfwrc Updating bin/VBNS/.natfwrc Updating SG-Support/CsResource/preferences/ssroe.prf Updating tomcat/webapps/spectrum/META-INF/context.xml Updating vnmsh/.vnmshrc Completed conversion
=====================================#!/bin/perl################################################################################# CA Incorporated# 273 Corporate Drive# Portsmouth, NH 03801# Copyright (c) 2010 CA, Inc.# All rights reserved.## IN NO EVENT SHALL CA INCORPORATED BE LIABLE FOR# ANY INCIDENTAL, INDIRECT, SPECIAL, OR CONSEQUENTIAL DAMAGES# WHATSOEVER (INCLUDING BUT NOT LIMITED TO LOST PROFITS) ARISING OUT# OF OR RELATED TO THIS SOFTWARE, EVEN IF CA INCORPORATED HAS BEEN# ADVISED OF, KNOWN, OR SHOULD HAVE KNOWN, THE POSSIBILITY OF SUCH# DAMAGES.### Official Version: 1.1.1.2 - Date of Last Included Delta: 12/01/10 ################################################################################$hostname = $ARGV[0];$hostname =~ s/\..*$//g; # remove domain name$hostname =~ tr/[A-Z]/[a-z]/; # convert to lowercaseif ( $hostname eq "" ){print STDERR "\nError: need to specify the new hostname.\n\n";exit(1);}$specroot = $ENV{'SPECROOT'};chdir($specroot);print "Updating .hostrc\n";open(OH, "> .hostrc");print OH "$hostname\n";close(OH);print "Updating .installrc\n";open(FH, "< .installrc");open(OH, "> .installrc.new");while (<FH>){$_ = "LOCSERV: $hostname\n" if ( /^LOCSERV:/ );print OH;}close(FH);close(OH);unlink(".installrc");rename(".installrc.new", ".installrc");print "Updating UI-CONFIG.$hostname\n";@uicfg = glob("UI-CONFIG.*");open(FH, "< ". $uicfg[0]);open(OH, "> UI-CONFIG.$hostname");while (<FH>){$_ = " host = $hostname\n" if ( /^ host =/ );$_ = " ss_host = $hostname\n" if ( /^ ss_host =/ );$_ = " oc_host = $hostname\n" if ( /^ oc_host =/ );print OH;}close(FH);close(OH);unlink($uicfg[0]);print "Updating LS/.locrc\n";open(FH, "< LS/.locrc");open(OH, "> LS/.locrc.new");while (<FH>){$_ = "MAIN_LOCATION_HOST_NAME=$hostname\n" if ( /^MAIN_LOCATION_HOST_NAME=/ );print OH;}close(FH);close(OH);unlink("LS/.locrc");rename("LS/.locrc.new", "LS/.locrc");print "Updating LS/.natfwrc\n";open(FH, "< LS/.natfwrc");open(OH, "> LS/.natfwrc.new");while (<FH>){$_ = "vbroker.se.iiop_tp.proxyHost=$hostname\n" if ( /^vbroker.se.iiop_tp.proxyHost=/ );print OH;}close(FH);close(OH);unlink("LS/.natfwrc");rename("LS/.natfwrc.new", "LS/.natfwrc");print "Updating SS/.natfwrc\n";open(FH, "< SS/.natfwrc");open(OH, "> SS/.natfwrc.new");while (<FH>){$_ = "vbroker.se.iiop_tp.proxyHost=$hostname\n" if ( /^vbroker.se.iiop_tp.proxyHost=/ );print OH;}close(FH);close(OH);unlink("SS/.natfwrc");rename("SS/.natfwrc.new", "SS/.natfwrc");print "Updating SS/DDM/.natfwrc\n";open(FH, "< SS/DDM/.natfwrc");open(OH, "> SS/DDM/.natfwrc.new");while (<FH>){$_ = "vbroker.se.iiop_tp.proxyHost=$hostname\n" if ( /^vbroker.se.iiop_tp.proxyHost=/ );print OH;}close(FH);close(OH);unlink("SS/DDM/.natfwrc");rename("SS/DDM/.natfwrc.new", "SS/DDM/.natfwrc");print "Updating bin/VBNS/.natfwrc\n";open(FH, "< bin/VBNS/.natfwrc");open(OH, "> bin/VBNS/.natfwrc.new");while (<FH>){$_ = "vbroker.se.iiop_tp.proxyHost=$hostname\n" if ( /^vbroker.se.iiop_tp.proxyHost=/ );print OH;}close(FH);close(OH);unlink("bin/VBNS/.natfwrc");rename("bin/VBNS/.natfwrc.new", "bin/VBNS/.natfwrc");print "Updating SG-Support/CsResource/preferences/ssroe.prf\n";open(FH, "< SG-Support/CsResource/preferences/ssroe.prf");open(OH, "> SG-Support/CsResource/preferences/ssroe.prf.new");while (<FH>){$_ = " ui = $hostname\n" if ( /^ ui =/ );print OH;}close(FH);close(OH);unlink("SG-Support/CsResource/preferences/ssroe.prf");rename("SG-Support/CsResource/preferences/ssroe.prf.new","SG-Support/CsResource/preferences/ssroe.prf");print "Updating tomcat/webapps/spectrum/META-INF/context.xml\n";open(FH, "< tomcat/webapps/spectrum/META-INF/context.xml");open(OH, "> tomcat/webapps/spectrum/META-INF/context.xml.new");while (<FH>){if ( /locServerName=/ ){($before, $after) = ($_ =~ m@(.*)locServerName=[^\s]+(.*)@);$_ = "${before}locServerName=\"$hostname\"${after}";}if ( /\.proxyHost=/ ){($before, $after) = ($_ =~ m@(.*)\.proxyHost=[^\s]+(.*)@);$_ = "${before}.proxyHost=$hostname${after}";}print OH;}close(FH);close(OH);unlink("tomcat/webapps/spectrum/META-INF/context.xml");rename("tomcat/webapps/spectrum/META-INF/context.xml.new","tomcat/webapps/spectrum/META-INF/context.xml");print "Updating vnmsh/.vnmshrc\n";open(FH, "< vnmsh/.vnmshrc");open(OH, "> vnmsh/.vnmshrc.new");while (<FH>){$_ = "vnm_hostname=$hostname\n" if ( /^vnm_hostname=/ );print OH;}close(FH);close(OH);unlink("vnmsh/.vnmshrc");rename("vnmsh/.vnmshrc.new", "vnmsh/.vnmshrc");print "Completed conversion\n"; =========================================
Now you should be able to start processd and SpectroSERVER successfully with the new hostname.