IBM WebSphere Liberty概要文件通过使用监视功能来提供性能指标,该监视功能符合Java®Management Extension(JMX)标准。 本教程系列说明如何通过使用REST连接器API连接到Liberty服务器或Liberty集合控制器来使用Jython脚本检索这些指标。 在这一部分中,您将通过安装和配置Liberty配置文件,集合控制器和集合成员来设置环境。 您还将看到如何在本地模式下使用Liberty Feature Repository。

搭建环境

对于本教程,您可以在Red Hat EnterpriseLinux®6服务器上下载,安装和配置以下组件:

  • WebSphere Liberty Web Profile 8.5.5.8 :

    • 一台服务器作为带有管理控制台的集合控制器
    • 一台服务器作为集体成员
    • 两台启用了性能数据的服务器
    • 脱机功能存储库,用于安装collectiveController和adminCenter功能
  • Java 8.0 (Java运行时环境(JRE)或软件开发套件(SDK))
  • Jython独立版2.7.0

下载文件

变量和语法:在本教程中,WebSphere Liberty概要文件安装目录是用变量$ WLP_DIR定义的。 变量$ JAVA_DIR用于Java安装目录。 另外,您必须使用以下语法启动每个命令:

  • $对于UNIX
  • >>>对于Jython口译员

通过使用前面的链接,将以下文件下载到/ tmp目录:

  • wlp-webProfile7-8.5.5.8.zip
  • wlp-featureRepo-8.5.5.8.zip
  • ibm-java-sdk-8.0-1.10-i386-archive.bin(或ibm-java-jre-8.0-1.10-i386-archive.bin)
  • jython-standalone-2.7.0.jar

安装软件

设置环境,然后安装Java,Liberty配置文件,Liberty存储库和Jython:

  1. 设置环境:

    1. 创建一个脚本来设置环境:

      $ mkdir <path_where_wlp_will_be>
      $ cd <path_where_wlp_will_be>
      $ vi wlp_setup_env.sh

      清单1显示了脚本文件的内容。

      清单1. wlp_setup_env.sh脚本
      #!/bin/sh
      export WLP_DIR=<path_where_wlp_will_be>
      export JAVA_DIR=<path_where_java_will_be>
      export PATH=$JAVA_DIR/bin:$PATH
      export JAVA_HOME=$JAVA_DIR
    2. 找到源文件以设置环境变量:
      $ . ./wlp_setup_env.sh
  2. 安装Java:
    $ cd /tmp
    $ chmod +x ibm-java-sdk-8.0-1.10-i386-archive.bin
    $ ./ibm-java-sdk-8.0-1.10-i386-archive.bin -i console
    <...follow the instructions to install Java 8 in $JAVA_DIR directory...>
  3. 安装WebSphere Liberty概要文件:
    $ cd $WLP_DIR
    $ unzip /tmp/wlp-webProfile7-8.5.5.8.zip
  4. 安装WebSphere Liberty功能库:
    $ mkdir $WLP_DIR/wlp/feature_repository
    $ cd $WLP_DIR/wlp/feature_repository
    $ unzip /tmp/wlp-featureRepo-8.5.5.8.zip

    通过添加WebSphere Liberty功能库,您不需要Internet连接即可配置Liberty服务器。

  5. 安装Jython,以便您可以编写脚本:
    $ mkdir $WLP_DIR/wlp/jython
    $ cd $WLP_DIR/wlp/jython
    $ cp /tmp/jython-standalone-2.7.0.jar .

创建和配置Liberty服务器

在创建的两个Liberty服务器中,一个是控制器服务器 (称为controller )。 控制器服务器将具有集合控制器功能。 另一个服务器称为server1 ,它将在本部分的后面成为集合成员。

