ngrinder3.3对hosts内主机名配置要求?

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

ngrinder3.3对hosts内主机名配置要求?

ypspace
目前将agent部署在AIX上,启动成功,但是执行测试时报错,无法启动执行。
已下是错误日志:
2014-02-17 10:46:46,075 INFO  agent daemon: worker agent-06-0 started
Failed to instantiate [ch.qos.logback.classic.LoggerContext]
Reported exception:
java.lang.ExceptionInInitializerError
        at java.lang.J9VMInternals.initialize(J9VMInternals.java:222)
        at org.ngrinder.dns.LocalManagedDnsImpl.<init>(LocalManagedDnsImpl.java:33)
        at org.ngrinder.dns.LocalManagedDnsProxy.<init>(LocalManagedDnsProxy.java:30)
        at org.ngrinder.dns.LocalManagedDnsDescriptor.<clinit>(LocalManagedDnsDescriptor.java:29)
        at java.lang.J9VMInternals.initializeImpl(Native Method)
        at java.lang.J9VMInternals.initialize(J9VMInternals.java:200)
        at java.lang.Class.forNameImpl(Native Method)
        at java.lang.Class.forName(Class.java:172)
        at sun.misc.Service$LazyIterator.next(Service.java:283)
        at java.net.InetAddress$3.run(InetAddress.java:968)
        at java.security.AccessController.doPrivileged(AccessController.java:251)
        at java.net.InetAddress.<clinit>(InetAddress.java:962)
        at java.lang.J9VMInternals.initializeImpl(Native Method)
        at java.lang.J9VMInternals.initialize(J9VMInternals.java:200)
        at java.net.SocketPermission.getIP(SocketPermission.java:798)
        at java.net.SocketPermission.getCanonName(SocketPermission.java:636)
        at java.net.SocketPermission.hashCode(SocketPermission.java:1080)
        at java.util.HashMap.putImpl(HashMap.java:622)
        at java.util.HashMap.put(HashMap.java:607)
        at java.util.HashSet.add(HashSet.java:95)
        at org.apache.harmony.security.fortress.DefaultPolicyParser.resolveGrant(DefaultPolicyParser.java:288)
        at org.apache.harmony.security.fortress.DefaultPolicyParser.parse(DefaultPolicyParser.java:149)
        at org.apache.harmony.security.fortress.DefaultPolicy$1.run(DefaultPolicy.java:343)
        at org.apache.harmony.security.fortress.DefaultPolicy$1.run(DefaultPolicy.java:317)
        at java.security.AccessController.doPrivileged(AccessController.java:202)
        at org.apache.harmony.security.fortress.DefaultPolicy.refreshImpl(DefaultPolicy.java:317)
        at org.apache.harmony.security.fortress.DefaultPolicy.<init>(DefaultPolicy.java:218)
        at org.apache.harmony.security.fortress.DefaultPolicy.<init>(DefaultPolicy.java:211)
        at org.apache.harmony.security.fortress.DefaultPolicy.<init>(DefaultPolicy.java:198)
        at java.lang.J9VMInternals.newInstanceImpl(Native Method)
        at java.lang.Class.newInstance(Class.java:1345)
        at java.security.Policy$2.run(Policy.java:493)
        at java.security.Policy$2.run(Policy.java:489)
        at java.security.AccessController.doPrivileged(AccessController.java:202)
        at java.security.Policy.getDefaultProvider(Policy.java:489)
        at java.security.Policy.getAccessiblePolicy(Policy.java:524)
        at java.security.ProtectionDomain.implies(ProtectionDomain.java:199)
        at java.security.AccessController.checkPermission(AccessController.java:98)
        at ch.qos.logback.core.util.Loader$1.run(Loader.java:51)
        at ch.qos.logback.core.util.Loader$1.run(Loader.java:48)
        at java.security.AccessController.doPrivileged(AccessController.java:202)
        at ch.qos.logback.core.util.Loader.<clinit>(Loader.java:47)
        at java.lang.J9VMInternals.initializeImpl(Native Method)
        at java.lang.J9VMInternals.initialize(J9VMInternals.java:200)
        at ch.qos.logback.classic.util.ContextInitializer.findURLOfDefaultConfigurationFile(ContextInitializer.java:117)
        at ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:146)
        at org.slf4j.impl.StaticLoggerBinder.init(StaticLoggerBinder.java:84)
        at org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:54)
        at java.lang.J9VMInternals.initializeImpl(Native Method)
        at java.lang.J9VMInternals.initialize(J9VMInternals.java:200)
        at org.slf4j.LoggerFactory.bind(LoggerFactory.java:128)
        at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:108)
        at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:279)
        at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:252)
        at net.grinder.engine.process.WorkerProcessEntryPoint.run(WorkerProcessEntryPoint.java:73)
        at net.grinder.engine.process.WorkerProcessEntryPoint.main(WorkerProcessEntryPoint.java:60)
Caused by: java.lang.NullPointerException
        at java.net.InetAddress.getAddressFromNameService(InetAddress.java:1318)
        at java.net.InetAddress.getAllByName0(InetAddress.java:1268)
        at java.net.InetAddress.getAllByName(InetAddress.java:1197)
        at java.net.InetAddress.getAllByName(InetAddress.java:1119)
        at java.net.InetAddress.getByName(InetAddress.java:1069)
        at org.xbill.DNS.SimpleResolver.<init>(SimpleResolver.java:56)
        at org.xbill.DNS.SimpleResolver.<init>(SimpleResolver.java:68)
        at org.xbill.DNS.ExtendedResolver.<init>(ExtendedResolver.java:266)
        at org.xbill.DNS.Lookup.refreshDefault(Lookup.java:86)
        at org.xbill.DNS.Lookup.<clinit>(Lookup.java:97)
        at java.lang.J9VMInternals.initializeImpl(Native Method)
        at java.lang.J9VMInternals.initialize(J9VMInternals.java:200)
        ... 55 more
Exception in thread "main" java.lang.NoClassDefFoundError: java.net.InetAddress (initialization failure)
        at java.lang.J9VMInternals.initialize(J9VMInternals.java:140)
        at ch.qos.logback.core.util.ContextUtil.getLocalHostName(ContextUtil.java:32)
        at ch.qos.logback.core.util.ContextUtil.addHostNameAsProperty(ContextUtil.java:41)
        at ch.qos.logback.classic.joran.action.ConfigurationAction.begin(ConfigurationAction.java:48)
        at ch.qos.logback.core.joran.spi.Interpreter.callBeginAction(Interpreter.java:276)
        at ch.qos.logback.core.joran.spi.Interpreter.startElement(Interpreter.java:148)
        at ch.qos.logback.core.joran.spi.Interpreter.startElement(Interpreter.java:130)
        at ch.qos.logback.core.joran.spi.EventPlayer.play(EventPlayer.java:50)
        at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:147)
        at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:133)
        at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:96)
        at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:55)
        at net.grinder.engine.process.GrinderProcess.configureLogging(GrinderProcess.java:257)
        at net.grinder.engine.process.GrinderProcess.<init>(GrinderProcess.java:141)
        at net.grinder.engine.process.WorkerProcessEntryPoint.run(WorkerProcessEntryPoint.java:78)
        at net.grinder.engine.process.WorkerProcessEntryPoint.main(WorkerProcessEntryPoint.java:60)
