From: <btm...@us...> - 2010-07-29 17:44:07
|
Revision: 3351 http://bigdata.svn.sourceforge.net/bigdata/?rev=3351&view=rev Author: btmurphy Date: 2010-07-29 17:44:01 +0000 (Thu, 29 Jul 2010) Log Message: ----------- [trunk]: modified browser and disco-tool to fallback to a reasonable default nic on failure to support running these tools on windows Modified Paths: -------------- trunk/bigdata-jini/src/java/com/bigdata/disco/config/disco.config trunk/src/resources/bin/config/browser.config trunk/src/resources/bin/config/reggie.config trunk/src/resources/bin/config/serviceStarter.config trunk/src/resources/bin/config/zookeeper.config trunk/src/resources/bin/disco-tool trunk/src/resources/bin/pstart trunk/src/resources/config/jini/reggie.config Modified: trunk/bigdata-jini/src/java/com/bigdata/disco/config/disco.config =================================================================== --- trunk/bigdata-jini/src/java/com/bigdata/disco/config/disco.config 2010-07-29 17:30:26 UTC (rev 3350) +++ trunk/bigdata-jini/src/java/com/bigdata/disco/config/disco.config 2010-07-29 17:44:01 UTC (rev 3351) @@ -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: trunk/src/resources/bin/config/browser.config =================================================================== --- trunk/src/resources/bin/config/browser.config 2010-07-29 17:30:26 UTC (rev 3350) +++ trunk/src/resources/bin/config/browser.config 2010-07-29 17:44:01 UTC (rev 3351) @@ -9,12 +9,15 @@ import com.bigdata.util.config.NicUtil; com.sun.jini.example.browser { - private static exportIpAddr = NicUtil.getIpAddress("${exportNic}",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), @@ -22,9 +25,17 @@ false, true); -// initialLookupGroups = new String[] { }; - initialLookupGroups = new String[] { System.getProperty("user.name") + "InstallVerifyGroup" }; + initialLookupGroups = new String[] { }; exitActionListener = new com.sun.jini.example.browser.Browser.Exit(); + + uninterestingInterfaces = + new String[] { "java.io.Serializable", + "java.rmi.Remote", + "net.jini.admin.Administrable", + "net.jini.core.constraint.RemoteMethodControl", + "net.jini.id.ReferentUuid", + "com.bigdata.service.EventReceivingService" + }; } net.jini.discovery.LookupDiscovery { Modified: trunk/src/resources/bin/config/reggie.config =================================================================== --- trunk/src/resources/bin/config/reggie.config 2010-07-29 17:30:26 UTC (rev 3350) +++ trunk/src/resources/bin/config/reggie.config 2010-07-29 17:44:01 UTC (rev 3351) @@ -14,15 +14,17 @@ com.sun.jini.reggie { - private static exportNic = "${exportNic}"; - private static exportIpAddr = NicUtil.getIpAddress("${exportNic}",0,"${exportHost}",true); - private static exportPort = Integer.parseInt("${exportPort}"); + private static exportIpAddr = + NicUtil.getIpAddress("default.nic", "default", false); + private static exportPort = + Integer.parseInt( System.getProperty("exportPort", "0") ); private static serverILFactory = new BasicILFactory( new BasicMethodConstraints( new InvocationConstraints( - new ConnectionRelativeTime(10000), null)), + new ConnectionRelativeTime(10000L), + null)), null); serverExporter = new BasicJeriExporter(TcpServerEndpoint.getInstance(exportIpAddr,exportPort), @@ -30,11 +32,13 @@ false, true); - initialMemberGroups = new String[] { System.getProperty("user.name") + "InstallVerifyGroup" }; + initialMemberGroups = new String[] { System.getProperty("initialMemberGroups", System.getProperty("user.name")+"InstallVerifyGroup" ) }; + initialLookupGroups = initialMemberGroups; + initialLookupLocators = new LookupLocator[] { }; unicastDiscoveryHost = exportIpAddr; multicastInterfaces = new NetworkInterface[] { - NicUtil.getNetworkInterface(exportNic) + NicUtil.getNetworkInterface(exportIpAddr) }; minMaxServiceLease = 60000L; @@ -43,6 +47,6 @@ net.jini.discovery.LookupDiscovery { multicastRequestHost = com.sun.jini.reggie.exportIpAddr; multicastInterfaces = new NetworkInterface[] { - NicUtil.getNetworkInterface(com.sun.jini.reggie.exportNic) + NicUtil.getNetworkInterface(com.sun.jini.reggie.exportIpAddr) }; } Modified: trunk/src/resources/bin/config/serviceStarter.config =================================================================== --- trunk/src/resources/bin/config/serviceStarter.config 2010-07-29 17:30:26 UTC (rev 3350) +++ trunk/src/resources/bin/config/serviceStarter.config 2010-07-29 17:44:01 UTC (rev 3351) @@ -5,6 +5,7 @@ * well as the Jini lookup service and browser. */ 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 +14,21 @@ com.sun.jini.start { + private static codebaseHost = + NicUtil.getIpAddress("bigdata.codebase.host", "default", 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; @@ -39,15 +45,17 @@ httpdCodebase, httpdPolicyFile, httpdClasspath, httpdImplName, httpdArgsArray); - // For starting a zookeeper server - // - // It is expected that all zookeeper-specific code will be - // included in the classpath (zookeeper.jar), as part of the - // service platform, rather than being downloaded. Instead, + // It is expected that all service-specific code will be + // included in the classpath of the services being started + // (for example, bigdata.jar and zookeeper.jar), as part of + // the service platform, rather than being downloaded. Instead, // because bigdata is run with a class server serving the - // downloadable jini classes, the zookeeper codebase is set - // to include only the jini-specific downloaded classes. + // downloadable jini classes, the service codebases set below + // are defined to include only the jini-specific downloaded + // classes. + // For starting a zookeeper server (from the zookeeper codebase) + private static zookeeperCodebase = jskCodebase; private static zookeeperClasspath = "${appHome}${/}lib${/}zookeeper.jar"; @@ -70,9 +78,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 } ); @@ -98,9 +105,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: trunk/src/resources/bin/config/zookeeper.config =================================================================== --- trunk/src/resources/bin/config/zookeeper.config 2010-07-29 17:30:26 UTC (rev 3350) +++ trunk/src/resources/bin/config/zookeeper.config 2010-07-29 17:44:01 UTC (rev 3351) @@ -1,4 +1,12 @@ - +/* Configuration file for the Zookeeper wrapper service; + * where the wrapper service implementation is provided + * in the Hadoop Zookeeper codebase, and belongs to the + * org.apache.zookeeper.server.quorum namespace. + * + * Note that such a wrapper service implementation has + * not yet been released as part of the Hadoop Zookeeper + * codebase. + */ import java.net.NetworkInterface; import com.sun.jini.config.ConfigUtil; @@ -11,17 +19,17 @@ import net.jini.core.discovery.LookupLocator; import net.jini.discovery.LookupDiscoveryManager; +import com.bigdata.util.config.ConfigDeployUtil; import com.bigdata.util.config.NicUtil; org.apache.zookeeper.server.quorum { - private static exportNic = "${exportNic}"; private static exportIpAddr = - NicUtil.getIpAddress("${exportNic}",0,"${exportHost}",true); - private static exportPort = Integer.parseInt("${exportPort}"); + NicUtil.getIpAddress("default.nic", "default", false); + private static exportPort = + Integer.parseInt( System.getProperty("exportPort", "0") ); - private static groupsToJoin = - new String[] { System.getProperty("user.name") + "InstallVerifyGroup" }; + private static groupsToJoin = new String[] { System.getProperty("groupsToJoin", System.getProperty("user.name")+"InstallVerifyGroup" ) }; private static locatorsToJoin = new LookupLocator[] { }; private static exporterTcpServerEndpoint = @@ -30,7 +38,8 @@ new BasicILFactory( new BasicMethodConstraints( new InvocationConstraints( - new ConnectionRelativeTime(10000), null)), + new ConnectionRelativeTime(10000L), + null)), null); serverExporter = @@ -45,7 +54,10 @@ null, this); // Where service state is persisted - persistenceDirectory = "${appHome}${/}var${/}state${/}zookeeper"; + persistenceDirectory = + ConfigUtil.concat + ( new String[] { System.getProperty("app.home", "${user.dir}"), + "${/}var${/}state${/}zookeeperState" } ); zookeeperDataDir = "data"; zookeeperDataLogDir = "data.log"; @@ -58,19 +70,20 @@ // If standard zookeeper config is specified, // it will override jini config; for example, - //zookeeperConfigFile = "${user.home}${/}tmp${/}zookeeper${/}conf${/}test-zookeeper-q3.cfg"; + //zookeeperConfigFile = + // "${user.home}${/}tmp${/}zookeeper${/}conf${/}test-zookeeper-q3.cfg"; } 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) }; } net.jini.lookup.ServiceDiscoveryManager { - eventListenerExporter = new BasicJeriExporter - (org.apache.zookeeper.server.quorum.exporterTcpServerEndpoint, - org.apache.zookeeper.server.quorum.serverILFactory, - false, false); + eventListenerExporter = + new BasicJeriExporter + (org.apache.zookeeper.server.quorum.exporterTcpServerEndpoint, + org.apache.zookeeper.server.quorum.serverILFactory, false, false); } Modified: trunk/src/resources/bin/disco-tool =================================================================== --- trunk/src/resources/bin/disco-tool 2010-07-29 17:30:26 UTC (rev 3350) +++ trunk/src/resources/bin/disco-tool 2010-07-29 17:44:01 UTC (rev 3351) @@ -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: trunk/src/resources/bin/pstart =================================================================== --- trunk/src/resources/bin/pstart 2010-07-29 17:30:26 UTC (rev 3350) +++ trunk/src/resources/bin/pstart 2010-07-29 17:44:01 UTC (rev 3351) @@ -46,16 +46,20 @@ java.util.logging.config.file=/path/to/jini.logging The path to the java.util.logging configuration file - exportNic=<interfacename> + 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 services for remote communication. This property will be - employed only when the value of the exportNic property + 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. @@ -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['exportNic'] = "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( \ @@ -460,8 +468,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: trunk/src/resources/config/jini/reggie.config =================================================================== --- trunk/src/resources/config/jini/reggie.config 2010-07-29 17:30:26 UTC (rev 3350) +++ trunk/src/resources/config/jini/reggie.config 2010-07-29 17:44:01 UTC (rev 3351) @@ -16,7 +16,6 @@ private static exportIpAddr = NicUtil.getIpAddress("default.nic", "default", false); - private static exportPort = Integer.parseInt( System.getProperty("exportPort", "0") ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |