Liberty: JMX 라우팅 환경 설정의 예

Liberty를 사용하여 집합체 제어기 서버를 통해 집합체 멤버 서버에서 JMX(Java™ Management Extensions) 관리 Bean(MBean)을 호출할 수 있습니다.

분산 플랫폼용IBM i 플랫폼용참고: collectiveController-1.0 기능 및 해당되는 능력은 z/OS®용 WebSphere® Application Server Liberty 및 WebSphere Application Server Liberty Network Deployment에서만 사용 가능합니다. 기능은 WebSphere Application Server Liberty 또는 WebSphere Application Server Liberty Core에서 사용할 수 없습니다. WebSphere Application Server Liberty Network Deployment가 설치되어 있는 경우, collectiveController-1.0 기능을 사용하여 WebSphere Application Server Liberty, WebSphere Application Server Liberty - Express® 또는 WebSphere Application Server Liberty Core 설치에서 집합체 멤버에 대해 작업할 수 있습니다.

collectiveMember-1.0 기능은 서버가 집합체 제어기(collectiveController-1.0 기능)에 의해 관리될 수 있도록 합니다. 서버가 집합체 제어기에 의해 관리되도록 구성된 후, 집합체 제어기 서버를 통해 집합체 멤버에 대해 MBean을 직접 호출할 수 있습니다.

다음은 집합체 제어기 서버를 통해 MBeans를 집합체 멤버로 호출하는 방법의 예입니다.

// Set up the trust store to the collective controller server.

    System.setProperty("javax.net.ssl.trustStore", "<trustStore for https connection to collective controller>");
    System.setProperty("javax.net.ssl.trustStorePassword", "<trustStore password>");

    Map<String, Object> environment = new HashMap<String, Object>();
    environment.put("jmx.remote.protocol.provider.pkgs", "com.ibm.ws.jmx.connector.client");
    environment.put(JMXConnector.CREDENTIALS, new String[] { "<username>", "<password>" });
    environment.put(ClientProvider.DISABLE_HOSTNAME_VERIFICATION, true);
    environment.put(ClientProvider.READ_TIMEOUT, 2 * 60 * 1000);

    JMXServiceURL url = new JMXServiceURL(
        "REST", "<hostname of collective controller server>", <https port>, "/IBMJMXConnectorREST");
    jmxConnector = JMXConnectorFactory.connect(url, environment);
    MBeanServerConnection exmbsc = jmxConnector.getMBeanServerConnection();

// You have a MBeanServerConnection now; at this point, however, all of your MBean calls 
// are on the collective controller server.

// The next few lines of code are to set up the routing context so that all calls 
// can be routed to a collective member.

   ObjectName rmObjectName = new ObjectName(
       "WebSphere:feature=collectiveController,type=RoutingContext,name=RoutingContext");

// Call the MBeanRoutingContext MBean to set up the routing context.

    Object rcObj = connection.invoke(rmObjectName, "assignServerContext",
    new Object[] { 
        "<hostname of the collective member>", "<collective member server usr dir>", "<collective member server name>"
    },  

// With the collective-member server usr dir and collective-member server name, 
// the managed server can be uniquely identified on a host.

    new String[] { "java.lang.String", "java.lang.String", "java.lang.String" });

    if (rcObj instanceof Boolean) {
        Boolean result = (Boolean) rcObj;
    if (result.booleanValue()) {
       System.out.println("routing context is configured correctly");
       }
    Or if (!result.booleanValue()) {
       System.out.println("routing context result is false");
       }
    } else {
        System.out.println("failed to configure routing context");
    }
라우팅 컨텍스트가 올바르게 구성된 경우 이 MBeanServerConnection에 대한 모든 나중 호출은 집합체 멤버 서버를 대상으로 지정하기 위해 라우팅됩니다.

주제의 유형을 표시하는 아이콘 참조 주제



시간소인 아이콘 마지막 업데이트 날짜: Tuesday, 6 December 2016
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=cord&product=was-nd-mp&topic=rwlp_jmx_routing
파일 이름: rwlp_jmx_routing.html