0

두 개의 Play! 프레임 워크 2.1.0 응용 프로그램 : front-endcms. 다른 포트에서 실행될 예정입니다. 프로젝트는 많은 코드를 공유하고 동일한 자격 증명을 사용하여 동일한 데이터베이스에 연결합니다.Play Framework 2 여러 프로덕션 인스턴스

두 프로젝트를 play dist으로 패키지했습니다. PID 파일을 만들고 예상대로 실행되는 하나의 좋은 (front-end/start -Dhttp.port=1234 &) 시작할 수 있습니다.

그러나 다른 프로젝트 (back-end/start -Dhttp.port=5678 &)를 실행하자마자 프로젝트가 시작되지만 첫 번째 프로젝트가 종료됩니다.

두 프로젝트가 서로 독립적 일 때 잘 작동하며 시작하는 순서에 차이가없는 것처럼 보입니다.

application secret이 변경되었습니다.

첫 번째 프로세스는 브라우저에서 액세스하려고 시도 할 때 (두 번째 프로세스가 작동하는지 확인한 후) 죽지 만 PID 파일은 절대로 삭제되지 않습니다.

편집 :

./start -Dhttp.port=9000 -Dlogger.root=DEBUG -Dlogger.play=DEBUG -Dlogger.application=DEBUG 
Play server process ID is 12870 
[debug] c.j.b.BoneCPDataSource - JDBC URL = jdbc:mysql://localhost/hp?useUnicode=yes&characterEncoding=UTF-8&connectionCollation=utf8_general_ci, Username = hp, partitions = 1, max (per partition) = 30, min (per partition) = 5, helper threads = 0, idle max age = 10 min, idle test period = 1 min 
[info] play - database [default] connected at jdbc:mysql://localhost/hp?useUnicode=yes&characterEncoding=UTF-8&connectionCollation=utf8_general_ci 
[debug] o.r.Reflections - going to scan these urls: 
jar:file:/var/play-apps/hp-frontend-1.0/lib/hp-frontend_2.10-1.0.jar!/ 
jar:file:/var/play-apps/hp-frontend-1.0/lib/play.play_2.10-2.1.0.jar!/ 

[info] o.r.Reflections - Reflections took 213 ms to scan 2 urls, producing 12 keys and 24 values 
[info] c.a.e.s.c.DefaultServerFactory - DatabasePlatform name:default platform:mysql 
[debug] c.a.e.c.AbstractNamingConvention - Using maxConstraintNameLength of 64 
[debug] c.a.e.s.l.t.ThreadPool - ThreadPool grow created [Ebean-default.0] size[0] 
[debug] c.a.e.a.ClassLoadContext - Context and Caller ClassLoader's same instance of sun.misc.Launcher$AppClassLoader 
[info] c.a.e.s.s.SubClassManager - SubClassFactory parent ClassLoader  [sun.misc.Launcher$AppClassLoader] 
[debug] c.a.e.a.ClassLoadContext - Context and Caller ClassLoader's same instance of sun.misc.Launcher$AppClassLoader 
[debug] c.a.e.s.t.DefaultTypeManager - Registering Joda data types 
[debug] c.a.e.s.d.BeanDescriptorManager - BeanPersistControllers[0] BeanFinders[0] BeanPersistListeners[0] BeanQueryAdapters[0] 
[debug] c.a.e.s.d.p.DeployCreateProperties - Skipping transient field _ebean_identity in play.db.ebean.Model 
[debug] c.a.e.s.d.p.DeployCreateProperties - Skipping transient field _ebean_identity in play.db.ebean.Model 
[debug] c.a.e.s.d.p.DeployCreateProperties - Skipping transient field _ebean_identity in play.db.ebean.Model 
[info] c.a.e.s.d.BeanDescriptorManager - Explicit sequence on models.CmsPage but not supported by DB Platform - ignored 
[info] c.a.e.s.d.BeanDescriptorManager - Explicit sequence on models.Image but not supported by DB Platform - ignored 
[debug] c.a.e.s.d.BeanDescriptor - BeanDescriptor initialise models.CmsPage 
[debug] c.a.e.s.d.BeanDescriptor - BeanDescriptor initialise models.Image 
[debug] c.a.e.s.d.BeanDescriptor - BeanDescriptor initialise models.PagesImages 
[info] c.a.e.s.d.BeanDescriptorManager - Entities enhanced[3] subclassed[0] 
[debug] j.m.mbeanserver - ObjectName = JMImplementation:type=MBeanServerDelegate 
[debug] j.m.mbeanserver - name = JMImplementation:type=MBeanServerDelegate 
[debug] j.m.mbeanserver - Send create notification of object JMImplementation:type=MBeanServerDelegate 
[debug] j.m.mbeanserver - JMX.mbean.registered JMImplementation:type=MBeanServerDelegate 
[debug] j.m.mbeanserver - ObjectName = Ebean:server=default2,function=Logging 
[debug] j.m.mbeanserver - name = Ebean:server=default2,function=Logging 
[debug] j.m.mbeanserver - Send create notification of object Ebean:function=Logging,server=default2 
[debug] j.m.mbeanserver - JMX.mbean.registered Ebean:server=default2,function=Logging 
[debug] j.m.mbeanserver - ObjectName = Ebean:server=default2,key=AutoFetch 
[debug] j.m.mbeanserver - name = Ebean:server=default2,key=AutoFetch 
[debug] j.m.mbeanserver - Send create notification of object Ebean:key=AutoFetch,server=default2 
[debug] j.m.mbeanserver - JMX.mbean.registered Ebean:server=default2,key=AutoFetch 
[debug] c.a.ebean.Ebean - GlobalProperties.isSkipPrimaryServer() 
[debug] n.s.e.c.ConfigurationFactory - Configuring ehcache from ehcache.xml found in the classpath: jar:file:/var/play-apps/hp-frontend-1.0/lib/play.play_2.10-2.1.0.jar!/ehcache.xml 
[debug] n.s.e.c.ConfigurationFactory - Configuring ehcache from URL: jar:file:/var/play-apps/hp-frontend-1.0/lib/play.play_2.10-2.1.0.jar!/ehcache.xml 
[debug] n.s.e.c.ConfigurationFactory - Configuring ehcache from InputStream 
[debug] n.s.e.c.BeanHandler - Ignoring ehcache attribute xmlns:xsi 
[debug] n.s.e.c.BeanHandler - Ignoring ehcache attribute xsi:noNamespaceSchemaLocation 
[debug] n.s.e.CacheManager - Creating new CacheManager with default config 
[debug] n.s.e.u.PropertyUtil - propertiesString is null. 
[debug] n.s.e.c.ConfigurationHelper - No CacheManagerEventListenerFactory class specified. Skipping... 
[debug] n.s.e.Cache - No BootstrapCacheLoaderFactory class specified. Skipping... 
[debug] n.s.e.Cache - CacheWriter factory not configured. Skipping... 
[debug] n.s.e.c.ConfigurationHelper - No CacheExceptionHandlerFactory class specified. Skipping... 
[debug] n.s.e.s.MemoryStore - Initialized net.sf.ehcache.store.NotifyingMemoryStore for play 
[debug] n.s.e.Cache - Initialised cache: play 
[debug] n.s.e.c.ConfigurationHelper - CacheDecoratorFactory not configured for defaultCache. Skipping for 'play'. 
[info] play - Application started (Prod) 
[info] play - Listening for HTTP on /0:0:0:0:0:0:0:0:9000 
---> Browsed to :9000 here. Waited a minute, then this appeared: 
Killed 

