我们已经设置了最新版本的
在一个kubernetes集群上的单独的豆荚中(我们已经使用现有的脚本作为创建码头映像的基础),所有这些共享相关的MySQL数据库托管在同一个集群的另一个pod中。在许多配置都按预期工作之后,我们可以添加用户/角色,创建/发布/调用API并收集对这些调用的分析。然而,我们面临的最后一个问题是,一旦API发布,就有可能在商店中调用它。一旦API-manager pod重新启动(例如,通过向下/向上扩展相关部署,而不是使用碳仪表板),一旦API-Manager在重新启动之后重新启动并再次运行,那么发布的API仍然在商店中可见,但是,如果您试图调用其中一个(以前工作过的)端点,则返回404消息,API管理器记录以下错误:
INFO {org.apache.synapse.mediators.builtin.LogMediator} - STATUS =发送到主序列的消息。无效的URL,资源=/“上下文”/“端点被调用”
其中," context“是在发布API时为它设置的上下文,以及应该接收调用的服务的REST端点。此外,如果我们试图对发布服务器中的API进行更改(即重新发布它),则似乎有50/50的可能性使其工作并修复所有问题,直到下一次重新启动荚,或者在第一步单击" next : Implement“按钮时抛出一个错误,该按钮已经记录了这里 (尽管它说它已经在以前的版本中解决了)。
其余设置如下:
用户/角色
数据库
摘自am中的master- from ources.xml:
<datasource>
<name>WSO2_CARBON_DB</name>
<description>The datasource used by the registry</description>
<jndiConfig>
<name>jdbc/WSO2CarbonDB</name>
</jndiConfig>
<definition type="RDBMS">
<configuration>
<url>jdbc:mysql://mysql-apimdb:3306/amcarbondb?autoReconnect=true&useSSL=false</url>
<username>wso2carbon</username>
<password>abc</password>
<driverClassName>com.mysql.jdbc.Driver</driverClassName>
<maxActive>50</maxActive>
<maxWait>60000</maxWait>
<testOnBorrow>true</testOnBorrow>
<validationQuery>SELECT 1</validationQuery>
<validationInterval>30000</validationInterval>
</configuration>
</definition>
</datasource>
<datasource>
<name>WSO2AM_DB</name>
<description>The datasource used for API Manager database</description>
<jndiConfig>
<name>jdbc/WSO2AM_DB</name>
</jndiConfig>
<definition type="RDBMS">
<configuration>
<url>jdbc:mysql://mysql-apimdb:3306/apimgtdb?autoReconnect=true&useSSL=false</url>
<username>wso2carbon</username>
<password>abc</password>
<defaultAutoCommit>false</defaultAutoCommit>
<driverClassName>com.mysql.jdbc.Driver</driverClassName>
<maxActive>50</maxActive>
<maxWait>60000</maxWait>
<testOnBorrow>true</testOnBorrow>
<validationQuery>SELECT 1</validationQuery>
<validationInterval>30000</validationInterval>
</configuration>
</definition>
</datasource>
<datasource>
<name>WSO2UM_DB</name>
<description>The datasource used by user manager</description>
<jndiConfig>
<name>jdbc/WSO2UM_DB</name>
</jndiConfig>
<definition type="RDBMS">
<configuration>
<url>jdbc:mysql://mysql-apimdb:3306/userdb?autoReconnect=true&useSSL=false</url>
<username>wso2carbon</username>
<password>abc</password>
<driverClassName>com.mysql.jdbc.Driver</driverClassName>
<maxActive>50</maxActive>
<maxWait>60000</maxWait>
<testOnBorrow>true</testOnBorrow>
<validationQuery>SELECT 1</validationQuery>
<validationInterval>30000</validationInterval>
</configuration>
</definition>
</datasource>
<datasource>
<name>WSO2REG_DB</name>
<description>The datasource used for registry</description>
<jndiConfig>
<name>jdbc/WSO2REG_DB</name>
</jndiConfig>
<definition type="RDBMS">
<configuration>
<url>jdbc:mysql://mysql-apimdb:3306/regdb?autoReconnect=true&useSSL=false</url>
<username>wso2carbon</username>
<password>abc</password>
<driverClassName>com.mysql.jdbc.Driver</driverClassName>
<maxActive>50</maxActive>
<maxWait>60000</maxWait>
<testOnBorrow>true</testOnBorrow>
<validationQuery>SELECT 1</validationQuery>
<validationInterval>30000</validationInterval>
</configuration>
</definition>
</datasource>所有这些数据库在使用时都会被填充,并在初始设置时使用不同产品的DBscripts进行初始化。此外,registry.xml配置如下(仅显示更改,文件的其余部分与默认配置一样):
<currentDBConfig>wso2registry</currentDBConfig>
<readOnly>false</readOnly>
<enableCache>false</enableCache>
<registryRoot>/</registryRoot>
<dbConfig name="wso2registry">
<dataSource>jdbc/WSO2CarbonDB</dataSource>
</dbConfig>
<dbConfig name="govregistry">
<dataSource>jdbc/WSO2REG_DB</dataSource>
</dbConfig>
<remoteInstance url="https://localhost:9943/registry">
<id>gov</id>
<dbConfig>govregistry</dbConfig>
<cacheId>wso2carbon@jdbc:mysql://mysql-apimdb:3306/regdb</cacheId>
<readOnly>false</readOnly>
<enableCache>false</enableCache>
<registryRoot>/</registryRoot>
</remoteInstance>
<mount path="/_system/governance" overwrite="true">
<instanceId>gov</instanceId>
<targetPath>/_system/governance</targetPath>
</mount>
<mount path="/_system/config" overwrite="true">
<instanceId>gov</instanceId>
<targetPath>/_system/config</targetPath>
</mount>最后,由于am上的内存不是持久的,因此重新启动时丢失一些数据似乎是一个问题,因为我们已经将所有数据库移到另一个荚上的持久存储中,但是,这不应该是一个问题--除非我们遗漏了什么。是否有另一个需要添加/更改的注册表/数据源?所有其他未显示的默认数据源(STATS、MB_STORE、度量)也是为了使用MySQL服务器而设置的,因此,除非数据源文件夹中提供的数据源之外还有其他数据,否则所有数据都应该保留在相应的MySQL数据库中。
发布于 2017-10-23 11:58:57
我想您还没有为API管理器使用任何持久性存储。创建API时,API工件将在文件系统中创建并存储在wso2am-2.1.0/repository/deployment/server/synapse-configs/default/api位置。您需要为‘wso2am-2.1.0/存储库/部署/server/’拥有一个持久存储。在您的情况下,在重新启动期间,您没有相关的数据,因为您有一个新的包。
发布于 2021-01-22 15:50:12
可以通过将以下文件夹移动到持久卷来修复此问题:如建议的:/repository/deployment/server
但是,对于多租户安装,还需要使其具有持久性:/存储库/租户
https://stackoverflow.com/questions/46831230
复制相似问题