Step 1 - Download and install WSO2 API-MTo download WSO2 API-M go to the WSO2 API Manager page and either click DOWNLOAD or OTHER INSTALLATION OPTIONS. For more information on installing WSO2 API-M, see the Installation Guide. Anchor |
---|
| Step 1 - Download and install WSO2 API-M |
---|
| Step 1 - Download and install WSO2 API-M |
---|
|
Step 2 - Download and install WSO2 API-M AnalyticsTo download WSO2 API-M Analytics go to the WSO2 API Manager page, click OTHER INSTALLATION OPTIONS to navigate to the Installation Options page, and click Analytics.
As the process of installing API-M Analytics is identical to installing WSO2 Stream Processor Server 4.3.0 (WSO2 SP), the following steps direct you to the WSO2 SP documentation for details. Anchor |
---|
| Step 2 - Download and install WSO2 API-M Analytics |
---|
| Step 2 - Download and install WSO2 API-M Analytics |
---|
|
- Ensure that you have met the Installation Prerequisites.
- Install WSO2 API-M Analytics based on the installation instructions that is relevant to your operating system:
Follow the instructions below to do the required configurations for WSO2 API-M to publish statistics in the WSO2 API-M Analytics server. Anchor |
---|
| Step 3 - Configure WSO2 API Manager to publish statistics |
---|
| Step 3 - Configure WSO2 API Manager to publish statistics |
---|
|
Info |
---|
To download the WSO2 API Manager distribution, click DOWNLOAD and then click DOWNLOAD Server in the WSO2 API Manager page. |
Note |
---|
If you are working on a distributed (clustered) setup of API Manager, carry out the instructed configurations in the Publisher, Store and Gateway nodes of the API Manager. |
- Open the
<API-M_HOME>/repository/conf/api-manager.xml file. - Under the
<Analytics> sub element, set the Enabled parameter to true . Configure the following parameters if required. Parameter | Value | Description |
---|
<StreamProcessorServerURL> | <protocol>://<hostname>:<port>/ | The server URL of the remote WSO2 API-M Analytics server used to collect statistics from WSO2 API Manager. An event can also be published to multiple receiver groups, where each group has one or more receivers. Receiver groups are delimited by curly braces, whereas receivers are delimited by commas. e.g., Three receivers within a single group can be specified as follows.
tcp://localhost:7612,tcp://localhost:7613,tcp://localhost:7614 Two receiver groups with two receivers each can be specified as follows.
{tcp://localhost:7612,tcp://localhost:7613},{tcp://localhost:7712,tcp://localhost:7713} Note |
---|
Previously, when WSO2 API-M Analytics was powered by WSO2 Data Analytics Server 4.3.0Serverstr, you had to add a comma to separate the DAS URLs so that the analytics events were published to both nodes. However, when using WSO2 API-M Analytics 2.6.0, which is based on WSO2 Stream Processor 4.3.0, when publishing to an HA setup of APIM analytics, you need to separate the Stream Processor server URLs by the pipe symbol (|) because the analytics events are published in a failover manner where only one node handles the processing at any given time. Format:
Receiver URL = tcp://<SP Receiver -1>:<port>|tcp://<SP Receiver -2>:<port>|tcp://<SP Receiver -3>:<port>
Example:
Receiver URL = tcp://localhost:7611|tcp://localhost:7612 |
| <StreamProcessorUsername> | A valid administrator username | The administrator username to log into the remote WSO2 API-M Analytics server that collects statistics from WSO2 API Manager. Info |
---|
- If you enable email user, you need to configure
@carbon.super to the username of the API-M Analytics admin user. e.g., If the username of the API-M Analytics admin use is demo@wso2.com , it must be demo@wso2.com @carbon.super once you have enabled email user. - It is required to change the values
StreamProcessorUsername and StreamProcessorPassword parameters if the user of WSO2 API-M is different to the user of WSO2 API-M Analytics. The default value ${admin.username} retrieves the admin user of the current API-M node as the StreamProcessorUsername .
|
| <StreamProcessorPassword> | The password of the username specified. | The administrator password to log into the remote WSO2 API-M Analytics server that collects statistics from WSO2 API Manager. Info |
---|
It is required to change the values StreamProcessorUsername and StreamProcessorPassword parameters if the user of WSO2 API-M is different to the user of WSO2 API-M Analytics. The default value ${admin.password} retrieves the admin user of the current API-M node as the StreamProcessorUsername . |
| <StreamProcessorRestApiURL> | https://<host>:<port> | The WSO2 API-M Analytics REST API URL. The WSO2 API-M Analytics REST API connection information, which are included under the REST API-M connection information, are defined as global properties, as they are common to all the WSO2 API-M analytics. | <StreamProcessorRestApiUsername> | A valid administrator username | The administrator username to log into the remote WSO2 API-M Analytics server. | <StreamProcessorRestApiPassword> | The password of the username specified. | The administrator password to log into the remote WSO2 API-M Analytics server. | - Save the changes.
Configuring databases allow you to persist data relating to APIs, process them and analyze. Follow the procedure below to configure databases. Anchor |
---|
| Step 4 - Configure the databases |
---|
| Step 4 - Configure the databases |
---|
|
Excerpt |
---|
Info |
---|
The following is a list of database versions that are compatible with WSO2 API-M Analytics. - Postgres 9.5 and later
- MySQL 5.6
- MySQL 5.7
- Oracle 12c
- MS SQL Server 2012
- MS SQL Server 2014
- MS SQL Server 2016
- DB2
|
- Stop the WSO2 API-M Analytics server if it is running already.
Configure the dashboard profile. Open the <API-M_ANALYTICS_HOME>/conf/dashboard/deployment.yaml file. Edit the APIM_ANALYTICS_DB section. A sample for MySQL is shown below. Code Block |
---|
- name: APIM_ANALYTICS_DB
description: "The datasource used for APIM statistics aggregated data."
jndiConfig:
name: jdbc/APIM_ANALYTICS_DB
definition:
type: RDBMS
configuration:
jdbcUrl: 'jdbc:mysql://localhost:3306/ANALYTICS_DB'
username: 'root'
password: '123'
driverClassName: com.mysql.jdbc.Driver
maxPoolSize: 50
idleTimeout: 60000
connectionTestQuery: SELECT 1
validationTimeout: 30000
isAutoCommit: false |
Configure the worker profile. Note |
---|
If your deployment does not consist of any Mirogateways, you do not need to configure the WSO2AM_MGW_ANALYTICS_DB to an external database as you can use the default embedded H2 database. |
- Open the
<API-M_ANALYTICS_HOME>/conf/worker/deployment.yaml file. Edit the APIM_ANALYTICS_DB section. A sample for MySQL is shown below. Code Block |
---|
- name: APIM_ANALYTICS_DB
description: "The datasource used for APIM statistics aggregated data."
jndiConfig:
name: jdbc/APIM_ANALYTICS_DB
definition:
type: RDBMS
configuration:
jdbcUrl: 'jdbc:mysql://localhost:3306/ANALYTICS_DB'
username: 'root'
password: '123'
driverClassName: com.mysql.jdbc.Driver
maxPoolSize: 50
idleTimeout: 60000
connectionTestQuery: SELECT 1
validationTimeout: 30000
isAutoCommit: false |
Configure WSO2AM_MGW_ANALYTICS_DB to the same database as APIM_ANALYTICS_DB in the <API-M_ANALYTICS_HOME>/conf/worker/deployment.yaml file. Code Block |
---|
- name: WSO2AM_MGW_ANALYTICS_DB
description: "The datasource used for APIM MGW analytics data."
jndiConfig:
name: jdbc/WSO2AM_MGW_ANALYTICS_DB
definition:
type: RDBMS
configuration:
jdbcUrl: 'jdbc:mysql://localhost:3306/ANALYTICS_DB'
username: 'root'
password: '123'
driverClassName: com.mysql.jdbc.Driver
maxPoolSize: 50
idleTimeout: 60000
connectionTestQuery: SELECT 1
validationTimeout: 30000
isAutoCommit: false |
Create the AM_USAGE_UPLOADED_FILES table in the APIM_ANALYTICS_DB database. Localtabgroup |
---|
Localtab |
---|
active | true |
---|
id | mysql-AM_USAGE_UPLOADED_FILES |
---|
title | MySQL |
---|
| Code Block |
---|
CREATE TABLE IF NOT EXISTS AM_USAGE_UPLOADED_FILES (
FILE_NAME varchar(255) NOT NULL,
FILE_TIMESTAMP TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
FILE_PROCESSED tinyint(1) DEFAULT 0,
FILE_CONTENT MEDIUMBLOB DEFAULT NULL,
PRIMARY KEY (FILE_NAME, FILE_TIMESTAMP)
); |
|
Localtab |
---|
id | MSSQL-AM_USAGE_UPLOADED_FILES |
---|
title | MSSQL |
---|
| Code Block |
---|
CREATE TABLE AM_USAGE_UPLOADED_FILES (
FILE_NAME varchar(255) NOT NULL,
FILE_TIMESTAMP DATETIME2(0) DEFAULT GETDATE(),
FILE_PROCESSED smallint DEFAULT 0,
FILE_CONTENT VARBINARY(max) DEFAULT NULL,
PRIMARY KEY (FILE_NAME, FILE_TIMESTAMP)
); |
|
Localtab |
---|
id | Oracle-AM_USAGE_UPLOADED_FILES |
---|
title | Oracle |
---|
| Code Block |
---|
CREATE TABLE AM_USAGE_UPLOADED_FILES (
FILE_NAME varchar2(255) NOT NULL,
FILE_TIMESTAMP TIMESTAMP(0) DEFAULT SYSTIMESTAMP,
FILE_PROCESSED number(3) DEFAULT 0,
FILE_CONTENT BLOB DEFAULT NULL,
PRIMARY KEY (FILE_NAME, FILE_TIMESTAMP)
); |
|
Localtab |
---|
id | Postgres-AM_USAGE_UPLOADED_FILES |
---|
title | Postgres |
---|
| Code Block |
---|
CREATE TABLE IF NOT EXISTS AM_USAGE_UPLOADED_FILES (
FILE_NAME varchar(255) NOT NULL,
FILE_TIMESTAMP TIMESTAMP(0) DEFAULT CURRENT_TIMESTAMP,
FILE_PROCESSED smallint DEFAULT 0,
FILE_CONTENT BYTEA DEFAULT NULL,
PRIMARY KEY (FILE_NAME, FILE_TIMESTAMP)
); |
|
Localtab |
---|
id | DB2-AM_USAGE_UPLOADED_FILES |
---|
title | DB2 |
---|
| Code Block |
---|
CREATE TABLE IF NOT EXISTS AM_USAGE_UPLOADED_FILES (
FILE_NAME varchar(255) NOT NULL,
FILE_TIMESTAMP TIMESTAMP(0) DEFAULT CURRENT_TIMESTAMP,
FILE_PROCESSED tinyint DEFAULT 0,
FILE_CONTENT MEDIUMBLOB DEFAULT NULL,
PRIMARY KEY (FILE_NAME, FILE_TIMESTAMP)
); |
|
Localtab |
---|
id | INFORMIX-AM_USAGE_UPLOADED_FILES |
---|
title | Informix |
---|
| Code Block |
---|
CREATE TABLE IF NOT EXISTS AM_USAGE_UPLOADED_FILES (
FILE_NAME varchar(255) NOT NULL,
FILE_TIMESTAMP TIMESTAMP(0) DEFAULT CURRENT_TIMESTAMP,
FILE_PROCESSED tinyint DEFAULT 0,
FILE_CONTENT MEDIUMBLOB DEFAULT NULL,
PRIMARY KEY (FILE_NAME, FILE_TIMESTAMP)
); |
|
|
Point the following data sources to external databases. None of the following databases need DB scripts. The tables will be automatically created. Integrate third-party products when configuring the databases. Note |
---|
WSO2 SP is a OSGi-based product. Therefore, when you integrate third party products such as Oracle with WSO2 API-M Analytics, you need to check whether the libraries you need to add are OSGi based. If they are not, you need to convert them to OSGi bundles before adding them to the <API-M_ANALYTICS_HOME>/lib directory. To convert the jar files to OSGi bundles, follow the steps below. 1. Download the non-OSGi jar for the required third party product, and save it in a preferred directory in your machine. 2. Go to the <API-M_ANALYTICS_HOME>/bin directory. Run the command given below, to generate the converted file in the <API-M_ANALYTICS_HOME>/lib directory. Code Block |
---|
./jartobundle.sh <PATH_TO_NON-OSGi_JAR> ../lib |
|
- Start the WSO2 API-M Analytics server.
|
Anchor |
---|
| Step 5 - Configure keystores |
---|
| Step 5 - Configure keystores |
---|
| In the SSL handshake between the API Manager and API Manager Analytics servers, the client (i.e. API Manager) needs to verify the certificate presented by the server (i.e. API Manager Analytics). For this purpose, the client stores the trusted certificate of the server in the client-truststore.jks keystore.If you use a custom keystore in API Manager and/or API Manager Analytics, import the public key certificate of API Manager Analytics into the client-truststore.jks file of the API Manager. To export the public key from the server and import it into the client's trust store, follow the steps given in Adding CA-signed certificates to keystores in the Administration Guide. |