그리고 두 번째 프로세스 :

./start -Dhttp.port=9010 -Dlogger.play=DEBUG 
Play server process ID is 12758 
[info] play - database [default] connected at jdbc:mysql://localhost/hp? useUnicode=yes&characterEncoding=UTF-8&connectionCollation=utf8_general_ci 
[info] play - Application started (Prod) 
[info] play - Listening for HTTP on /0:0:0:0:0:0:0:0:9010 
->Here, I browsed to :9010 and after 30 secs it started working 
^C 

이 (디버그 출력이 정확히였다을 아래에 제안, 나는 두 단말기 모두에서 응용 프로그램을 실행 이 무슨 일이 있었는지입니다 같은, 그래서 그것을 여기에 ommitted)

나는 결과를 약간 사소한 변화와 함께 여러 번 시도 : 첫 번째 애플 리케이션을 기다리고 때 '듣고 fo r HTTP '를 실행하면 2 차 서버가 실행되지 않습니다. 2 차 서버에는 데이터베이스가 연결되지 않습니다.

+0

두 개의 재생 프로젝트를 만들고 서로 시작한 후에 오류를 재현 할 수 없습니다. 로그에 무엇이 있습니까? – Schleichardt

답변

0

문제가 이상합니다. 한 번에 두 앱을 모두 실행할 수 있어야하며 아무런 문제가 없어야합니다. 다른 포트에서 다른 앱을 실행하거나 (심지어 많은 경우에 동일한 앱을 실행하는 경우) 상당히 일반적인 시나리오이며 설명 된 동작의 원인을 상상할 수 없습니다.

파일이 삭제되지 않은 상태로 유지된다는 사실은 일부 비정상적인 프로그램 종료가 발생했기 때문에 일부 요소가 다른 가상 컴퓨터와 일부 리소스를 공유 할 수 없다는 것을 나타냅니다.

아마도 로그 및 또는 터미널에서 찾을 수 있습니다. & 문자없이 응용 프로그램을 시작하십시오. 그러면 터미널에 직접 로그가 보관됩니다. 첫 번째 응용 프로그램이 종료 된 후 내용을 확인하십시오.

+0

나는 당신의 제안을 따르고 나의 질문에 응답을 추가했다. –

관련 문제