then i find these errors in the startInjector.sh and startNode.sh :
java $PROFILING_OPTS -Xmx1G -Xms1G -verbose:gc -Xloggc:gc-injector-$host.log -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -cp `cat classpath.txt` org.apache.s4.core.Main "@$INJECTOR_CONFIG" &
java -Xmx4G -Xms4G -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -Xloggc:gc-$host.log $PROFILING_OPTS -server -cp `cat classpath.txt` org.apache.s4.core.Main "@$NODE_CONFIG" &

how can i write the Main class, and let this benchmark to run ?



2013/5/27 baojian Zhou <baojian.zhou.buaa@gmail.com>
thank you Shrivastava and Morel, it dose resolve the issue by adding -clean opt. but when i run the benchmark-cluster.sh and then i got the following errors in the creating directory  2013-05-27--22-17-10  file  s4err_1.err and s4err_2.err:
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/s4/core/Main
Caused by: java.lang.ClassNotFoundException: org.apache.s4.core.Main
        at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
Could not find the main class: org.apache.s4.core.Main. Program will exit.

i know that java cannot find the Main class, but in the s4-src we have not this class, how can this happened?
thank you


2013/5/27 Lokesh Shrivastava <lokesh.shrivastava@gmail.com>
I think script is not cleaning up your z4 cluster old configuration. If you run the cluster by giving clean option, it should resolve the issue.


On 27 May 2013 19:18, baojian Zhou <baojian.zhou.buaa@gmail.com> wrote:
i start test the s4 benchmark application, and then run the ./bench-cluster.sh command then i got this error :

 21:23:18.570 [main] INFO  org.apache.s4.tools.ZKServer - Zookeeper server started on port [2181]
21:23:18.618 [main] INFO  org.apache.s4.tools.ZKServer - Defined S4 cluster [testCluster1] with [0] tasks with first listening port [12000]
21:23:18.706 [main] ERROR org.apache.s4.tools.ZKServer - Cannot initialize zookeeper with specified configuration
org.I0Itec.zkclient.exception.ZkNodeExistsException: org.apache.zookeeper.KeeperException$NodeExistsException: KeeperErrorCode = NodeExists for /s4/clusters/testCluster2/tasks/Task-0
        at org.I0Itec.zkclient.exception.ZkException.create(ZkException.java:55) ~[zkclient-0.1.jar:na]
        at org.I0Itec.zkclient.ZkClient.retryUntilConnected(ZkClient.java:685) ~[zkclient-0.1.jar:na]
        at org.I0Itec.zkclient.ZkClient.create(ZkClient.java:304) ~[zkclient-0.1.jar:na]
        at org.I0Itec.zkclient.ZkClient.createPersistent(ZkClient.java:243) ~[zkclient-0.1.jar:na]
        at org.apache.s4.comm.tools.TaskSetup.setup(TaskSetup.java:69) ~[s4-comm-0.6.0-incubating.jar:0.6.0-incubating]
        at org.apache.s4.tools.ZKServer.main(ZKServer.java:94) ~[s4-tools-0.6.0-incubating.jar:0.6.0-incubating]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.6.0_20]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[na:1.6.0_20]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.6.0_20]
        at java.lang.reflect.Method.invoke(Method.java:616) ~[na:1.6.0_20]
        at org.apache.s4.tools.Tools$Task.dispatch(Tools.java:57) [s4-tools-0.6.0-incubating.jar:0.6.0-incubating]
        at org.apache.s4.tools.Tools.main(Tools.java:97) [s4-tools-0.6.0-incubating.jar:0.6.0-incubating]
Caused by: org.apache.zookeeper.KeeperException$NodeExistsException: KeeperErrorCode = NodeExists for /s4/clusters/testCluster2/tasks/Task-0
        at org.apache.zookeeper.KeeperException.create(KeeperException.java:110) ~[zookeeper-3.3.3.jar:3.3.3-1073969]
        at org.apache.zookeeper.KeeperException.create(KeeperException.java:42) ~[zookeeper-3.3.3.jar:3.3.3-1073969]
        at org.apache.zookeeper.ZooKeeper.create(ZooKeeper.java:637) ~[zookeeper-3.3.3.jar:3.3.3-1073969]
        at org.I0Itec.zkclient.ZkConnection.create(ZkConnection.java:87) ~[zkclient-0.1.jar:na]
        at org.I0Itec.zkclient.ZkClient$1.call(ZkClient.java:308) ~[zkclient-0.1.jar:na]
        at org.I0Itec.zkclient.ZkClient$1.call(ZkClient.java:304) ~[zkclient-0.1.jar:na]
        at org.I0Itec.zkclient.ZkClient.retryUntilConnected(ZkClient.java:675) ~[zkclient-0.1.jar:na]
        ... 10 common frames omitted

can anyone tell me why?