要创建和配置Liberty服务器:

  1. 转到Liberty概要文件目录:

    $ cd $WLP_DIR/wlp/bin
  2. 创建服务器:
    $ ./server create server1

    显示确认消息:

    Server server1 created.
  3. 创建控制器。
    $ ./server create controller

    显示确认消息:

    Server controller created.
  4. 将控制器服务器定义为集合控制器,将<controller_hostname>替换为<controller_hostname>的主机名:
    $ ./collective create controller --keystorePassword=wlpadmin --hostName=<controller_hostname>

    在此命令中:

    • --hostName选项生成具有描述性主机名的安全套接字层(SSL)证书。 如果不使用此选项,则该命令可能使用可能导致错误的主机名。
    • --createConfigFile选项生成一个配置为附加到server.xml文件的文件。

    清单2显示了该命令的输出,其中包含一个模板,您将在server.xml文件中包含该模板(如清单4所示)。

    清单2.用于创建集合控制器的输出
    Creating required certificates to establish a collective...
    This may take a while.
    Successfully generated the controller root certificate.
    Successfully generated the member root certificate.
    Successfully generated the server identity certificate.
    Successfully generated the HTTPS certificate.Successfully set up collective controller configuration for controllerAdd the following lines to the server.xml to enable:<featureManager><feature>collectiveController-1.0</feature></featureManager><!-- Define the host name for use by the collective.If the host name needs to be changed, the server should beremoved from the collective and re-joined or re-replicated. --><variable name="defaultHostName" value="<controller_hostname>" /><!-- TODO: Set the security configuration for Administrative access --><quickStartSecurity userName="" userPassword="" /><!-- clientAuthenticationSupported set to enable bidirectional trust --><ssl id="defaultSSLConfig"keyStoreRef="defaultKeyStore"trustStoreRef="defaultTrustStore"clientAuthenticationSupported="true" /><!-- inbound (HTTPS) keystore --><keyStore id="defaultKeyStore" password="{xor}KDMvPjsyNjE="location="${server.config.dir}/resources/security/key.jks" /><!-- inbound (HTTPS) truststore --><keyStore id="defaultTrustStore" password="{xor}KDMvPjsyNjE="location="${server.config.dir}/resources/security/trust.jks" /><!-- server identity keystore --><keyStore id="serverIdentity" password="{xor}KDMvPjsyNjE="location="${server.config.dir}/resources/collective/serverIdentity.jks" /><!-- collective trust keystore --><keyStore id="collectiveTrust" password="{xor}KDMvPjsyNjE="location="${server.config.dir}/resources/collective/collectiveTrust.jks" /><!-- collective root signers keystore --><keyStore id="collectiveRootKeys" password="{xor}KDMvPjsyNjE="location="${server.config.dir}/resources/collective/rootKeys.jks" />Please ensure administrative security is configured for the server.An administrative user is required to join members to the collective.
  5. 可选:检查是否已创建信任库和密钥文件:
    $ ls -l  $WLP_DIR/wlp/usr/servers/controller/resources/security/

    如清单3所示,创建了信任库文件(trust.jks)和密钥文件(key.jks)。

    清单3.信任库和密钥文件
    total 8
    -rw-r----- 1 usr grp 3139 Oct  9 10:17 key.jks
    -rw-r----- 1 usr grp 1932 Oct  9 10:17 trust.jks
  6. 更新控制器的server.xml文件(请参见清单4):
    $ vi $WLP_DIR/wlp/usr/servers/controller/server.xml

    在server.xml文件中,对于<controller_hostname>变量,使用<controller_hostname>的主机名。 另外,在此文件中,请注意以下详细信息:

    • <accessLogging/>变量创建$ WLP_DIR / wlp / usr / servers / controller / logs / http_access.log文件。
    • 服务器URL是http:// <defaultHostName><httpPort> /。
    • collectiveController-1.0功能创建$ WLP_DIR / wlp / usr / servers / controller / resources / collective /目录。
    清单4.控制器server.xml文件
    <?xml version="1.0" encoding="UTF-8"?><server description="controller"><featureManager><feature>webProfile-7.0</feature><feature>collectiveController-1.0</feature></featureManager><httpEndpoint id="defaultHttpEndpoint" httpPort="9080" httpsPort="9443"><accessLogging/></httpEndpoint><variable name="defaultHostName" value="<controller_hostname>" /><quickStartSecurity userName="wlpadmin" userPassword="wlpadmin" /><ssl id="defaultSSLConfig" keyStoreRef="defaultKeyStore"trustStoreRef="defaultTrustStore" clientAuthenticationSupported="true" /><!-- inbound (HTTPS) keystore --><keyStore id="defaultKeyStore" password="{xor}KDMvPjsyNjE="location="${server.config.dir}/resources/security/key.jks" /><!-- inbound (HTTPS) truststore --><keyStore id="defaultTrustStore" password="{xor}KDMvPjsyNjE="location="${server.config.dir}/resources/security/trust.jks" /><!-- server identity keystore --><keyStore id="serverIdentity" password="{xor}KDMvPjsyNjE="location="${server.config.dir}/resources/collective/serverIdentity.jks" /><!-- collective trust keystore --><keyStore id="collectiveTrust" password="{xor}KDMvPjsyNjE="location="${server.config.dir}/resources/collective/collectiveTrust.jks" /><!-- collective root signers keystore --><keyStore id="collectiveRootKeys" password="{xor}KDMvPjsyNjE="location="${server.config.dir}/resources/collective/rootKeys.jks" /></server>
  7. 检查集合目录:
    $ ls -l $WLP_DIR/wlp/usr/servers/controller/resources/collective/

    清单5显示了集合目录的内容。

    清单5.集合目录的内容
    total 20
    -rw-r----- 1 usr grp 1932 Oct  9 10:17 collectiveTrust.jks
    -rw-r----- 1 usr grp 36 Oct  9 10:17 collective.uuid
    -rw-r----- 1 usr grp 4510 Oct  9 10:17 rootKeys.jks
    -rw-r----- 1 usr grp 3259 Oct  9 10:17 serverIdentity.jks

错误消息CWWKF0001E :不要立即尝试启动控制器。 如果这样做,您会看到以下错误消息:
[ERROR] CWWKF0001E: A feature definition could not be found for collectivecontroller-1.0

接下来,您需要将集合控制器功能添加到安装中。

为本地存储库配置installUtility命令

