Skip to content

Commit

Permalink
Merge pull request #131 from ThilinaManamgoda/wso2-master
Browse files Browse the repository at this point in the history
Merge 2.2.x branch to master branch
  • Loading branch information
DilanUA authored Apr 26, 2018
2 parents 772744e + 3ae3d75 commit a1da077
Show file tree
Hide file tree
Showing 37 changed files with 8,066 additions and 35 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ target/
wso2*/scripts

notes.txt
**/files/*
**/files/*
!**/files/init.sh
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# WSO2 API Manager Docker Resources
# Docker Resources for WSO2 API Manager

This repository contains following Docker resources:

Expand Down
18 changes: 3 additions & 15 deletions docker-compose/APIM-ISasKM-with-Analytics/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ services:
mysql:
condition: service_healthy
volumes:
- ./apim-analytics/repository/conf/datasources/analytics-datasources.xml:/home/wso2carbon/wso2am-analytics-2.2.0/repository/conf/datasources/analytics-datasources.xml
- ./apim-analytics/repository/conf/datasources/stats-datasources.xml:/home/wso2carbon/wso2am-analytics-2.2.0/repository/conf/datasources/stats-datasources.xml
- ./apim-analytics:/home/wso2carbon/volumes
links:
- mysql
is-as-km:
Expand All @@ -46,11 +45,7 @@ services:
am-analytics:
condition: service_healthy
volumes:
- ./is-as-km/repository/conf/datasources/master-datasources.xml:/home/wso2carbon/wso2is-km-5.5.0/repository/conf/datasources/master-datasources.xml
- ./is-as-km/repository/conf/user-mgt.xml:/home/wso2carbon/wso2is-km-5.5.0/repository/conf/user-mgt.xml
- ./is-as-km/repository/conf/registry.xml:/home/wso2carbon/wso2is-km-5.5.0/repository/conf/registry.xml
- ./is-as-km/repository/conf/identity/identity.xml:/home/wso2carbon/wso2is-km-5.5.0/repository/conf/identity/identity.xml
- ./is-as-km/repository/conf/consent-mgt-config.xml:/home/wso2carbon/wso2is-km-5.5.0/repository/conf/consent-mgt-config.xml
- ./is-as-km:/home/wso2carbon/volumes
ports:
- "9765:9763"
- "9445:9443"
Expand All @@ -72,14 +67,7 @@ services:
is-as-km:
condition: service_healthy
volumes:
- ./apim/repository/conf/datasources/master-datasources.xml:/home/wso2carbon/wso2am-2.2.0/repository/conf/datasources/master-datasources.xml
- ./apim/repository/conf/api-manager.xml:/home/wso2carbon/wso2am-2.2.0/repository/conf/api-manager.xml
- ./apim/repository/conf/carbon.xml:/home/wso2carbon/wso2am-2.2.0/repository/conf/carbon.xml
- ./apim/repository/conf/user-mgt.xml:/home/wso2carbon/wso2am-2.2.0/repository/conf/user-mgt.xml
- ./apim/repository/conf/registry.xml:/home/wso2carbon/wso2am-2.2.0/repository/conf/registry.xml
- ./apim/repository/conf/tomcat/catalina-server.xml:/home/wso2carbon/wso2am-2.2.0/repository/conf/tomcat/catalina-server.xml
- ./apim/repository/conf/axis2/axis2.xml:/home/wso2carbon/wso2am-2.2.0/repository/conf/axis2/axis2.xml
- ./apim/bin/wso2server.sh:/home/wso2carbon/wso2am-2.2.0/bin/wso2server.sh
- ./apim:/home/wso2carbon/volumes
ports:
- "9763:9763"
- "9443:9443"
Expand Down
64 changes: 64 additions & 0 deletions docker-compose/APIM-Microgateway-with-Analytics/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# WSO2 API Manager & API Micro Gateway deployment with WSO2 API Manager Analytics


## Prerequisites

