From: <btm...@us...> - 2010-07-29 17:30:33
|
Revision: 3350 http://bigdata.svn.sourceforge.net/bigdata/?rev=3350&view=rev Author: btmurphy Date: 2010-07-29 17:30:26 +0000 (Thu, 29 Jul 2010) Log Message: ----------- [branch dev-btm]: modified browser and disco-tool to fallback to a reasonable default nic on failure Modified Paths: -------------- branches/dev-btm/bigdata-jini/src/java/com/bigdata/disco/config/disco.config branches/dev-btm/src/resources/bin/config/browser.config branches/dev-btm/src/resources/bin/config/serviceStarter.config branches/dev-btm/src/resources/bin/disco-tool branches/dev-btm/src/resources/bin/pstart branches/dev-btm/src/resources/config/jini/reggie.config branches/dev-btm/src/resources/config/jini/zookeeper.config Modified: branches/dev-btm/bigdata-jini/src/java/com/bigdata/disco/config/disco.config =================================================================== --- branches/dev-btm/bigdata-jini/src/java/com/bigdata/disco/config/disco.config 2010-07-29 16:54:30 UTC (rev 3349) +++ branches/dev-btm/bigdata-jini/src/java/com/bigdata/disco/config/disco.config 2010-07-29 17:30:26 UTC (rev 3350) @@ -18,8 +18,8 @@ com.bigdata.disco.DiscoveryTool { - private static exportIpAddr = - NicUtil.getIpAddress("${exportNic}", 0, "${exportHost}"); + private static exportIpAddr = + NicUtil.getIpAddress("default.nic", "default", true); lookupLocatorConstraints = null; Modified: branches/dev-btm/src/resources/bin/config/browser.config =================================================================== --- branches/dev-btm/src/resources/bin/config/browser.config 2010-07-29 16:54:30 UTC (rev 3349) +++ branches/dev-btm/src/resources/bin/config/browser.config 2010-07-29 17:30:26 UTC (rev 3350) @@ -9,12 +9,15 @@ import com.bigdata.util.config.NicUtil; com.sun.jini.example.browser { - private static exportIpAddr = NicUtil.getIpAddress("${default.nic}",0,"${exportHost}",true); + + private static exportIpAddr = + NicUtil.getIpAddress("default.nic", "default", true); + private static serverILFactory = new BasicILFactory( new BasicMethodConstraints( new InvocationConstraints( - new ConnectionRelativeTime(10000), null)), + new ConnectionRelativeTime(10000L), null)), null); listenerExporter = new BasicJeriExporter(TcpServerEndpoint.getInstance(exportIpAddr,0), Modified: branches/dev-btm/src/resources/bin/config/serviceStarter.config =================================================================== --- branches/dev-btm/src/resources/bin/config/serviceStarter.config 2010-07-29 16:54:30 UTC (rev 3349) +++ branches/dev-btm/src/resources/bin/config/serviceStarter.config 2010-07-29 17:30:26 UTC (rev 3350) @@ -4,7 +4,9 @@ * needs to start any of the Bigdata services, as * well as the Jini lookup service and browser. */ +import com.bigdata.util.config.ConfigDeployUtil; import com.bigdata.util.config.ConfigurationUtil; +import com.bigdata.util.config.NicUtil; import com.sun.jini.config.ConfigUtil; import com.sun.jini.start.NonActivatableServiceDescriptor; @@ -13,16 +15,21 @@ com.sun.jini.start { + private static codebaseHost = + NicUtil.getIpAddress("bigdata.codebase.host", ConfigDeployUtil.getString("node.serviceNetwork"), false); + private static codebasePort = + Integer.parseInt( System.getProperty("bigdata.codebase.port", "0") ); + private static codebaseRootDir = + System.getProperty("bigdata.codebase.rootdDir", "." ); + private static jskCodebase = ConfigurationUtil.computeCodebase - ( "${bigdata.codebase.host}", - "jsk-dl.jar", Integer.parseInt("${bigdata.codebase.port}"), - "${bigdata.codebase.rootDir}", "none" ); + ( codebaseHost, "jsk-dl.jar", + codebasePort, codebaseRootDir, "none" ); private static servicePolicyFile = "${appHome}${/}var${/}config${/}policy${/}service.policy"; - // For starting HTTP codebase class server private static httpdCodebase = ""; private static httpdPolicyFile = servicePolicyFile; @@ -92,8 +99,7 @@ // For starting a shard (data) service - private static shardCodebase = jskCodebase; - + private static shardCodebase = jskCodebase; private static shardClasspath = "${appHome}${/}lib${/}bigdata.jar"; private static shardImplName = "com.bigdata.shard.ServiceImpl"; private static shardConfig = "${appHome}${/}var${/}config${/}jini${/}shard.config"; @@ -198,9 +204,8 @@ // For starting a lookup service private static reggieServerCodebase = ConfigurationUtil.computeCodebase - ( "${bigdata.codebase.host}", - "reggie-dl.jar", Integer.parseInt("${bigdata.codebase.port}"), - "${bigdata.codebase.rootDir}", "none" ); + ( codebaseHost, "reggie-dl.jar", + codebasePort, codebaseRootDir, "none" ); private static reggieCodebase = ConfigUtil.concat( new String[] { reggieServerCodebase, " ", jskCodebase } ); @@ -226,9 +231,8 @@ // For starting a Jini browser private static browserServerCodebase = ConfigurationUtil.computeCodebase - ( "${bigdata.codebase.host}", - "browser-dl.jar", Integer.parseInt("${bigdata.codebase.port}"), - "${bigdata.codebase.rootDir}", "none" ); + ( codebaseHost, "browser-dl.jar", + codebasePort, codebaseRootDir, "none" ); private static browserCodebase = ConfigUtil.concat( new String[] { browserServerCodebase, " ", jskCodebase } ); Modified: branches/dev-btm/src/resources/bin/disco-tool =================================================================== --- branches/dev-btm/src/resources/bin/disco-tool 2010-07-29 16:54:30 UTC (rev 3349) +++ branches/dev-btm/src/resources/bin/disco-tool 2010-07-29 17:30:26 UTC (rev 3350) @@ -71,16 +71,22 @@ Prints this help message. Useful properties: - exportNic=<interfacename> + default.nic=<interfacename> Specifies the name of the network interface on which the ServiceDiscoveryManager's remote event listener will be exported. This - property takes precedence over entityExportHost. The default value is - "eth0". + property takes precedence over exportHost. The default behavior + regarding this property (in conjunction with the use of NicUtil + in the disco.config configuration file to retrieve the interface's + associated ip address) is to direct the configuration file to use + the IPv4 address of the first active network inteface that can + be found on the system. exportHost=<ipaddress|hostname> - Specifies the IP address on which the ServiceDiscoveryManager's remote - event listener will be exported. This property is not used unless - exportNic is "". + Specifies the IP address on which the ServiceDiscoveryManager's + remote event listener will be exported. This property will be + employed only when the value of the default.nic property + is set to the empty string ("") or a value that does not + correspond to any of the network interfaces on the system. Examples: Show information about all services, discovered through all @@ -158,7 +164,7 @@ java_props = { "java.security.manager": "", "java.net.preferIPv4Stack": "true", - "exportNic": "eth0", + "default.nic": "${default.nic}", "networkInterface": "all", "exportHost": socket.gethostname() } Modified: branches/dev-btm/src/resources/bin/pstart =================================================================== --- branches/dev-btm/src/resources/bin/pstart 2010-07-29 16:54:30 UTC (rev 3349) +++ branches/dev-btm/src/resources/bin/pstart 2010-07-29 17:30:26 UTC (rev 3350) @@ -49,8 +49,12 @@ default.nic=<interfacename> Specifies the name of the network interface to use by default for service export and remote communication. This property - takes precedence over exportHost. The default value for this - property is "eth0". + takes precedence over exportHost. The default behavior + regarding this property (in conjunction with configuration + files that use NicUtil to retrieve the interface's associated + ip address) is to direct the configuration file to use the + IPv4 address of the first active network inteface that can + be found on the system. exportHost=<ipaddress|hostname> Specifies the IP address or host name to use when exporting @@ -63,11 +67,15 @@ Specifies the network address of the codebase HTTP server. If the value is an interface name, the IP address assigned to that interface will be used. If the value is an IP address or hostname, that value - will be used directly. The default value is "eth0". + will be used directly. The default behavior regarding this property + (in conjunction with configuration files that use NicUtil to + retrieve the interface's associated ip address) is to direct the + configuration file to use the IPv4 address of the first active + network inteface that can be found on the system. bigdata.codebase.port=<n> The port number on <bigdata.codebase.host> on which the HTTP class - server is running. + server is listening. """ serviceNames = bigdataServiceMap.keys() @@ -131,10 +139,10 @@ self.properties['java.security.debug'] = "off" def setEntityProperties(self): - self.properties['default.nic'] = "eth0" + self.properties['default.nic'] = "${default.nic}" self.properties['exportHost'] = socket.gethostname() self.properties['exportPort'] = "0" - self.properties['bigdata.codebase.host'] = "eth0" + self.properties['bigdata.codebase.host'] = "${bigdata.codebase.host}" self.properties['bigdata.codebase.port'] = "8081" self.properties['log4j.configuration'] = os.path.join( \ @@ -461,8 +469,6 @@ if params.appHome == "NOT_SET": params.appHome = dirname(dirname( os.path.abspath(sys.argv[0])) ) - # BTM - params.appHome = dirname(dirname( os.path.abspath(sys.argv[0])) ) - # print "appHome=" + params.appHome # Instiantate the object for the service Modified: branches/dev-btm/src/resources/config/jini/reggie.config =================================================================== --- branches/dev-btm/src/resources/config/jini/reggie.config 2010-07-29 16:54:30 UTC (rev 3349) +++ branches/dev-btm/src/resources/config/jini/reggie.config 2010-07-29 17:30:26 UTC (rev 3350) @@ -17,7 +17,6 @@ private static exportIpAddr = NicUtil.getIpAddress("default.nic", ConfigDeployUtil.getString("node.serviceNetwork"), false); - private static exportPort = Integer.parseInt( System.getProperty("exportPort", "0") ); Modified: branches/dev-btm/src/resources/config/jini/zookeeper.config =================================================================== --- branches/dev-btm/src/resources/config/jini/zookeeper.config 2010-07-29 16:54:30 UTC (rev 3349) +++ branches/dev-btm/src/resources/config/jini/zookeeper.config 2010-07-29 17:30:26 UTC (rev 3350) @@ -7,7 +7,6 @@ * not yet been released as part of the Hadoop Zookeeper * codebase. */ - import java.net.NetworkInterface; import com.sun.jini.config.ConfigUtil; @@ -20,20 +19,18 @@ import net.jini.core.discovery.LookupLocator; import net.jini.discovery.LookupDiscoveryManager; -import com.bigdata.util.config.NicUtil; import com.bigdata.util.config.ConfigDeployUtil; +import com.bigdata.util.config.NicUtil; org.apache.zookeeper.server.quorum { - private static exportNic = - System.getProperty("exportNic", - ConfigDeployUtil.getString("node.serviceNetwork")); - private static exportIpAddr = NicUtil.getIpAddress(exportNic); + private static exportIpAddr = + NicUtil.getIpAddress("default.nic", ConfigDeployUtil.getString("node.serviceNetwork"), false); private static exportPort = Integer.parseInt( System.getProperty("exportPort", "0") ); - groupsToJoin = ConfigDeployUtil.getGroupsToDiscover(); - locatorsToJoin = ConfigDeployUtil.getLocatorsToDiscover(); + private static groupsToJoin = ConfigDeployUtil.getGroupsToDiscover(); + private static locatorsToJoin = ConfigDeployUtil.getLocatorsToDiscover(); private static exporterTcpServerEndpoint = TcpServerEndpoint.getInstance(exportIpAddr, exportPort); @@ -41,9 +38,7 @@ new BasicILFactory( new BasicMethodConstraints( new InvocationConstraints( - new ConnectionRelativeTime( - ConfigDeployUtil.getLong( - "rmi.connectTimeout")), + new ConnectionRelativeTime( ConfigDeployUtil.getLong("rmi.connectTimeout")), null)), null); @@ -82,7 +77,7 @@ net.jini.discovery.LookupDiscovery { multicastRequestHost = org.apache.zookeeper.server.quorum.exportIpAddr; multicastInterfaces = new NetworkInterface[] { - NicUtil.getNetworkInterface(org.apache.zookeeper.server.quorum.exportNic) + NicUtil.getNetworkInterface(org.apache.zookeeper.server.quorum.exportIpAddr) }; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |