被击落的localhost(127.0.0.1):9162主机似乎仍然下跌

时间:2015-02-09 09:48:30

标签: java wso2 wso2carbon wso2-am wso2bam

我正在设置WSO2 API Manager& WSO2 BAM。我完成了以下文章中给出的每一步。

http://umeshagunasinghe.blogspot.com/2013/11/how-to-configure-wso2-api-manager-to.html

当我尝试访问统计页面时,我在终端中看到以下错误。

[2015-02-09 15:04:17,418]  WARN {me.prettyprint.cassandra.connection.CassandraHostRetryService} -  Downed localhost(127.0.0.1):9162 host still appears to be down: Unable to open transport to localhost(127.0.0.1):9162 , java.net.ConnectException: Connection refused

conf / datasources / master-datasources.xml

<datasources-configuration xmlns:svns="http://org.wso2.securevault/configuration">

    <providers>
        <provider>org.wso2.carbon.ndatasource.rdbms.RDBMSDataSourceReader</provider>
    </providers>

    <datasources>

        <datasource>
            <name>WSO2_CARBON_DB</name>
            <description>The datasource used for registry and user manager</description>
            <jndiConfig>
                <name>jdbc/WSO2CarbonDB</name>
            </jndiConfig>
            <definition type="RDBMS">
                <configuration>
                    <url>jdbc:h2:repository/database/WSO2CARBON_DB;DB_CLOSE_ON_EXIT=FALSE;LOCK_TIMEOUT=60000</url>
                    <username>wso2carbon</username>
                    <password>wso2carbon</password>
                    <driverClassName>org.h2.Driver</driverClassName>
                    <maxActive>50</maxActive>
                    <maxWait>60000</maxWait>
                    <testOnBorrow>true</testOnBorrow>
                    <validationQuery>SELECT 1</validationQuery>
                    <validationInterval>30000</validationInterval>
                </configuration>
            </definition>
        </datasource>


<datasource>
          <name>WSO2AM_STATS_DB</name>
          <description>The datasource used for getting statistics to API Manager</description>
   <jndiConfig>
                <name>jdbc/WSO2AM_STATS_DB</name>
            </jndiConfig>
          <definition type="RDBMS">
          <configuration>
                 <!-- JDBC URL to query the database -->
                 <url>jdbc:h2:/opt/wso2bam-2.4.1/repository/database/APIMGTSTATS_DB;AUTO_SERVER=TRUE</url>
                 <username>wso2carbon</username>
                 <password>wso2carbon</password>
                 <driverClassName>org.h2.Driver</driverClassName>
                 <maxActive>50</maxActive>
                 <maxWait>60000</maxWait>
                 <testOnBorrow>true</testOnBorrow>
                 <validationQuery>SELECT 1</validationQuery>
                 <validationInterval>30000</validationInterval>
            </configuration>
         </definition>
  </datasource>


       <datasource>
           <name>WSO2BAM_CASSANDRA_DATASOURCE</name>
           <description>The datasource used for Cassandra data</description>
           <definition type="RDBMS">
               <configuration>
                   <url>jdbc:cassandra://localhost:9161/EVENT_KS</url>
                   <username>admin</username>
                   <password>admin</password>
               </configuration>
           </definition>
       </datasource>


     <datasource>
            <name>WSO2BAM_UTIL_DATASOURCE</name>
            <description>The datasource used for BAM utilities, such as message store etc..</description>
            <definition type="RDBMS">
                <configuration>
                    <url>jdbc:cassandra://localhost:9161/BAM_UTIL_KS</url>
                    <username>admin</username>
                    <password>admin</password>
                </configuration>
            </definition>
        </datasource>

                <!-- For an explanation of the properties, see: http://people.apache.org/~fhanik/jdbc-pool/jdbc-pool.html -->
        <!--datasource>
            <name>SAMPLE_DATA_SOURCE</name>
            <jndiConfig>
                <name></name>
                <environment>
                    <property name="java.naming.factory.initial"></property>
                    <property name="java.naming.provider.url"></property>
                </environment>
            </jndiConfig>
            <definition type="RDBMS">
                <configuration>

                    <defaultAutoCommit></defaultAutoCommit>
                    <defaultReadOnly></defaultReadOnly>
                    <defaultTransactionIsolation>NONE|READ_COMMITTED|READ_UNCOMMITTED|REPEATABLE_READ|SERIALIZABLE</defaultTransactionIsolation>
                    <defaultCatalog></defaultCatalog>
                    <username></username>
                    <password svns:secretAlias="WSO2.DB.Password"></password>
                    <maxActive></maxActive>
                    <maxIdle></maxIdle>
                    <initialSize></initialSize>
                    <maxWait></maxWait>

                    <dataSourceClassName>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</dataSourceClassName>
                    <dataSourceProps>
                        <property name="url">jdbc:mysql://localhost:3306/Test1</property>
                        <property name="user">root</property>
                        <property name="password">123</property>
                    </dataSourceProps>

                </configuration>
            </definition>
        </datasource-->

    </datasources>

</datasources-configuration>

偏移设置如下指南

中所述
<Offset>1</Offset>

如何解决此错误?

3 个答案:

答案 0 :(得分:1)

对于BAM 2.4(我正在运行BAM 2.5.0)以及处理端口偏移时,文档可能不正确。我首先按照文档发现我的日志一直试图连接到我的配置中无效的cassandra端口。我使用的偏移量为1,这将使端口9161.在我的BAM日志中,我一直看到它试图连接到端口9162的消息。我将/repository/conf/etc/hector-config.xml更改回来了到它的默认端口,一切都很好。

https://docs.wso2.com/display/AM180/Publishing+API+Runtime+Statistics

因此,在BAM 2.4.0及更高版本中,代码考虑了端口偏移。通过省略上述文档中的步骤5,我能够正确运行BAM。

答案 1 :(得分:0)

如果您使用的是APIM 1.7,请遵循此文档。我试了一会儿就行了。

Publishing API Runtime Statistics

答案 2 :(得分:0)

您使用的相关API-M和BAM版本是什么?上述文章仅与博客中提到的API-M和BAM的特定版本相关。最新版本的配置不同。有关最新的BAM和API-M集成步骤,请参阅以下documentation