* Install [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git), [Docker](https://www.docker.com/get-docker) and [Docker Compose](https://docs.docker.com/compose/install/#install-compose)
in order to run the steps provided in following Quick start guide. <br><br>
* In order to run this Docker Compose setup, you will need an active [Free Trial Subscription](https://wso2.com/free-trial-subscription)
from WSO2 since the referring Docker images hosted at docker.wso2.com contains the latest updates and fixes for WSO2 API Microgateway <br>and
API Manager Analytics 2.2.0 products. You can sign up for a Free Trial Subscription [here](https://wso2.com/free-trial-subscription). <br><br>
* If you wish to run the Docker Compose setup using Docker images built locally, build Docker images using <br> [WSO2 API Microgateway Dockerfile](../../dockerfiles/microgateway/README.md) and [WSO2 API Manager Analytics Dockerfile](../../dockerfiles/apim-analytics/README.md) and remove `docker.wso2.com/` prefix from the `image` name in `docker-compose.yml`.
For example, change the line `image: docker.wso2.com/wso2am:2.2.0` to `image: wso2am:2.2.0`. <br>

<br>

## Quick Start Guide

1. Clone WSO2 APIM Docker git repository.
```
git clone https://github.com/wso2/docker-apim
```
> If you are to try out an already released zip of this repo, please ignore this 1st step.
2. Switch to `docker-compose/APIM-Microgateway-with-Analytics` folder.
```
cd docker-apim/docker-compose/APIM-Microgateway-with-Analytics
```
> If you are to try out an already released zip of this repo, please ignore this 2nd step also.
Instead, extract the zip file and directly browse to `docker-apim-<released-version-here>docker-compose/APIM-Microgateway-with-Analytics` folder.
> If you want to try out an already released tag, after executing 2nd step, checkout the relevant tag,
i.e. for example: git checkout tags/v2.2.0.4 and continue below steps.

3. Execute following Docker command to start the deployment.
```
docker-compose up
```

4. If you make any changes to the APIs or throttling policies after starting, restart the Microgateway server to make sure the changes are synced
```
docker-compose restart api-manager-gateway
```

5. Once the deployment is started, try to access the web UIs via following URLs and default credentials <br>
on your favorite web browser.

```
https://localhost:9443/publisher
https://localhost:9443/store
https://localhost:9443/admin
https://localhost:9443/carbon
```
Access the servers using following credentials.

* Username: admin <br>
* Password: admin

Please note that API Gateway will be available on following ports.
```
https://localhost:8244
https://localhost:8243
https://localhost:8280
```

Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
<datasources-configuration>

<providers>
<provider>org.wso2.carbon.ndatasource.rdbms.RDBMSDataSourceReader</provider>
<!--<provider>org.wso2.carbon.datasource.reader.hadoop.HBaseDataSourceReader</provider>-->
<!--<provider>org.wso2.carbon.datasource.reader.cassandra.CassandraDataSourceReader</provider>-->
</providers>

<datasources>

<datasource>
<name>WSO2_ANALYTICS_EVENT_STORE_DB</name>
<description>The datasource used for analytics record store</description>
<definition type="RDBMS">
<configuration>
<url>jdbc:mysql://mysql:3306/stats_db?autoReconnect=true&amp;relaxAutoCommit=true&amp;useSSL=false</url>
<username>root</username>
<password>root</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>
<defaultTransactionIsolation>READ_COMMITTED</defaultTransactionIsolation>
</configuration>
</definition>
</datasource>

<datasource>
<name>WSO2_ANALYTICS_PROCESSED_DATA_STORE_DB</name>
<description>The datasource used for analytics record store</description>
<definition type="RDBMS">
<configuration>
<url>jdbc:mysql://mysql:3306/stats_db?autoReconnect=true&amp;relaxAutoCommit=true&amp;useSSL=false</url>
<username>root</username>
<password>root</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>
<defaultTransactionIsolation>READ_COMMITTED</defaultTransactionIsolation>
</configuration>
</definition>
</datasource>

<!-- Sample datasource implementation for HBase Analytics RecordStore-->
<!--<datasource>
<name>WSO2_ANALYTICS_RS_DB_HBASE</name>
<description>The datasource used for analytics file system</description>
<jndiConfig>
<name>jdbc/WSO2HBaseDB</name>
</jndiConfig>
<definition type="HBASE">
<configuration>
<property>
<name>hbase.master</name>
<value>localhost:60000</value>
</property>
<property>
<name>fs.hdfs.impl</name>
<value>org.apache.hadoop.hdfs.DistributedFileSystem</value>
</property>
<property>
<name>fs.file.impl</name>
<value>org.apache.hadoop.fs.LocalFileSystem</value>
</property>
</configuration>
</definition>
</datasource>-->

<!-- Sample datasource implementation for Cassandra -->
<!--<datasource>
<name>WSO2_ANALYTICS_DS_CASSANDRA</name>
<description>The Cassandra datasource used for analytics</description>
<definition type="CASSANDRA">
<configuration>
<contactPoints>localhost</contactPoints>
<port>9042</port>
<username>admin</username>
<password>admin</password>
<clusterName>cluster1</clusterName>
<compression>NONE</compression>
<poolingOptions>
<coreConnectionsPerHost hostDistance="LOCAL">8</coreConnectionsPerHost>
<maxSimultaneousRequestsPerHostThreshold hostDistance="LOCAL">1024</maxSimultaneousRequestsPerHostThreshold>
</poolingOptions>
<queryOptions>
<fetchSize>5000</fetchSize>
<consistencyLevel>ONE</consistencyLevel>
<serialConsistencyLevel>SERIAL</serialConsistencyLevel>
</queryOptions>
<socketOptions>
<keepAlive>false</keepAlive>
<sendBufferSize>150000</sendBufferSize>
<connectTimeoutMillis>12000</connectTimeoutMillis>
<readTimeoutMillis>12000</readTimeoutMillis>
</socketOptions>
</configuration>
</definition>
</datasource>-->

</datasources>

</datasources-configuration>

Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<datasources-configuration xmlns:svns="http://org.wso2.securevault/configuration">

<providers>
<provider>org.wso2.carbon.ndatasource.rdbms.RDBMSDataSourceReader</provider>
</providers>

<datasources>
<datasource>
<name>WSO2AM_STATS_DB</name>
<description>The datasource used for setting statistics to API Manager</description>
<jndiConfig>
<name>jdbc/WSO2AM_STATS_DB</name>
</jndiConfig>
<definition type="RDBMS">
<configuration>
<url>jdbc:mysql://mysql:3306/stats_db?autoReconnect=true&amp;relaxAutoCommit=true&amp;useSSL=false</url>
<username>root</username>
<password>root</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>

</datasources>

</datasources-configuration>
Loading

0 comments on commit a1da077

Please sign in to comment.