Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Open the <APIM_HOME>/repository/conf/api-manager.xml file.
  2. Carryout the following configuration changes under the <APIUsageTracking> element in the XML file.Leave other configuration as default
    1. Enable Analytics by uncommenting and setting the <Enabled> element to true.

      Code Block
      <Enabled>false</Enabled>
    2. Define the <DASServerURL> value based on the Data Analytics Server (DAS) receivers.
      Example: {tcp://localhost:7612/,tcp://localhost:7613/}

    3. Define the <DASUsername> and <DASPassword> based on the DAS receivers.

    4. Define the <DASRestApiURL> element with the URL that will fetch data from DAS REST API.

    5. Set it as according to DAS master node

  3. Set DASRestApiUsername and DASRestApiPassword accroding to DAS REST
    1. according to DAS master node.

    2. Set <DASRestApiUsername> and <DASRestApiPassword> according to the DAS REST.

    Use the default configurations for the other configurations in this section.

  4. Configure Statistics client.
    By default APIM is configured for the DAS REST client

    1. Select the RDBMS Client.
      Do this by setting the <StatisticClientProvider> element as follow in the <APIM_HOME>/repository/conf/api-manager.xml file.


      Code Block
      <!-- For APIM implemented Statistic client for DAS REST API -->
      <StatisticClientProvider>org.wso2.carbon.apimgt.usage.client.impl.APIUsageStatisticsRestClientImpl</StatisticClientProvider>
    2. Define a datasource for the RDBMS client.
      Do this by adding the following configuration in both the <APIM_HOME>/repository/conf/datasources/master-datasources.xml and <DAS_HOME>/repository/conf/datasources/master-datasources.xml files.

      Code Block
      <datasource>
          <name>WSO2AM_STATS_DB</name>
          <description>The datasource used for registry and user manager</description>
          <jndiConfig>
              <name>jdbc/WSO2AM_STATS_DB</name>
          </jndiConfig>
          <definition type="RDBMS">
              <configuration>
                  <url>jdbc:mysql://localhost:3306/APIM_STAT?autoReconnect=true&</url>
                  <username>root</username>
                  <password>pass</password>
                  <driverClassName>com.mysql.jdbc.Driver</driverClassName>
                  <maxActive>50</maxActive>
                  <maxWait>60000</maxWait>
                  <testOnBorrow>true</testOnBorrow>
                  <validationQuery>SELECT 1</validationQuery>
                  <validationInterval>30000</validationInterval>
                  <defaultAutoCommit>false</defaultAutoCommit>
              </configuration>
          </definition>
      </datasource>
    3. Copy the appropriate RDBMS driver into both the DAS and APIM /repository/components/lib directories.
    4. Deploy CApp
      As the summarization logic is defined in the DAS CApp, you need to depoy it in all the DAS nodes. When configuring Analytics using XML, you need to deploy CApps manually; however, when configuring Analytics via the UI the CApp deployment takes place automatically. The APIM Analytics related CApps are found in the <APIM_HOME>/statistics/ directory. Use the API_Manager_Analytics_RDBMS.car for RDBMS configurations and the API_Manager_Analytics_REST.car for REST client. Use one of the following methods to deploy the CApp into DAS.
        • Copy the <APIM_HOME>/statistics/API_Manager_Analytics_RDBMS.car file into the <DAS_HOME>/repository/deployment/server/carbonapps directory. If the /carbonapps directory does not exist create the directory. Thereafter restart WSO2 DAS.
        • Start WSO2 DAS and sign in to the DAS Management Console. Navigate to the main menu and click Carbon Applications. Click Add and deploy the CApp from the <APIM_HOME>/statistics/ directory.