2014-04-17 4 views
0

Spring, Hibernate, Hazelcast 통합 응용 프로그램을 만들었습니다.Hazelcast 관리 센터 구성

봄 구성 파일은 다음과 같다 : - SpringDispatcher-context.xml에

 <?xml version="1.0" encoding="UTF-8"?> 
     <!-- <beans xmlns="http://www.springframework.org/schema/beans" 
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
      xmlns:mvc="http://www.springframework.org/schema/mvc" 
      xmlns:hz="http://www.hazelcast.com/schema/spring" 
      xmlns:context="http://www.springframework.org/schema/context" 
      xsi:schemaLocation=" 
       http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd 
       http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd 
       http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd 
       http://www.hazelcast.com/schema/spring 
       http://www.hazelcast.com/schema/spring/hazelcast-spring-3.0.xsd"> 
     --> 


     <beans xmlns="http://www.springframework.org/schema/beans" 
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
     xmlns:context="http://www.springframework.org/schema/context" 
     xmlns:mvc="http://www.springframework.org/schema/mvc" 
     xmlns:hz="http://www.hazelcast.com/schema/spring" 
     xsi:schemaLocation="http://www.springframework.org/schema/beans 
     http://www.springframework.org/schema/beans/spring-beans-3.0.xsd 
     http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd 
     http://www.springframework.org/schema/context 
     http://www.springframework.org/schema/context/spring-context-3.0.xsd 
     http://www.hazelcast.com/schema/spring 
     http://www.hazelcast.com/schema/spring/hazelcast-spring-3.2.xsd"> 





     <hz:hazelcast id="hazelastInstance"> 


      <hz:config> 


       <hz:group name="dev" password="password" /> 
       <hz:network port="5701" port-auto-increment="false"> 
        <hz:join> 
         <hz:multicast enabled="false" multicast-group="225.225.225.0" 
          multicast-port="54327" /> 

         <hz:tcp-ip enabled="true"> 
          <hz:members>192.168.0.101, 192.168.0.104</hz:members> 
         </hz:tcp-ip> 
        </hz:join> 
       </hz:network> 
       <!-- <hz:map name="map" backup-count="2" max-size="0" 
        eviction-percentage="30" read-backup-data="true" cache-value="true" 
        eviction-policy="NONE" merge-policy="com.hazelcast.map.merge.PassThroughMergePolicy" /> --> 
      </hz:config> 
      </hz:hazelcast> 




     <!-- <bean id="sessionFactory" 
       class="org.springframework.orm.hibernate4.LocalSessionFactoryBean"> 
       <property name="configLocation"> 
        <value>classpath:hibernate.cfg.xml</value> 
       </property> 
       <property name="configurationClass"> 
        <value>org.hibernate.cfg.Configuration</value> 
       </property> 
      </bean> --> 


     <bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean"> 
     <property name="dataSource" ref="dataSource"></property> 
     <property name="packagesToScan" value="com.last.forms"></property> 
     <property name="hibernateProperties"> 
      <props> 
       <prop key="dialect">org.hibernate.dialect.MySQL5Dialect</prop> 
       <prop key="hibernate.hbm2ddl.auto">update</prop> 
       <prop key="show_sql">false</prop> 
       <prop key="connection.pool_size">1</prop> 
      </props> 
     </property>  


     <property name="configLocation"> 
        <value>classpath:hibernate.cfg.xml</value> 
       </property> 
     </bean> 


     <bean id="dataSource" 
      class="org.springframework.jdbc.datasource.DriverManagerDataSource"> 
       <property name="driverClassName" value="com.mysql.jdbc.Driver" /> 
       <property name="url" value="jdbc:mysql://localhost/mock_data" /> 
       <property name="username" value="root" /> 
       <property name="password" value="root" /> 
      </bean> 


      <context:component-scan base-package="com.last.controllers" /> 
     <mvc:annotation-driven /> 




      <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"> 
       <property name="prefix" value="/WEB-INF/jsp/" /> 
       <property name="suffix" value=".jsp" /> 
      </bean> 

     </beans> 

다양한 Hazelcast 튜토리얼 Hazelcast.xml에 다음 코드 줄을 복사 나 한테 물어.

<management-center enabled="true">http://localhost:8080/mancenter-3.2-RC2</management-center> 

하지만 마침내 Hazelcast 패키지의 bin 폴더에서 찾은 Hazelcast.xml은 사용하지 않습니다.

대신 에클립스에서 lib 폴더에 Hazelcast jars를 복사했습니다.

Mancenter Management Center를 실행하기 위해 내 작업 공간에서 수행해야 할 구성은 무엇입니까?

+0

내 mancenter-3.2-RC2.war이 서버에 배포되어 있습니다. –

+0

또한 을 클릭하거나 동적으로 웹 URL을 할당하려면 여기를 클릭하여 (권장하지 않음) men.center의 hazelcast 인스턴스에 연결하려고 시도했습니다. –

답변

2

Mancenter Management Center는 독립형 웹 응용 프로그램과 같습니다. WAR를 웹 응용 프로그램 서버에 배포하면 실행할 수 있습니다. 작동 여부를 확인하려면 브라우저에서 실행 해보십시오. 그것이 완료되면, 당신에게 그것에 연결하는 hazelcast를 설정합니다. 이는 hazelcast.xml에서 수행됩니다.

<management-center enabled="true">http://localhost:8080/mancenter-3.2-RC2</management-center> 

hazelcast.xml은 응용 프로그램 클래스 경로에 있어야합니다. 그렇지 않으면 기본 hazelcast.xml이 사용됩니다.

또한 mancenter 버전과 hazelcast 버전이 일치하는지 확인하십시오.

+0

감사합니다. cricsync. 나는 네임 스페이스의 개념을 몰랐다 : 그것은 문제였다. 나는 를 사용했고 완벽하게 작동했습니다. –