Examples?

207 views
Skip to first unread message

kissaprofeetta

unread,
Jul 19, 2013, 4:40:56 AM7/19/13
to weave...@googlegroups.com
I don't know if I am not looking hard enough, but I fail finding any examples, besides the code snippets on the front page. It would be nice if you could provide a complete example of a Weave application.

Terence Yim

unread,
Jul 19, 2013, 1:55:15 PM7/19/13
to weave...@googlegroups.com
That's a very good suggestion. We'll work on improving the doc to includes more complete example. Meanwhile, you can checkout the source from github and you can find the complete EchoServer example under test in the weave-yarn module.

kissaprofeetta

unread,
Jul 22, 2013, 4:49:45 AM7/22/13
to weave...@googlegroups.com
Thanks Terence.
I have tried running both EchoServerTest and DistributedShellTest with CDH4.3, but they both fail. The full log is below. The only thing I can think is that it runs out virtual memory and kills the container at 2013-07-22 11:30:24,417. Am I on the right track here? If so, how can the virtual memory limit be raised?


Cheers,
Roman


2013-07-22 11:29:39,934 - INFO  [ STARTING:c.c.w.i.z.InMemoryZKServer$1@44] - In memory ZK started: lh2-csb-09:53484
2013-07-22 11:29:40,319 - WARN  [main:o.a.h.u.NativeCodeLoader@62] - Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
2013-07-22 11:29:51,168 - INFO  [Thread-5:o.m.l.Slf4jLog@67] - Logging to Logger[org.mortbay.log] via org.mortbay.log.Slf4jLog
2013-07-22 11:29:51,230 - INFO  [Thread-5:o.m.l.Slf4jLog@67] - jetty-6.1.26
2013-07-22 11:29:51,257 - INFO  [Thread-5:o.m.l.Slf4jLog@67] - Extract jar:file:/home/roman/.m2/repository/org/apache/hadoop/hadoop-yarn-common/2.0.5-alpha/hadoop-yarn-common-2.0.5-alpha.jar!/webapps/cluster to /home/roman/weave/yarn/target/Jetty_0_0_0_0_8088_cluster____u0rgz3/webapp
2013-07-22 11:29:51,509 - INFO  [Thread-5:o.m.l.Slf4jLog@67] - Started SelectChann...@0.0.0.0:8088
2013-07-22 11:29:51,852 - WARN  [Thread-5:o.a.h.m.i.MetricsConfig@124] - Cannot locate configuration: tried hadoop-metrics2-resourcemanager.properties,hadoop-metrics2.properties
2013-07-22 11:30:12,294 - INFO  [Thread-188:o.m.l.Slf4jLog@67] - jetty-6.1.26
2013-07-22 11:30:12,303 - INFO  [Thread-188:o.m.l.Slf4jLog@67] - Extract jar:file:/home/roman/.m2/repository/org/apache/hadoop/hadoop-yarn-common/2.0.5-alpha/hadoop-yarn-common-2.0.5-alpha.jar!/webapps/node to /home/roman/weave/yarn/target/Jetty_lh2.csb.09_ltdk_helsinki_fi_47111_node____v6axh7/webapp
Jul 22, 2013 11:30:12 AM com.sun.jersey.guice.spi.container.GuiceComponentProviderFactory register
INFO: Registering org.apache.hadoop.yarn.server.resourcemanager.webapp.JAXBContextResolver as a provider class
Jul 22, 2013 11:30:12 AM com.sun.jersey.guice.spi.container.GuiceComponentProviderFactory register
INFO: Registering org.apache.hadoop.yarn.server.resourcemanager.webapp.RMWebServices as a root resource class
Jul 22, 2013 11:30:12 AM com.sun.jersey.guice.spi.container.GuiceComponentProviderFactory register
INFO: Registering org.apache.hadoop.yarn.webapp.GenericExceptionHandler as a provider class
Jul 22, 2013 11:30:12 AM com.sun.jersey.server.impl.application.WebApplicationImpl _initiate
INFO: Initiating Jersey application, version 'Jersey: 1.8 06/24/2011 12:17 PM'
Jul 22, 2013 11:30:12 AM com.sun.jersey.guice.spi.container.GuiceComponentProviderFactory getComponentProvider
INFO: Binding org.apache.hadoop.yarn.server.resourcemanager.webapp.JAXBContextResolver to GuiceManagedComponentProvider with the scope "Singleton"
Jul 22, 2013 11:30:12 AM com.sun.jersey.guice.spi.container.GuiceComponentProviderFactory getComponentProvider
INFO: Binding org.apache.hadoop.yarn.webapp.GenericExceptionHandler to GuiceManagedComponentProvider with the scope "Singleton"
Jul 22, 2013 11:30:13 AM com.sun.jersey.guice.spi.container.GuiceComponentProviderFactory getComponentProvider
INFO: Binding org.apache.hadoop.yarn.server.resourcemanager.webapp.RMWebServices to GuiceManagedComponentProvider with the scope "Singleton"
2013-07-22 11:30:13,311 - INFO  [Thread-188:o.m.l.Slf4jLog@67] - Started SelectChannelConnector@lh2-csb-09:47111
Jul 22, 2013 11:30:13 AM com.google.inject.servlet.GuiceFilter setPipeline
WARNING: Multiple Servlet injectors detected. This is a warning indicating that you have more than one GuiceFilter running in your web application. If this is deliberate, you may safely ignore this message. If this is NOT deliberate however, your application may not work as expected.
2013-07-22 11:30:13,538 - INFO  [YarnWeaveRunnerService STARTING-EventThread:c.c.w.i.z.DefaultZKClientService$ServiceDelegate@393] - Connected to ZooKeeper: lh2-csb-09:53484/weave
2013-07-22 11:30:19,176 - INFO  [weave-log-poller:c.c.w.i.ZKWeaveController$2@130] - Weave log poller thread started.
2013-07-22 11:30:19,190 - INFO  [zk-client-EventThread:c.c.w.i.k.c.KafkaBrokerCache$ExistsOnFailureFutureCallback@281] - Path /brokers/ids not exists. Watch for creation.
2013-07-22 11:30:19,196 - INFO  [zk-client-EventThread:c.c.w.i.k.c.KafkaBrokerCache$ExistsOnFailureFutureCallback@281] - Path /brokers/topics not exists. Watch for creation.
2013-07-22 11:30:24,415 - WARN  [Container Monitor:o.a.h.y.s.n.c.m.ContainersMonitorImpl@289] - Process tree for container: container_1374481780572_0001_01_000001 has processes older than 1 iteration running over the configured limit. Limit=2254857728, current usage = 3495809024
2013-07-22 11:30:24,417 - WARN  [Container Monitor:o.a.h.y.s.n.c.m.ContainersMonitorImpl$MonitoringThread@435] - Container [pid=2204,containerID=container_1374481780572_0001_01_000001] is running beyond virtual memory limits. Current usage: 123.9 MB of 1 GB physical memory used; 3.3 GB of 2.1 GB virtual memory used. Killing container.
Dump of the process-tree for container_1374481780572_0001_01_000001 :
|- PID PPID PGRPID SESSID CMD_NAME USER_MODE_TIME(MILLIS) SYSTEM_TIME(MILLIS) VMEM_USAGE(BYTES) RSSMEM_USAGE(PAGES) FULL_CMD_LINE
|- 2215 2204 2204 2204 (java) 440 17 3478896640 31423 java -cp launcher.jar: -Xmx1024m com.continuuity.weave.launcher.WeaveLauncher appMaster.jar com.continuuity.weave.internal.appmaster.ApplicationMasterMain false 
|- 2204 1685 2204 2204 (bash) 0 0 16912384 301 /bin/bash -c java -cp launcher.jar: -Xmx1024m com.continuuity.weave.launcher.WeaveLauncher appMaster.jar com.continuuity.weave.internal.appmaster.ApplicationMasterMain false  1>/home/roman/weave/target/test-cluster/test-cluster-logDir-nm-0_0/application_1374481780572_0001/container_1374481780572_0001_01_000001/stdout  2>/home/roman/weave/target/test-cluster/test-cluster-logDir-nm-0_0/application_1374481780572_0001/container_1374481780572_0001_01_000001/stderr  