Caused by: java.lang.ExceptionInInitializerError
        at java.lang.J9VMInternals.initialize(J9VMInternals.java:222)
        at org.ngrinder.dns.LocalManagedDnsImpl.<init>(LocalManagedDnsImpl.java:33)
        at org.ngrinder.dns.LocalManagedDnsProxy.<init>(LocalManagedDnsProxy.java:30)
        at org.ngrinder.dns.LocalManagedDnsDescriptor.<clinit>(LocalManagedDnsDescriptor.java:29)
        at java.lang.J9VMInternals.initializeImpl(Native Method)
        at java.lang.J9VMInternals.initialize(J9VMInternals.java:200)
        at java.lang.Class.forNameImpl(Native Method)
        at java.lang.Class.forName(Class.java:172)
        at sun.misc.Service$LazyIterator.next(Service.java:283)
        at java.net.InetAddress$3.run(InetAddress.java:968)
        at java.security.AccessController.doPrivileged(AccessController.java:251)
        at java.net.InetAddress.<clinit>(InetAddress.java:962)
        at java.lang.J9VMInternals.initializeImpl(Native Method)
        at java.lang.J9VMInternals.initialize(J9VMInternals.java:200)
        at java.net.SocketPermission.getIP(SocketPermission.java:798)
        at java.net.SocketPermission.getCanonName(SocketPermission.java:636)
        at java.net.SocketPermission.hashCode(SocketPermission.java:1080)
        at java.util.HashMap.putImpl(HashMap.java:622)
        at java.util.HashMap.put(HashMap.java:607)
        at java.util.HashSet.add(HashSet.java:95)
        at org.apache.harmony.security.fortress.DefaultPolicyParser.resolveGrant(DefaultPolicyParser.java:288)
        at org.apache.harmony.security.fortress.DefaultPolicyParser.parse(DefaultPolicyParser.java:149)
        at org.apache.harmony.security.fortress.DefaultPolicy$1.run(DefaultPolicy.java:343)
        at org.apache.harmony.security.fortress.DefaultPolicy$1.run(DefaultPolicy.java:317)
        at java.security.AccessController.doPrivileged(AccessController.java:202)
        at org.apache.harmony.security.fortress.DefaultPolicy.refreshImpl(DefaultPolicy.java:317)
        at org.apache.harmony.security.fortress.DefaultPolicy.<init>(DefaultPolicy.java:218)
        at org.apache.harmony.security.fortress.DefaultPolicy.<init>(DefaultPolicy.java:211)
        at org.apache.harmony.security.fortress.DefaultPolicy.<init>(DefaultPolicy.java:198)
        at java.lang.J9VMInternals.newInstanceImpl(Native Method)
        at java.lang.Class.newInstance(Class.java:1345)
        at java.security.Policy$2.run(Policy.java:493)
        at java.security.Policy$2.run(Policy.java:489)
        at java.security.AccessController.doPrivileged(AccessController.java:202)
        at java.security.Policy.getDefaultProvider(Policy.java:489)
        at java.security.Policy.getAccessiblePolicy(Policy.java:524)
        at java.security.ProtectionDomain.implies(ProtectionDomain.java:199)
        at java.security.AccessController.checkPermission(AccessController.java:98)
        at ch.qos.logback.core.util.Loader$1.run(Loader.java:51)
        at ch.qos.logback.core.util.Loader$1.run(Loader.java:48)
        at java.security.AccessController.doPrivileged(AccessController.java:202)
        at ch.qos.logback.core.util.Loader.<clinit>(Loader.java:47)
        at java.lang.J9VMInternals.initializeImpl(Native Method)
        at java.lang.J9VMInternals.initialize(J9VMInternals.java:200)
        at ch.qos.logback.classic.util.ContextInitializer.findURLOfDefaultConfigurationFile(ContextInitializer.java:117)
        at ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:146)
        at org.slf4j.impl.StaticLoggerBinder.init(StaticLoggerBinder.java:84)
        at org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:54)
        at java.lang.J9VMInternals.initializeImpl(Native Method)
        at java.lang.J9VMInternals.initialize(J9VMInternals.java:200)
        at org.slf4j.LoggerFactory.bind(LoggerFactory.java:128)
        at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:108)
        at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:279)
        at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:252)
        at net.grinder.engine.process.WorkerProcessEntryPoint.run(WorkerProcessEntryPoint.java:73)
        ... 1 more
