0
votes

I've deployed a fully distributed API Manager v260 according to the documentation with the following details:

  • IS (KM) 570 as Key Manager
  • Multiple gateways
  • SSO enabled with IS + email usernames
  • No hazelcast enabled on any profile
  • Gateways sync with NFS
  • Registry indexing has been turned off as recommended - see last point on the page

When I publish an API, the Publisher calls the admin services on the gateways and publishes the synapse file there:

[-1234] [2019-08-20 12:37:09,106] []  INFO {org.wso2.carbon.core.services.util.CarbonAuthenticationUtil} -  ['[email protected]@carbon.super [-1234]' logged in at [2019-08-20 12:37:09,106+0200]]
[-1234] [2019-08-20 12:37:10,481] []  INFO {org.wso2.carbon.core.services.util.CarbonAuthenticationUtil} -  ['[email protected]@carbon.super [-1234]' logged in at [2019-08-20 12:37:10,481+0200]]
[-1234] [2019-08-20 12:37:10,811] []  INFO {org.wso2.carbon.mediation.dependency.mgt.DependencyTracker} -  [Sequence : json_fault was added to the Synapse configuration successfully]
[-1234] [2019-08-20 12:37:11,050] []  INFO {org.wso2.carbon.mediation.dependency.mgt.DependencyTracker} -  [API : admin-AT-wso2.com--HelloWorld:v0.1 was added to the Synapse configuration successfully]
[-1234] [2019-08-20 12:37:11,052] []  INFO {org.apache.synapse.rest.API} -  [Initializing API: admin-AT-wso2.com--HelloWorld:v0.1]
[-1234] [2019-08-20 12:37:11,151] []  INFO {org.wso2.carbon.mediation.dependency.mgt.DependencyTracker} -  [Endpoint : HelloWorld--v0.1_APIproductionEndpoint was added to the Synapse configuration successfully]

I take it that the registry DB is the mechanism by which the Store is made aware of published APIs. There is no practical information on how to share the registry between the Store and Publisher profiles in the linked instructions, however I used the following registry.xml configs:

/opt/wso2/wso2am/api-publisher/wso2am-2.6.0/repository/conf/registry.xml

    <currentDBConfig>wso2registry</currentDBConfig>
    <readOnly>false</readOnly>
    <enableCache>true</enableCache>
    <registryRoot>/</registryRoot>


    <dbConfig name="wso2registry">
        <dataSource>jdbc/WSO2CarbonDB</dataSource>
    </dbConfig>
        <!--
    Directory structure federation using Governance JDBC-based Remote Instance Configuration
    https://docs.wso2.com/display/Governance540/Remote+Instance+and+Mount+Configuration+Details
    -->
    <dbConfig name="gov">
        <dataSource>jdbc/WSO2REG_DB</dataSource>
    </dbConfig>

    <remoteInstance url="https://localhost:9443/registry">
        <id>gov</id>
        <dbConfig>gov</dbConfig>
        <readOnly>false</readOnly>
        <registryRoot>/</registryRoot>
        <enableCache>true</enableCache>
        <cacheId>wso2_dbuser@jdbc:mysql://mysql:3306/wso2_reg_qa?autoReconnect=tru$
    </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/wso2am_conf</targetPath>
    </mount>

...

 <indexingConfiguration>
        <!-- Skipping indexing: https://docs.wso2.com/display/AM260/Installing+and+Configuring+the+Databases -->
        <startIndexing>false</startIndexing>
        <skipCache>true</skipCache>
        <startingDelayInSeconds>60</startingDelayInSeconds>
        <indexingFrequencyInSeconds>300</indexingFrequencyInSeconds>
        <!--number of resources submit for given indexing thread -->
        <batchSize>40</batchSize>
        <!--number of worker threads for indexing -->
        <indexerPoolSize>40</indexerPoolSize>
        <!-- location storing the time the indexing took place-->
        <lastAccessTimeLocation>/_system/local/repository/components/org.wso2.carbon.registry/indexing/lastaccesstime</lastAccessTimeLocation>
        <!-- the indexers that implement the indexer interface for a relevant media type/(s) -->
        <indexers>
            <!--indexer class="org.wso2.carbon.registry.indexing.indexer.MSExcelIndexer" mediaTypeRegEx="application/vnd.ms-excel"/>
            <indexer class="org.wso2.carbon.registry.indexing.indexer.MSPowerpointIndexer" mediaTypeRegEx="application/vnd.ms-powerpoint"/>
            <indexer class="org.wso2.carbon.registry.indexing.indexer.MSWordIndexer" mediaTypeRegEx="application/msword"/>
            <indexer class="org.wso2.carbon.registry.indexing.indexer.PDFIndexer" mediaTypeRegEx="application/pdf"/>
            <indexer class="org.wso2.carbon.registry.indexing.indexer.XMLIndexer" mediaTypeRegEx="application/xml"/-->
            <!--indexer class="org.wso2.carbon.governance.registry.extensions.indexers.RXTIndexer" mediaTypeRegEx="application/wsdl\+xml" profiles ="default,a$
            <indexer class="org.wso2.carbon.governance.registry.extensions.indexers.RXTIndexer" mediaTypeRegEx="application/x-xsd\+xml " profiles ="default,ap$
            <indexer class="org.wso2.carbon.governance.registry.extensions.indexers.RXTIndexer" mediaTypeRegEx="application/policy\+xml" profiles ="default,ap$
            <indexer class="org.wso2.carbon.governance.registry.extensions.indexers.RXTIndexer" mediaTypeRegEx="application/vnd.(.)+\+xml" profiles ="default,$
            <!--indexer class="org.wso2.carbon.registry.indexing.indexer.XMLIndexer" mediaTypeRegEx="application/(.)+\+xml"/>
            <indexer class="org.wso2.carbon.registry.indexing.indexer.PlainTextIndexer" mediaTypeRegEx="text/(.)+"/>
            <indexer class="org.wso2.carbon.registry.indexing.indexer.PlainTextIndexer" mediaTypeRegEx="application/x-javascript"/-->
            <indexer class="org.wso2.carbon.apimgt.impl.indexing.indexer.PlainTextIndexer" mediaTypeRegEx="text/plain+" profiles ="default,api-store,api-publi$
            <indexer class="org.wso2.carbon.apimgt.impl.indexing.indexer.PDFIndexer" mediaTypeRegEx="application/pdf" profiles ="default,api-store,api-publish$
            <indexer class="org.wso2.carbon.apimgt.impl.indexing.indexer.MSWordIndexer" mediaTypeRegEx="application/msword" profiles ="default,api-store,api-p$
            <indexer class="org.wso2.carbon.apimgt.impl.indexing.indexer.MSPowerpointIndexer" mediaTypeRegEx="application/vnd.ms-powerpoint" profiles ="defaul$
            <indexer class="org.wso2.carbon.apimgt.impl.indexing.indexer.MSExcelIndexer" mediaTypeRegEx="application/vnd.ms-excel" profiles ="default,api-stor$
            <indexer class="org.wso2.carbon.apimgt.impl.indexing.indexer.XMLIndexer" mediaTypeRegEx="application/xml" profiles ="default,api-store,api-publish$
            <indexer class="org.wso2.carbon.apimgt.impl.indexing.indexer.WSDLIndexer" mediaTypeRegEx="application/api-wsdl" profiles ="default,api-store,api-p$
        </indexers>
        <exclusions>
            <exclusion pathRegEx="/_system/config/repository/dashboards/gadgets/swfobject1-5/.*[.]html"/>
            <exclusion pathRegEx="/_system/local/repository/components/org[.]wso2[.]carbon[.]registry/mount/.*"/>
        </exclusions>
    </indexingConfiguration>

/opt/wso2/wso2am/api-store/wso2am-2.6.0/repository/conf/registry.xml

    <currentDBConfig>wso2registry</currentDBConfig>
    <readOnly>false</readOnly>
    <enableCache>true</enableCache>
    <registryRoot>/</registryRoot>


    <dbConfig name="wso2registry">
        <dataSource>jdbc/WSO2CarbonDB</dataSource>
    </dbConfig>
        <!--
    Directory structure federation using Governance JDBC-based Remote Instance Configuration
    https://docs.wso2.com/display/Governance540/Remote+Instance+and+Mount+Configuration+Details
    -->
    <dbConfig name="gov">
        <dataSource>jdbc/WSO2REG_DB</dataSource>
    </dbConfig>

    <remoteInstance url="https://localhost:9443/registry">
        <id>gov</id>
        <dbConfig>gov</dbConfig>
        <readOnly>false</readOnly>
        <registryRoot>/</registryRoot>
        <enableCache>true</enableCache>
        <cacheId>wso2_dbuser@jdbc:mysql://mysql:3306/wso2_reg_qa?autoReconnect=true&amp;</cacheId>
    </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/wso2am_conf</targetPath>
    </mount>

...

 <indexingConfiguration>
        <!-- Skipping indexing: https://docs.wso2.com/display/AM260/Installing+and+Configuring+the+Databases -->
        <startIndexing>false</startIndexing>
        <skipCache>true</skipCache>
        <startingDelayInSeconds>60</startingDelayInSeconds>
        <indexingFrequencyInSeconds>300</indexingFrequencyInSeconds>
        <!--number of resources submit for given indexing thread -->
        <batchSize>40</batchSize>
        <!--number of worker threads for indexing -->
        <indexerPoolSize>40</indexerPoolSize>
        <!-- location storing the time the indexing took place-->
        <lastAccessTimeLocation>/_system/local/repository/components/org.wso2.carbon.registry/indexing/lastaccesstime</lastAccessTimeLocation>
        <!-- the indexers that implement the indexer interface for a relevant media type/(s) -->
        <indexers>
            <!--indexer class="org.wso2.carbon.registry.indexing.indexer.MSExcelIndexer" mediaTypeRegEx="application/vnd.ms-excel"/>
            <indexer class="org.wso2.carbon.registry.indexing.indexer.MSPowerpointIndexer" mediaTypeRegEx="application/vnd.ms-powerpoint"/>
            <indexer class="org.wso2.carbon.registry.indexing.indexer.MSWordIndexer" mediaTypeRegEx="application/msword"/>
            <indexer class="org.wso2.carbon.registry.indexing.indexer.PDFIndexer" mediaTypeRegEx="application/pdf"/>
            <indexer class="org.wso2.carbon.registry.indexing.indexer.XMLIndexer" mediaTypeRegEx="application/xml"/-->
            <!--indexer class="org.wso2.carbon.governance.registry.extensions.indexers.RXTIndexer" mediaTypeRegEx="application/wsdl\+xml" profiles ="default,a$
            <indexer class="org.wso2.carbon.governance.registry.extensions.indexers.RXTIndexer" mediaTypeRegEx="application/x-xsd\+xml " profiles ="default,ap$
            <indexer class="org.wso2.carbon.governance.registry.extensions.indexers.RXTIndexer" mediaTypeRegEx="application/policy\+xml" profiles ="default,ap$
            <indexer class="org.wso2.carbon.governance.registry.extensions.indexers.RXTIndexer" mediaTypeRegEx="application/vnd.(.)+\+xml" profiles ="default,$
            <!--indexer class="org.wso2.carbon.registry.indexing.indexer.XMLIndexer" mediaTypeRegEx="application/(.)+\+xml"/>
            <indexer class="org.wso2.carbon.registry.indexing.indexer.PlainTextIndexer" mediaTypeRegEx="text/(.)+"/>
            <indexer class="org.wso2.carbon.registry.indexing.indexer.PlainTextIndexer" mediaTypeRegEx="application/x-javascript"/-->
            <indexer class="org.wso2.carbon.apimgt.impl.indexing.indexer.PlainTextIndexer" mediaTypeRegEx="text/plain+" profiles ="default,api-store,api-publi$
            <indexer class="org.wso2.carbon.apimgt.impl.indexing.indexer.PDFIndexer" mediaTypeRegEx="application/pdf" profiles ="default,api-store,api-publish$
            <indexer class="org.wso2.carbon.apimgt.impl.indexing.indexer.MSWordIndexer" mediaTypeRegEx="application/msword" profiles ="default,api-store,api-p$
            <indexer class="org.wso2.carbon.apimgt.impl.indexing.indexer.MSPowerpointIndexer" mediaTypeRegEx="application/vnd.ms-powerpoint" profiles ="defaul$
            <indexer class="org.wso2.carbon.apimgt.impl.indexing.indexer.MSExcelIndexer" mediaTypeRegEx="application/vnd.ms-excel" profiles ="default,api-stor$
            <indexer class="org.wso2.carbon.apimgt.impl.indexing.indexer.XMLIndexer" mediaTypeRegEx="application/xml" profiles ="default,api-store,api-publish$
            <indexer class="org.wso2.carbon.apimgt.impl.indexing.indexer.WSDLIndexer" mediaTypeRegEx="application/api-wsdl" profiles ="default,api-store,api-p$
        </indexers>
        <exclusions>
            <exclusion pathRegEx="/_system/config/repository/dashboards/gadgets/swfobject1-5/.*[.]html"/>
            <exclusion pathRegEx="/_system/local/repository/components/org[.]wso2[.]carbon[.]registry/mount/.*"/>
        </exclusions>
    </indexingConfiguration>

