2013-07-19 4 views
1

Tomcat 서버가있는 일부 Linux 상자의 AWS EC2에서 내 응용 프로그램을 사용하려고합니다. 이전에는 LAN상의 Infinispan으로 애플리케이션을 사용했고 JGroups 회원 검색에 UDP 멀티 캐스팅을 사용했습니다. EC2는 UDP 멀티 캐스팅을 지원하지 않으며 이는 Infinispan에서 클러스터에서 실행중인 노드를 감지하는 데 사용되는 기본 노드 검색 방법입니다. S3_PING 프로토콜을 사용하여 보았지만 왜 작동하지 않는지 알지 못했습니다.EC2에서 Infinispan 및 JGroups 검색

여기에 어떤 문제가 있을지 몰라? 1. ApplicationContext를-cache.xml

<!-- Infinispan cache --> 
<cache:annotation-driven/> 

<import resource="classpath:/applicationContext-dao.xml"/> 


<bean id="cacheManager" class="org.infinispan.spring.provider.SpringEmbeddedCacheManagerFactoryBean"> 
    <property name="configurationFileLocation" value="classpath:/infinispan-replication.xml"/> 
</bean> 

<context:component-scan base-package="com.alex.cache"/> 

2.infinispan-replication.xml

<infinispan xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
     xsi:schemaLocation="urn:infinispan:config:5.1 http://www.infinispan.org/schemas/infinispan-config-5.1.xsd" 
     xmlns="urn:infinispan:config:5.1"> 

<global> 
    <transport transportClass="org.infinispan.remoting.transport.jgroups.JGroupsTransport"> 
     <properties> 
      <property name="configurationFile" value="/home/akasiyanik/dev/projects/myapp/myapp-configs/jgroups.xml"/> 
     </properties> 
    </transport> 
</global> 

<default> 
    <!-- Configure a synchronous replication cache --> 
    <clustering mode="replication"> 
     <sync/> 
     <hash numOwners="2"/> 
    </clustering> 
</default> 
</infinispan> 

3. jgroups.xml

: 여기

내 구성 파일입니다
<config> 
    <TCP bind_port="${jgroups.tcp.port:7800}" 
     loopback="true" 
     port_range="30" 
     recv_buf_size="20000000" 
     send_buf_size="640000" 
     discard_incompatible_packets="true" 
     max_bundle_size="64000" 
     max_bundle_timeout="30"   
     enable_bundling="true" 
     use_send_queues="true" 
     sock_conn_timeout="300" 
     enable_diagnostics="false" 
     thread_pool.enabled="true" 
     thread_pool.min_threads="2" 
     thread_pool.max_threads="30" 
     thread_pool.keep_alive_time="60000" 
     thread_pool.queue_enabled="false" 
     thread_pool.queue_max_size="100" 
     thread_pool.rejection_policy="Discard" 

     oob_thread_pool.enabled="true" 
     oob_thread_pool.min_threads="2" 
     oob_thread_pool.max_threads="30" 
     oob_thread_pool.keep_alive_time="60000" 
     oob_thread_pool.queue_enabled="false" 
     oob_thread_pool.queue_max_size="100" 
     oob_thread_pool.rejection_policy="Discard" 
    /> 
    <S3_PING location="r********s" access_key="AK***************SIA" 
     secret_access_key="y*************************************BJ" timeout="2000" num_initial_members="2"/> 
    <MERGE2 max_interval="30000" 
     min_interval="10000"/> 
    <FD_SOCK/> 
    <FD timeout="3000" max_tries="3"/> 
    <VERIFY_SUSPECT timeout="1500"/> 
    <BARRIER /> 
    <pbcast.NAKACK use_mcast_xmit="false" 
       exponential_backoff="500" 
       discard_delivered_msgs="true"/> 
    <UNICAST /> 
    <pbcast.STABLE stability_delay="1000" desired_avg_gossip="50000" 
       max_bytes="4M"/> 
    <pbcast.GMS print_local_addr="true" join_timeout="3000" 
      view_bundling="true"/> 
    <UFC max_credits="2M" 
    min_threshold="0.4"/> 
    <MFC max_credits="2M" 
    min_threshold="0.4"/> 
    <FRAG2 frag_size="60K" /> 
    <pbcast.STATE_TRANSFER/> 
</config> 
+0

하드 AWS의 API (멀티 캐스트 교체)를 사용하여 AWS ...에 대한 위해 JGroups 검색 프로토콜의 구현, org.jgroups 패키지에서 TRACE 로깅을 활성화하고 무슨 일이 일어나는지 보겠습니다. Config는 언뜻 보면 괜찮아 보입니다 ... –

+0

@ GalderZamarreño 감사합니다. 하지만 내가해야 할 일은 IPv6 대신에 IPv4를 사용하는 것뿐입니다. 이를 위해 지정된 JVM 인수를 사용하여 IPv4를 선호했습니다. -Djava.net.preferIPv4Stack = true -Djava.net.preferIPv4Addresses = true. – dzivak

+0

그럼, 그때 일한거야? –

답변