Caused by: java.lang.NullPointerException
        at java.net.InetAddress.getAddressFromNameService(InetAddress.java:1318)
        at java.net.InetAddress.getAllByName0(InetAddress.java:1268)
        at java.net.InetAddress.getAllByName(InetAddress.java:1197)
        at java.net.InetAddress.getAllByName(InetAddress.java:1119)
        at java.net.InetAddress.getByName(InetAddress.java:1069)
        at org.xbill.DNS.SimpleResolver.<init>(SimpleResolver.java:56)
        at org.xbill.DNS.SimpleResolver.<init>(SimpleResolver.java:68)
        at org.xbill.DNS.ExtendedResolver.<init>(ExtendedResolver.java:266)
        at org.xbill.DNS.Lookup.refreshDefault(Lookup.java:86)
        at org.xbill.DNS.Lookup.<clinit>(Lookup.java:97)
        at java.lang.J9VMInternals.initializeImpl(Native Method)
        at java.lang.J9VMInternals.initialize(J9VMInternals.java:200)
        ... 55 more
2014-02-17 10:46:47,016 INFO  agent daemon: All workers are finished
2014-02-17 10:46:47,019 INFO  agent daemon: communication shut down

本机操作系统为AIX,虚地址为192.168.1.6,实地址为192.168.1.26
hosts文件如下:
127.0.0.1       loopback localhost
192.168.1.26    test-TSC2
Reply | Threaded
Open this post in threaded view
|

Re: ngrinder3.3对hosts内主机名配置要求?

junoyoon
Administrator
This post was updated on .
We haven't tested it with AIX.

I googled the error. The reason seems like that underlying DNSJava library searches the DNS sever in the /etc/resolv.conf and.. AIX doesn't have it.

Please see what you have in the /etc/resolv.conf and add the following configuration in your  /etc/resolv.conf

search com
nameserver your_dns_servrer_IP
Reply | Threaded
Open this post in threaded view
|

Re: ngrinder3.3对hosts内主机名配置要求?

junoyoon
Administrator
This post was updated on .
The another way to configure this is that

1. open ${NGRINDER_AGENT_HOME}/agent.conf file
2. put the following line.

agent.java_opt=-Ddns.server=your_dns_ip -Ddns.search=com

3. restart the agent.
Reply | Threaded
Open this post in threaded view
|

Re: ngrinder3.3对hosts内主机名配置要求?

ypspace
添加agent.java_opt=dns.server=192.168.1.101 dns.search=com
启动不成功,报错:
2014-02-17 14:24:26,830 INFO  agent daemon: worker agent-06-0 started
Exception in thread "main" java.lang.NoClassDefFoundError: dns.server=192.168.1.101
Caused by: java.lang.ClassNotFoundException: dns.server=192.168.1.101
        at java.net.URLClassLoader.findClass(URLClassLoader.java:434)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:660)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:358)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:626)
Could not find the main class: dns.server=192.168.1.101.  Program will exit.
2014-02-17 14:24:27,159 INFO  agent daemon: All workers are finished
2014-02-17 14:24:27,163 INFO  agent daemon: communication shut down
Reply | Threaded
Open this post in threaded view
|

Re: ngrinder3.3对hosts内主机名配置要求?

ypspace
In reply to this post by junoyoon
由于测试在内网中进行,脚本使用实际IP地址,不需要DNS解析,如何在启动时不使用DNS模式,如何设置?
Reply | Threaded
Open this post in threaded view
|

Re: ngrinder3.3对hosts内主机名配置要求?

junoyoon
Administrator
Sorry. It should be

agent.java_opt=-Ddns.server=your_dns_ip -Ddns.search=com

I omited "-D".
Reply | Threaded
Open this post in threaded view
|

Re: ngrinder3.3对hosts内主机名配置要求?

Kingo
Why can't set the hosts in /etc/hosts?
Reply | Threaded
Open this post in threaded view
|

Re: ngrinder3.3对hosts内主机名配置要求?

Mavlarn
Because it is not convenient to set all hosts files manually on all agents.