Both nodes point to the same REG_DB.

    <datasource>
            <name>WSO2REG_DB</name>
            <description>The datasource used for gov registry</description>
            <jndiConfig>
                <name>jdbc/WSO2REG_DB</name>
            </jndiConfig>
            <definition type="RDBMS">
                <configuration>
                    <url>jdbc:mysql://mysql:3306/wso2_reg_qa?autoReconnect=true&amp;</url>
                    <username>wso2_dbuser</username>
                    <password>123</password>
                    <driverClassName>com.mysql.jdbc.Driver</driverClassName>
                    <defaultAutoCommit>true</defaultAutoCommit>
                    <maxActive>75</maxActive>
                    <maxWait>60000</maxWait>
                    <testOnBorrow>true</testOnBorrow>
                    <validationQuery>SELECT 1</validationQuery>
                    <validationInterval>30000</validationInterval>
                </configuration>
            </definition>
    </datasource>

However there is no API visible in the store. If I click the View in Store link in the Publisher, I can open the API in the store. However when just browsing the Store it states: "No APIs published yet". The API was published with Public visibility, and I am logged in as admin@wso2 - the super admin user.

Am I missing something guys?

EDIT

Ok so I may have misinterpreted the "Registry indexing has been turned off as recommended - see last point on the page". I've now turned on Indexing but set skipCache to true i.e. both the Store and the Publisher have the following registry.xml files:

<!-- This defines index configuration which is used in meta data search feature of the registry -->
    <indexingConfiguration>
        <!-- Skipping indexing: https://docs.wso2.com/display/AM260/Installing+and+Configuring+the+Databases -->
        <startIndexing>true</startIndexing>
        <skipCache>true</skipCache>
        <startingDelayInSeconds>60</startingDelayInSeconds>
        <indexingFrequencyInSeconds>300</indexingFrequencyInSeconds>

I then re-initialized the databases, "re-indexed" the store, published the PizzaShack API however I have the same issue. I even set up Hazelcast between the Pub and the Store (same clustering domai)

2
Can u point where it says to disable indexing? You need to enable indexingPubci
Please see edit aboveMiddlewareManiac

2 Answers

0
votes

The APIs displayed in the Store are loaded from the solr index, and the solr index sync is triggered by the system based on a timestamp. To force the sync in a simple manner, in the carbon console registry of your Store node, replace the /_system/local/repository/components/org.wso2.carbon.registry/indexing/lastaccesstime registry path with /_system/local/repository/components/org.wso2.carbon.registry/indexing/lastaccesstime_x and restart the node.

0
votes

The edited registry config files seem to have solved the issue, however the APIs take some time to appear in the store