默认情况下,installUtility命令尝试连接到Internet上的功能部件存储库。 配置命令以使用本地存储库:

  1. 获取默认的installUtility设置:

    $ cd $WLP_DIR/wlp/bin
    $ ./installUtility viewSettings

    清单6显示了默认设置。

    清单6. installUtility命令的默认设置
    No user configuration detected. The IBM WebSphere Liberty Repository is
    the default assets repository.To customize installUtility settings, create a repositories.properties
    file at the following location:
    $WLP_DIR/wlp/etc/repositories.propertiesUse the following sample as a template to create your own
    repositories.properties file. Uncomment the lines marked by a single #
    character, and replace the values with your own customized values.
    ----------------------------------------------------------------------
    ######################################################################
    ## ## Using the online IBM WebSphere Liberty Repository ##
    ## Set the useDefaultRepository property to false to prevent
    ## installUtility from accessing the internet to connect to the
    ## IBM WebSphere Liberty Repository repository. By default, access
    ## is enabled.
    ## -------------------------------------------------------------------
    #useDefaultRepository=false######################################################################
    ## ## Using custom repositories ##
    ## installUtility can install assets from directory-based repositories
    ## and hosted instances of the Liberty Asset Repository Service.
    ## Provide a repository name and either the directory path or URL to
    ## each custom repository containing Liberty assets.
    ## The repositories are accessed in the order that they are specified.## Specify the name and file path or URL
    ## to directory-based repositories.
    ## -------------------------------------------------------------------
    #localRepositoryName1.url=/usr/LibertyRepository1
    #localRepositoryName2.url=file:/usr/LibertyRepository2## Specify the name and URL to hosted repositories.
    ## -------------------------------------------------------------------
    #hostedRepositoryName1.url=http://w3.mycompany.com/repository
    #hostedRepositoryName2.url=https://w3.mycompany.com/secure/repository## Specify the credentials of each repository, if required.
    ## For enhanced security, encode the value of the .password
    ## property by using the securityUtility encode action.
    ## If you do not set the user and password, you receive a prompt
    ## to provide them.
    ## -------------------------------------------------------------------
    #hostedRepositoryName2.user=username
    #hostedRepositoryName2.password=myPassword######################################################################
    ## ## Using a proxy server (optional) ##
    ## If you use a proxy server to access the internet,
    ## specify values for the proxy settings properties.
    ## For enhanced security, encode the value of the proxyPassword
    ## property by using the securityUtility encode action.
    ## If you do not set the proxyUser and proxyPassword, you receive
    ## a prompt to provide them.
    ## -------------------------------------------------------------------
    #proxyHost=hostName
    #proxyPort=3128
    #proxyUser=proxyUsername
    #proxyPassword=myProxyPassword
  2. 要指定本地存储库,请创建$ WLP_DIR / wlp / etc / repositories.properties文件:
    $ mkdir $WLP_DIR/wlp/etc
    $ vi $WLP_DIR/wlp/etc/repositories.properties

    清单7显示了此文件的内容,其中<value of $WLP_DIR>是您的$ WLP_DIR目录的值。

    清单7.repositories.properties文件的内容
    useDefaultRepository=false
    local_features_repository.url=<value of $WLP_DIR>/wlp/feature_repository
  3. 使用installUtility命令安装collectiveController-1.0功能:
    $ ./installUtility find collectiveController

    清单8显示了installUtility命令的输出。

    清单8. find CollectorController特性
    Establishing a connection to the configured repositories...
    This process might take several minutes to complete.Successfully connected to all configured repositories.Searching assets. This process might take several minutes to complete.feature : collectiveController-1.0 : Collective Controller
  4. 验证安装中不存在collectiveController-1.0功能:
    1. 验证collectiveController-1.0功能不在collectionController目录中:

      $ ls -l $WLP_DIR/wlp/lib/features/*collective*

      如清单9所示, collectiveController-1.0功能不在collectionController目录中。

      清单9.collectionController目录中没有collectionController功能
      -rw-r--r-- 1 usr grp 2094 Aug 27 06:23 com.ibm.websphere.appserver.collectiveMember-1.0.mf
    2. 验证collectiveController-1.0功能不在collectionController文件中:
      $ ls -l $WLP_DIR/wlp/lib/*collective*

      如清单10所示,该功能不在collectionController文件中。

      清单10.collectionController文件中没有collectionController功能
      -rw-r--r-- 1 usr grp 60621 Aug 27 06:23 com.ibm.websphere.collective_1.3.11.jar
      -rw-r--r-- 1 usr grp 8424 Aug 27 06:23 com.ibm.websphere.collective.plugins_1.0.11.jar
      -rw-r--r-- 1 usr grp 22283 Aug 27 06:23 com.ibm.websphere.collective.singleton_1.0.11.jar
      -rw-r--r-- 1 usr grp 255072 Aug 27 06:23 com.ibm.ws.collective.member_1.1.11.jar
      -rw-r--r-- 1 usr grp 76661 Aug 27 06:23 com.ibm.ws.collective.repository.client_1.1.11.jar
      -rw-r--r-- 1 usr grp 73563 Aug 27 06:23 com.ibm.ws.collective.routing.member_1.0.11.jar
      -rw-r--r-- 1 usr grp 109041 Aug 27 06:23 com.ibm.ws.collective.singleton_1.0.11.jar
      -rw-r--r-- 1 usr grp 328398 Aug 27 06:23 com.ibm.ws.collective.utility_1.0.11.jar
  5. 使用installUtility命令安装collectiveController-1.0功能:
    $ ./installUtility install collectiveController-1.0

    清单11显示了此命令的输出。

    清单11.collectionController功能安装的输出
    Establishing a connection to the configured repositories...
    This process might take several minutes to complete.Successfully connected to all configured repositories.Preparing assets for installation. This process might take several minutes to complete.Additional Features Terms & Conditions:
    By clicking on the "I agree" button , you agree that the program code,
    samples, updates, fixes and related licensed materials such as keys and
    documentation ("Code") that you are about to download are subject to
    the terms of the license agreement that you accepted when you acquired
    the Program for which you are obtaining the Code. You further agree
    that you will install or use the Code solely as part of a Program for
    which you have a valid agreement or Proof of Entitlement. The terms
    "Program" and "Proof of Entitlement" have the same meaning as in the
    IBM International Program License Agreement ("IPLA"). The IPLA is
    available for reference at http://www.ibm.com/software/sla/Select [1] I Agree, or [2] I do not Agree:  1Step 1 of 7: Downloading servlet-3.0...
    Step 2 of 7: Downloading jaxrs-1.1...
    Step 3 of 7: Downloading collectiveController-1.0...
    Step 4 of 7: Installing servlet-3.0...
    Step 5 of 7: Installing jaxrs-1.1...
    Step 6 of 7: Installing collectiveController-1.0...
    Step 7 of 7: Cleaning up temporary files...All assets were successfully installed.Start product validation...
    Product validation completed successfully.
  6. 验证安装中是否包含collectiveController-1.0功能:
    $ cd $WLP_DIR/wlp/lib
    $ ls -C1 features/*collective*

    现在出现了CollectorController目录,如清单12所示。

    清单12.目录中的collectionController功能
    features/collectiveController-1.0.mf
    features/collective.rest.notify-1.0.mf
    features/com.ibm.websphere.appserver.collectiveMember-1.0.mf
  7. 验证安装中是否存在collectiveController-1.0文件:
    $ ls -C1 *collective*

    现在出现了CollectorController目录,如清单13所示。

    清单13.文件中的collectionController功能
    com.ibm.websphere.collective_1.3.11.jar
    com.ibm.websphere.collective.plugins_1.0.11.jar
    com.ibm.websphere.collective.singleton_1.0.11.jar
    com.ibm.ws.collective.controller_1.0.11.jar
    com.ibm.ws.collective.defaultPostTransferAction_1.0.11.jar
    com.ibm.ws.collective.defaultPreTransferAction_1.0.11.jar
    com.ibm.ws.collective.member_1.1.11.jar
    com.ibm.ws.collective.plugins_1.0.11.jar
    com.ibm.ws.collective.repository_1.0.11.jar
    com.ibm.ws.collective.repository.client_1.1.11.jar
    com.ibm.ws.collective.rest_1.0.11.jar
    com.ibm.ws.collective.rest.notify_1.0.11.jar
    com.ibm.ws.collective.routing.controller_1.0.11.jar
    com.ibm.ws.collective.routing.member_1.0.11.jar
    com.ibm.ws.collective.security_1.0.11.jar
    com.ibm.ws.collective.singleton_1.0.11.jar
    com.ibm.ws.collective.utility_1.0.11.jar
  8. 安装adminCenter功能:
    $ cd $WLP_DIR/wlp/bin$ ./installUtility find adminCenter
    …
    $ ./installUtility install adminCenter-1.0
    …

现在,您已经建立了Liberty概要文件本地存储库,并向安装中添加了collectiveController和adminCenter功能。

配置集体控制器

要完成服务器的配置,您需要启用以下功能:

  • webProfile (默认)
  • collectiveController
  • adminCenter
  • monitor (已安装的功能)

更新控制器的server.xml文件:

$ vi $WLP_DIR/wlp/usr/servers/controller/server.xml

清单14显示了控制器的server.xml文件的内容。 在此文件中,将<controller_hostname>变量替换为<controller_hostname>的主机名。

清单14.控制器的server.xml文件的内容
<?xml version="1.0" encoding="UTF-8"?><server description="new server"><featureManager><feature>webProfile-7.0</feature><feature>collectiveController-1.0</feature><feature>adminCenter-1.0</feature><feature>monitor-1.0</feature></featureManager><httpEndpoint id="defaultHttpEndpoint" httpPort="9080" httpsPort="9443"><accessLogging/></httpEndpoint><variable name="defaultHostName" value="<controller_hostname>" /><quickStartSecurity userName="wlpadmin" userPassword="wlpadmin" /><ssl id="defaultSSLConfig" keyStoreRef="defaultKeyStore"trustStoreRef="defaultTrustStore" clientAuthenticationSupported="true" /><!-- inbound (HTTPS) keystore --><keyStore id="defaultKeyStore" password="{xor}KDMvPjsyNjE="location="${server.config.dir}/resources/security/key.jks" /><!-- inbound (HTTPS) truststore --><keyStore id="defaultTrustStore" password="{xor}KDMvPjsyNjE="location="${server.config.dir}/resources/security/trust.jks" /><!-- server identity keystore --><keyStore id="serverIdentity" password="{xor}KDMvPjsyNjE="location="${server.config.dir}/resources/collective/serverIdentity.jks" /><!-- collective trust keystore --><keyStore id="collectiveTrust" password="{xor}KDMvPjsyNjE="location="${server.config.dir}/resources/collective/collectiveTrust.jks" /><!-- collective root signers keystore --><keyStore id="collectiveRootKeys" password="{xor}KDMvPjsyNjE="location="${server.config.dir}/resources/collective/rootKeys.jks" /></server>

启动集体控制器

要启动Liberty配置文件,您可以运行它或启动它。 在本教程中,您将使用运行选项。

要启动命令,请至少打开三个终端以达到以下目的:

  • 运行控制器。
  • 运行server1。
  • 启动UNIX®命令,例如psjython命令。

然后,运行集合控制器:

$ cd $WLP_DIR/wlp/bin
$ ./server run controller

如清单15所示,默认情况下会加载RESTconnector功能。

清单15.运行集合控制器的输出
Launching controller (WebSphere Application Server 8.5.5.7/wlp-1.0.10.cl50720150827-0437)on IBM J9 VM, version pxi3280sr1fp10-20150711_01 (SR1 FP10) (en_US)
[AUDIT   ] CWWKE0001I: The server controller has been launched.
[AUDIT   ] CWWKE0100I: This product is licensed for development, and limited productionuse. The full license terms can be viewed here:
https://public.dhe.ibm.com/ibmdl/.../8.5.5.7/lafiles/en.html
[AUDIT   ] CWWKZ0058I: Monitoring dropins for applications.
[AUDIT   ] CWWKT0016I: Web application available (default_host): http://<controller_hostname>:9080/IBMJMXConnectorREST/
[AUDIT   ] CWWKT0016I: Web application available (default_host): http://<controller_hosntname>:9080/ibm/api/collective/notify/
[AUDIT   ] CWWKF0012I: The server installed the following features: [jsp-2.3, ejbLite-
3.2, managedBeans-1.0, servlet-3.1, jsf-2.2, beanValidation-1.1, ssl-1.0, jndi-1.0,appSecurity-2.0, jsonp-1.0, jdbc-4.1, jaxrs-2.0, restConnector-1.0, el-3.0,
jaxrsClient-2.0, collectiveMember-1.0, collectiveController-1.0, json-1.0, cdi-1.2,distributedMap-1.0, webProfile-7.0, websocket-1.1, jpa-2.1].
[AUDIT   ] CWWKF0011I: The server controller is ready to run a smarter planet.
[AUDIT   ] CWWKT0016I: Web application available (default_host): http://<controller_h ostname>:9080/ibm/api/$ ps -ef|grep controller
usr   19785     1 69 09:35 pts/1    00:00:11 $JAVA_DIR/jre/bin/java -javaagent:$WLP_DIR/wlp/bin/tools/ws-javaagent.jar -Djava.awt.headless=true
-jar $WLP_DIR/wlp/bin/tools/ws-server.jar controller

配置集体成员

要配置集体成员,请将server1声明为集体成员,并更新server1的server.xml文件:

  1. 将server1添加为集体成员。 对于<server1_hostname>变量,使用server1的主机名。 对于<controller_hostname>变量,使用<controller_hostname>的主机名。

    $ ./collective join server1 --hostname=<server1_hostname> --host=<controller_hostname> --port=9443 --user=wlpadmin --password=wlpadmin --keystorePassword=wlpadmin

    --hostName选项有助于collective命令在注册到控制器时使用有效的主机名。 此命令生成SSL密钥,作为到集体控制器的远程JMX连接以使用SSL(清单16)。

    清单16.添加为集体成员输出的server1
    Joining the collective with target controller <controller_hostname>:9443...
    This may take a while.SSL trust has not been established with the target server.Certificate chain information:
    Certificate [0]
    Subject DN: CN=<collective_hostname>, OU=controller, O=ibm, C=us
    Issuer DN: OU=controllerRoot, O=64c5ffc2-06dd-43e6-8d2e-f00507f15541, DC=com.ibm.ws.collective
    Serial Number: 2,162,184,658,260,201
    Expires: 10/11/20 4:16 PM
    SHA-1 digest: AF:15:4D:42:19:53:33:01:5C:7F:F2:90:FB:00:70:BC:24:94:72:E5
    MD5 digest: B2:69:1C:7E:E0:DB:46:98:12:A9:0A:A9:C1:61:D2:9BCertificate [1]
    Subject DN: OU=controllerRoot, O=64c5ffc2-06dd-43e6-8d2e-f00507f15541, DC=com.ibm.ws.collective
    Issuer DN: OU=controllerRoot, O=64c5ffc2-06dd-43e6-8d2e-f00507f15541, DC=com.ibm.ws.collective
    Serial Number: 2,162,178,883,849,178
    Expires: 10/6/40 4:15 PM
    SHA-1 digest: 18:57:80:1A:2F:E3:FA:7B:0D:8B:24:3F:DF:CC:4D:68:35:EA:7B:94
    MD5 digest: 1F:06:E3:61:FC:AA:00:B4:6E:2E:D5:06:EA:07:73:FEDo you want to accept the above certificate chain? (y/n) y
    Successfully completed MBean request to the controller.Successfully joined the collective for server server1Add the following lines to the server.xml to enable:<featureManager><feature>collectiveMember-1.0</feature></featureManager><!-- Define the host name for use by the collective.If the host name needs to be changed, the server should beremoved from the collective and re-joined or re-replicated. --><variable name="defaultHostName" value="<server1_hostname>" /><!-- Connection to the collective controller --><collectiveMember controllerHost="<controller_hostname>"controllerPort="9443" /><!-- clientAuthenticationSupported set to enable bidirectional trust --><ssl id="defaultSSLConfig"keyStoreRef="defaultKeyStore"trustStoreRef="defaultTrustStore"clientAuthenticationSupported="true" /><!-- inbound (HTTPS) keystore --><keyStore id="defaultKeyStore" password="{xor}KDMvPjsyNjE="location="${server.config.dir}/resources/security/key.jks" /><!-- inbound (HTTPS) truststore --><keyStore id="defaultTrustStore" password="{xor}KDMvPjsyNjE="location="${server.config.dir}/resources/security/trust.jks" /><!-- server identity keystore --><keyStore id="serverIdentity" password="{xor}KDMvPjsyNjE="location="${server.config.dir}/resources/collective/serverIdentity.jks" /><!-- collective truststore --><keyStore id="collectiveTrust" password="{xor}KDMvPjsyNjE="location="${server.config.dir}/resources/collective/collectiveTrust.jks" />
  2. 检查目录是否存在:
    $ ls -l $WLP_DIR/wlp/usr/servers/server1/resources/

    清单17显示了在添加成员之后创建目录。

    清单17.创建的目录
    drwxr-x--- 2 usr grp 4096 Oct 14 10:01 collective
    drwxr-x--- 3 usr grp 4096 Oct 14 10:01 security
  3. 检查文件是否存在:
    $ ls -l $WLP_DIR/wlp/usr/servers/server1/resources/collective/

    清单18显示了添加成员后创建的文件。

    清单18.创建的文件
    -rw-r----- 1 usr grp 1932 Oct 14 10:01 collectiveTrust.jks
    -rw-r----- 1 usr grp 3258 Oct 14 10:01 serverIdentity.jks
  4. 启用以下功能:
    • webProfile (默认)
    • collectiveMember (已安装的功能)
    • monitor (已安装的功能)

    要启用这些功能,请更新server1的server.xml文件:

    $ vi $WLP_DIR/wlp/usr/servers/server1/server.xml

    清单19显示了server1的server.xml文件。 在此文件中, consoleLogLevel设置为INFO以显示正在连接到集合控制器的集合成员。 用您的环境的主机名更新<server1_hostname><controller_hostname>变量。

    清单19. server1的server.xml文件
    <?xml version="1.0" encoding="UTF-8"?>
    <server description="new server"><featureManager><feature>webProfile-7.0</feature><feature>collectiveMember-1.0</feature><feature>monitor-1.0</feature></featureManager><httpEndpoint id="defaultHttpEndpoint" httpPort="9081" httpsPort="9444" /><logging consoleLogLevel="info"/><quickStartSecurity userName="wlpadmin" userPassword="wlpadmin" /><variable name="defaultHostName" value="<server1_hostname>" /><!-- Connection to the collective controller --><collectiveMember controllerHost="<controller_hostname>" controllerPort="9443" /><!-- clientAuthenticationSupported set to enable bidirectional trust --><ssl id="defaultSSLConfig" keyStoreRef="defaultKeyStore"trustStoreRef="defaultTrustStore" clientAuthenticationSupported="true" /><!-- inbound (HTTPS) keystore --><keyStore id="defaultKeyStore" password="{xor}KDMvPjsyNjE="location="${server.config.dir}/resources/security/key.jks" /><!-- inbound (HTTPS) truststore --><keyStore id="defaultTrustStore" password="{xor}KDMvPjsyNjE="location="${server.config.dir}/resources/security/trust.jks" /><!-- server identity keystore --><keyStore id="serverIdentity" password="{xor}KDMvPjsyNjE="location="${server.config.dir}/resources/collective/serverIdentity.jks" /><!-- collective truststore --><keyStore id="collectiveTrust" password="{xor}KDMvPjsyNjE="location="${server.config.dir}/resources/collective/collectiveTrust.jks" /></server>

发起集体成员

运行server1成员:

$ ./server run server1

清单20显示了此命令的输出。 RESTconnector功能默认情况下已加载。

清单20.运行server1成员
Launching server1 (WebSphere Application Server 8.5.5.7/wlp-1.0.10.cl50720150827-0437)
on IBM J9 VM, version pxi3280sr1fp10-20150711_01 (SR1 FP10) (en_US)
[AUDIT   ] CWWKE0001I: The server server1 has been launched.
[AUDIT   ] CWWKE0100I: This product is licensed for development, and limited productionuse. The full license terms can be viewed here: https://public.dhe.ibm.com/ibmdl/.../8.5.5.7/lafiles/en.html
[INFO    ] CWWKE0002I: The kernel started after 1.281 seconds
[INFO    ] CWWKF0007I: Feature update started.
[INFO    ] CWWKS0007I: The security service is starting...
[AUDIT   ] CWWKZ0058I: Monitoring dropins for applications.
[INFO    ] CWWKO0219I: TCP Channel defaultHttpEndpoint has been started and is nowlistening for requests on host <server1_hostname>  (IPv4: <hosntname>) port 9081.
[INFO    ] CWWKO0219I: TCP Channel defaultHttpEndpoint-ssl has been started and is nowlistening for requests on host <server1_hostname>  (IPv4: <hostname>) port 9444.
[INFO    ] CWWKS0008I: The security service is ready.
[INFO    ] CWWKS4105I: LTPA configuration is ready after 0.428 seconds.
[INFO    ] DYNA1001I: WebSphere Dynamic Cache instance named baseCache initializedsuccessfully.
[INFO    ] DYNA1071I: The cache provider default is being used.
[INFO    ] DYNA1056I: Dynamic Cache (object cache) initialized successfully.
[INFO    ] Value of retry post was already set: false
[AUDIT   ] CWWKF0012I: The server installed the following features: [jsp-2.3,
ejbLite-3.2, managedBeans-1.0, jsf-2.2, beanValidation-1.1, servlet-3.1, ssl-1.0,
jndi-1.0, jsonp-1.0, appSecurity-2.0, jdbc-4.1, jaxrs-2.0, restConnector-1.0,jaxrsClient-2.0, el-3.0, collectiveMember-1.0, json-1.0, cdi-1.2, distributedMap-1.0,webProfile-7.0, websocket-1.1, jpa-2.1].
[INFO    ] CWWKF0008I: Feature update completed in 2.189 seconds.
[AUDIT   ] CWWKF0011I: The server server1 is ready to run a smarter planet.
[INFO    ] CWWKX8055I: The collective member has established a connection to the collective controller.
[INFO    ] SRVE0169I: Loading Web Module: IBMJMXConnectorREST.
[INFO    ] SRVE0250I: Web Module IBMJMXConnectorREST has been bound to default_host.
[AUDIT   ] CWWKT0016I: Web application available (default_host):http://<server1_hostname>:9081/IBMJMXConnectorREST/
[INFO    ] CWWKX0103I: The JMX REST connector is running and is available at thefollowing service URL: service:jmx:rest://<server1_hostname>:9444/IBMJMXConnectorREST
[INFO    ] CWWKX0103I: The JMX REST connector is running and is available at the
following service URL: service:jmx:rest://<server1_hostname>:9444/IBMJMXConnectorREST
[INFO    ] CWWKX8122I: The default SSH key-based configuration is being used for the host
authentication configuration.
[INFO    ] CWWKX8123I: The remote host authentication for this server has been configured
as <hostname>:22, user name <usr> with ssh-key authentication.
[INFO    ] SESN8501I: The session manager did not find a persistent storage location;
HttpSession objects will be stored in the local application server's memory.
[INFO    ] CWWKX1000I: The SingletonMessenger MBean is available.
[INFO    ] CWWKX8116I: The server STARTED state was successfully published to the
collective repository.
[INFO    ] CWWKX8114I: The server's paths were successfully published to the collective
repository.
[INFO    ] CWWKX8112I: The server's host information was successfully published to the
collective repository.
[INFO    ] CWWKX7912I: The FileServiceMXBean attribute ReadList was successfully updated.
[INFO    ] CWWKX7912I: The FileServiceMXBean attribute WriteList was successfully updated.

--hostName选项的错误CWWKX8133E

如果您没有在collective join命令中使用--hostName选项,则会看到以下错误消息:

[ERROR   ] CWWKX8133E: The host name of the security identity of the server is different from the current host name. Identity host name: <real_hostname>, current host name: <used_hostname>. This discrepancy will cause certain collective operations to fail.

使用集体控制器时,此错误会阻止数据收集。 然后,您可能会看到清单21中所示的错误消息。

清单21. CWWKX8133E错误消息
Traceback (most recent call last):File "<stdin>", line 1, in <module>at com.ibm.ws.jmx.connector.client.rest.internal.RESTMBeanServerConnection.queryMBeans(RESTMBeanServerConnection.java:583)at com.ibm.ws.jmx.connector.client.rest.internal.RESTMBeanServerConnection.queryNames(RESTMBeanServerConnection.java:611)at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:95)at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)at java.lang.reflect.Method.invoke(Method.java:507)java.io.IOException: java.io.IOException: jmx.rest.client.unexpected.server.throwable

解决此错误的方法:

  1. 从server1删除一些资源文件:

    $ rm -rf $WLP_DIR/wlp/usr/servers/server1/resources/collective/
  2. 从集合中删除server1:
    $ ./bin/collective remove server1 --host=<controller_hostname> --port=9444 --user=wlpadmin –password=wlpadmin
  3. 如果需要,请使用CollectiveRepository MBean的delete方法:
    >>> mconnection.invoke( repo_mbean, 'delete', ['/sys.was.collectives/local/hosts/<server1_hostname>'], ['java.lang.String'])

有关使用CollectiveRepository MBean的更多信息,请参见本系列的第2部分 。

在adminCenter中浏览性能数据

您使用adminCenter的图形界面来查看两个Liberty配置文件服务器的性能数据。

要连接并使用adminCenter(图1):

  1. 使用用户wlpadmin输入以下URL(使用端口9080 ):

    http://<controller_hostname>:<port>/adminCenter
  2. 在“工具箱”窗口中,选择“ 浏览”以访问所有服务器。
  3. 选择您的服务器,然后单击“ 监视器”以查看性能数据。
图1. adminCenter中的“浏览”窗口

结论

在本教程中,您学习了如何使用控制器以及使用本地存储库来安装和配置WebSphere Liberty概要文件环境。 在第2部分中 ,您将学习如何使用Jython脚本从服务器或集合控制器及其所有成员收集性能数据。

翻译自: https://www.ibm.com/developerworks/websphere/library/techarticles/1602_guillemenot1-trs/1602_guillemenot1.html

未配置商户号配置怎么设置_设置和配置相关推荐

  1. dw项目符号空心圆怎么设置_项目规范配置之editorconfigamp;prettier

    前言 一个项目从创建到被重构,必定会经手很多人,每个人的代码风格迥异,就算是一个人从头到尾开发同一个项目,也无法保证前后开发的代码风格的相同. 约束,至关重要!不能让代码在不同的机器不同的IDE上出现 ...

  2. springboot2 虚拟路径设置_转载—springboot配置虚拟路径以外部访问

    配置虚拟路径 供外部访问图片 视频等文件 1.配置application.properties ##配置虚拟路径映射 spring.resources.static-locations=classpa ...

  3. 支付宝沙箱设置_设置自己的深度学习沙箱快速指南

    支付宝沙箱设置 Like many data science enthusiasts I dove into this field by filling every spare minute lear ...

  4. matlab命令行窗口显示长度设置_设置命令行窗口输出显示格式 | MATLAB format| MathWork...

    本页对应的中文页面未升级,但未能翻译. 若应查看最新内容,请点击这里访问英文页面. 设置命令行窗口输出显示格式 format 将命令行窗口中的输出显示格式修改为 style 指定的格式. format ...

  5. ad16自动布线设置规则_pcb自动布线设置_设置线间距与宽度设置_pcb布局布线技巧...

    什么是布线 布线意思是元器件间导线连接的布置,先布好线,将导线穿过有电气连接的引脚所在的孔,这样可以在焊接元件的同时,实现元件间的连接. 布线技巧 在制作单片机的实验板时,焊位数码管时1引脚,要分别用 ...

  6. mysql 常见密码设置_设置mysql用户密码(5.6/5.7)、远程连接数据库、常用命令

    注: 以上命令均需要在mysql下执行:在mysql中每行命令末尾加上分号,表示该行命令执行结束. tb_name即table name()表名. 示例: [root@centos-01inux my ...

  7. 大数据之-Hadoop之HDFS_HDFS存储块的大小设置_设置成多少合理_为什么不能设置太小也不能设置太大---大数据之hadoop工作笔记0051

    然后我们再来看这个hadoop中的hdfs的块的大小的设置 我们知道现在hadoop2.x的块的大小默认是128MB,但是是hadoop1.x的时候这个大小是64MB  为什么会有区别呢? 一会再看. ...

  8. 微信商户号 API 密钥、API 证书配置

    一个全新的商户号如何生成 API 密钥.API 证书的操作教程 商户号关联小程序是为了在小程序中能够使用商户号进行微信支付, 关联公众号亦如此 只是使用商户号的支付功能可以不配置 API 证书,因为 ...

  9. mysql服务器端按照显示无权限安装_菜鸟完整配置服务器 流程及权限设置

    本人是一菜鸟,虽然刚刚接触网络,但是有点痴迷.最近因为网络环境允许自己搞台服务器,就选了WIN2003搭建服务器. 原以为网上教程还有落伍者的教程多的是,以为简单的很!哎,谁知道教程虽多,不是缺这个就 ...

最新文章

  1. 集成运算同相放大器和反向放大器的选择
  2. 树莓派的Perl 遨游之旅
  3. 快速排序伪代码_数据结构和算法之快速排序
  4. java设计模式(六)--观察者模式
  5. 蜗牛慢慢爬 LeetCode 6. ZigZag Conversion [Difficulty: Medium]
  6. git学习相关的博客地址
  7. HDU 3065 病毒侵袭持续中(AC自动机 模板)题解
  8. 【iCore4 双核心板_ARM】例程十四:FATFS实验——文件操作
  9. 《Android权威编程指南(The Big Nerd Ranch Guide)(第二版)》12.4挑战练习
  10. 汽车VIN码超详细解析规则
  11. 黑莓C语言编程,经典回顾第一期:黑莓刷机
  12. 如何获取a股level2数据接口?
  13. 半导体智能制造系统之 APS高级计划和调度
  14. python contains 正则_Python 正则表达式
  15. [读书笔记]固定收益证券 第三版 Fixed income securities
  16. 数据学习(十四)-方差分析与试验设计
  17. Android:自动点击屏幕
  18. burpsuite配置证书抓取htpps
  19. 【记录】easyexcel导出后打开文件报已损坏
  20. Qt之调用FFTW3实现音频频谱(实现)

热门文章

  1. DiskGenius稳定不闪退版
  2. 0037-java.net.SocketException: No buffer space available (maximum connections reached?): JVM_Bind
  3. ffmpeg error:mp4 stream error: no moov before mdat and the stream is not seekable
  4. 线性时间选择算法的分治思想:邮局选址问题和士兵战队问题
  5. WebKitX ActiveX 6.0 X86 Crack
  6. 自动驾驶仿真工具之CARLA简介
  7. Android逆向之旅--龙之契约游戏钻石内购破解分析
  8. Javaweb课程设计(简单的个人博客)
  9. 5G核心网之SBA架构(面向服务)
  10. 华为HCIE云计算之FA桌面云业务发放