2013-07-22 11:30:24,427 - WARN  [ContainersLauncher #0:o.a.h.y.s.n.DefaultContainerExecutor@193] - Exit code from task is : 143
2013-07-22 11:30:24,914 - WARN  [NIOServerCxn.Factory:lh2-csb-09/128.214.186.55:0:o.a.z.s.NIOServerCnxn@349] - caught end of stream exception
org.apache.zookeeper.server.ServerCnxn$EndOfStreamException: Unable to read additional data from client sessionid 0x140057f8ca60001, likely client has closed socket
at org.apache.zookeeper.server.NIOServerCnxn.doIO(NIOServerCnxn.java:220) ~[zookeeper-3.4.5.jar:3.4.5-1392090]
at org.apache.zookeeper.server.NIOServerCnxnFactory.run(NIOServerCnxnFactory.java:208) [zookeeper-3.4.5.jar:3.4.5-1392090]
at java.lang.Thread.run(Thread.java:722) [na:1.7.0_17]
2013-07-22 11:30:24,917 - WARN  [NIOServerCxn.Factory:lh2-csb-09/128.214.186.55:0:o.a.z.s.NIOServerCnxn@354] - Exception causing close of session 0x140057f8ca60003 due to java.io.IOException: Connection reset by peer
2013-07-22 11:30:24,918 - WARN  [NIOServerCxn.Factory:lh2-csb-09/128.214.186.55:0:o.a.z.s.NIOServerCnxn@354] - Exception causing close of session 0x140057f8ca60002 due to java.io.IOException: Connection reset by peer
2013-07-22 11:30:25,396 - WARN  [AsyncDispatcher event handler:o.a.h.y.s.r.RMAuditLogger@255] - USER=roman OPERATION=Application Finished - Failed TARGET=RMAppManager RESULT=FAILURE DESCRIPTION=App failed with state: FAILED PERMISSIONS=Application application_1374481780572_0001 failed 1 times due to AM Container for appattempt_1374481780572_0001_000001 exited with  exitCode: 143 due to: Container [pid=2204,containerID=container_1374481780572_0001_01_000001] is running beyond virtual memory limits. Current usage: 123.9 MB of 1 GB physical memory used; 3.3 GB of 2.1 GB virtual memory used. Killing container.
Dump of the process-tree for container_1374481780572_0001_01_000001 :
|- PID PPID PGRPID SESSID CMD_NAME USER_MODE_TIME(MILLIS) SYSTEM_TIME(MILLIS) VMEM_USAGE(BYTES) RSSMEM_USAGE(PAGES) FULL_CMD_LINE
|- 2215 2204 2204 2204 (java) 440 17 3478896640 31423 java -cp launcher.jar: -Xmx1024m com.continuuity.weave.launcher.WeaveLauncher appMaster.jar com.continuuity.weave.internal.appmaster.ApplicationMasterMain false 
|- 2204 1685 2204 2204 (bash) 0 0 16912384 301 /bin/bash -c java -cp launcher.jar: -Xmx1024m com.continuuity.weave.launcher.WeaveLauncher appMaster.jar com.continuuity.weave.internal.appmaster.ApplicationMasterMain false  1>/home/roman/weave/target/test-cluster/test-cluster-logDir-nm-0_0/application_1374481780572_0001/container_1374481780572_0001_01_000001/stdout  2>/home/roman/weave/target/test-cluster/test-cluster-logDir-nm-0_0/application_1374481780572_0001/container_1374481780572_0001_01_000001/stderr  


.Failing this attempt.. Failing the application. APPID=application_1374481780572_0001
2013-07-22 11:30:25,398 - WARN  [IPC Server handler 2 on 44922:o.a.h.y.s.n.c.ContainerManagerImpl@497] - Trying to stop unknown container container_1374481780572_0001_01_000001
2013-07-22 11:30:25,403 - WARN  [IPC Server handler 2 on 44922:o.a.h.y.s.n.NMAuditLogger@150] - USER=UnknownUser IP=128.214.186.55 OPERATION=Stop Container Request TARGET=ContainerManagerImpl RESULT=FAILURE DESCRIPTION=Trying to stop unknown container! APPID=application_1374481780572_0001 CONTAINERID=container_1374481780572_0001_01_000001
2013-07-22 11:30:26,391 - WARN  [ContainersLauncher #1:o.a.h.y.s.n.DefaultContainerExecutor@193] - Exit code from task is : 143
2013-07-22 11:30:26,652 - WARN  [NIOServerCxn.Factory:lh2-csb-09/128.214.186.55:0:o.a.z.s.NIOServerCnxn@349] - caught end of stream exception
org.apache.zookeeper.server.ServerCnxn$EndOfStreamException: Unable to read additional data from client sessionid 0x140057f8ca60005, likely client has closed socket
at org.apache.zookeeper.server.NIOServerCnxn.doIO(NIOServerCnxn.java:220) ~[zookeeper-3.4.5.jar:3.4.5-1392090]
at org.apache.zookeeper.server.NIOServerCnxnFactory.run(NIOServerCnxnFactory.java:208) [zookeeper-3.4.5.jar:3.4.5-1392090]
at java.lang.Thread.run(Thread.java:722) [na:1.7.0_17]
2013-07-22 11:31:22,436 - INFO  [main:o.m.l.Slf4jLog@67] - Stopped SelectChannelConnector@lh2-csb-09:0
2013-07-22 11:31:32,546 - WARN  [Container Monitor:o.a.h.y.s.n.c.m.ContainersMonitorImpl$MonitoringThread@463] - org.apache.hadoop.yarn.server.nodemanager.containermanager.monitor.ContainersMonitorImpl is interrupted. Exiting.
2013-07-22 11:31:32,555 - INFO  [main:o.m.l.Slf4jLog@67] - Stopped SelectChann...@0.0.0.0:8088
2013-07-22 11:31:32,661 - ERROR [Thread[Thread-11,5,main]:o.a.h.s.t.d.AbstractDelegationTokenSecretManager$ExpiredTokenRemover@430] - InterruptedExcpetion recieved for ExpiredTokenRemover thread java.lang.InterruptedException: sleep interrupted
2013-07-22 11:31:32,669 - WARN  [ApplicationMaster Launcher:o.a.h.y.s.r.a.ApplicationMasterLauncher$LauncherThread@97] - org.apache.hadoop.yarn.server.resourcemanager.amlauncher.ApplicationMasterLauncher$LauncherThread interrupted. Returning.
2013-07-22 11:31:32,680 - ERROR [ResourceManager Event Processor:o.a.h.y.s.r.ResourceManager$SchedulerEventDispatcher$EventProcessor@370] - Returning, interrupted : java.lang.InterruptedException

java.lang.AssertionError
at org.junit.Assert.fail(Assert.java:86)
at org.junit.Assert.assertTrue(Assert.java:41)
at org.junit.Assert.assertTrue(Assert.java:52)
at com.continuuity.weave.yarn.EchoServerTest.testEchoServer(EchoServerTest.java:78)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:77)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:195)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)


Process finished with exit code 255

Terence Yim

unread,
Jul 23, 2013, 3:09:36 AM7/23/13
to weave...@googlegroups.com
It's likely you are hitting this bug https://issues.apache.org/jira/browse/YARN-168, which got fixed in later yarn version. In the meantime, you can try setting "yarn.nodemanager.vmem-pmem-ratio" to high ratio (e.g. 4 in your case) to see if that'll work.

Terence
Reply all
Reply to author
Forward
0 new messages