gpt4 book ai didi

java - 已关闭的本地主机(127.0.0.1) :9162 host still appears to be down

转载 作者:行者123 更新时间:2023-12-01 11:56:35 24 4
gpt4 key购买 nike

我正在设置 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>

如何修复此错误?

最佳答案

在使用端口偏移时,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。

关于java - 已关闭的本地主机(127.0.0.1) :9162 host still appears to be down,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28406824/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com