This repository has been archived by the owner on Apr 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
Add API Micro gateway deployment pattern #36
Merged
Merged
Changes from 13 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
d6462cf
Merge pull request #34 from ctienshi/release
msmshariq 9109c63
Add API Micro gateway deployment pattern
VimukthiPerera faed9eb
Rename wso2is-as-km to wso2am-is-as-km
VimukthiPerera 8623444
Merge branch 'master' of https://github.com/wso2/vagrant-apim into 2.2.x
VimukthiPerera cc6f75b
Merge pull request #35 from VimukthiPerera/master
msmshariq e930e4a
Change servername from localhost to remote ip
VimukthiPerera 6269c63
Add private network ip instead of localhost
VimukthiPerera 635b8ac
Merge branch 'master' of https://github.com/wso2/vagrant-apim into 2.2.x
VimukthiPerera fa66828
Add remote ip to APIGateway of WSO2am
VimukthiPerera d357a57
change ip addresses
VimukthiPerera c4a0bad
Update Readme.md
VimukthiPerera 7a5ea4e
Update README.md
VimukthiPerera 1ffe363
Refactor APIM-Microgateway-with-Analytics
VimukthiPerera e88a57d
Remove additional line
VimukthiPerera File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# WSO2 API Manager, API Micro-gateway with Analytics Support | ||
|
||
In order to run this Vagrant setup, you will need an active [Free Trial Subscription](https://wso2.com/free-trial-subscription) | ||
from WSO2 since the referring Vagrant Boxes hosted at vagrant.wso2.com contains the latest updates and fixes for WSO2 API Manager and | ||
API Manager Analytics 2.2.0. You can sign up for a Free Trial Subscription [here](https://wso2.com/free-trial-subscription). | ||
|
||
Access the API Publisher and Store via the URLs given below. | ||
|
||
* API Publisher | ||
|
||
``` | ||
https://localhost:9443/publisher/ | ||
``` | ||
|
||
* API Store | ||
|
||
``` | ||
https://localhost:9443/store/ | ||
``` | ||
|
||
* Carbon | ||
|
||
``` | ||
https://localhost:9443/carbon/ | ||
``` | ||
|
||
* Admin | ||
|
||
``` | ||
https://localhost:9443/admin/ | ||
``` | ||
## Note | ||
|
||
If you make any changes to the APIs or throttling policies, it is required to restart the API-Micro-gateway machine. | ||
|
||
``` | ||
vagrant halt wso2am-micro-gateway | ||
vagrant up wso2am-micro-gateway | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
# Copyright 2018 WSO2, Inc. (http://wso2.com) | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License | ||
# ------------------------------------------------------------------------ | ||
|
||
# -*- mode: ruby -*- | ||
|
||
require 'yaml' | ||
require 'fileutils' | ||
require 'uri' | ||
require 'erb' | ||
|
||
# check whether the command is 'vagrant up' | ||
if ARGV[0] == 'up' | ||
print "Please insert your WSO2 credentials\n" | ||
print "Username: " | ||
USERNAME = STDIN.gets.chomp | ||
print "Password: " | ||
PASSWORD = STDIN.noecho(&:gets).chomp | ||
print "\n" | ||
else | ||
# initializing USERNAME and PASSWORD | ||
USERNAME = "" | ||
PASSWORD = "" | ||
end | ||
|
||
# generate TOKEN | ||
TOKEN = [ERB::Util.url_encode(USERNAME), ERB::Util.url_encode(PASSWORD)].join(':') | ||
|
||
FILES_PATH = "./" | ||
DEFAULT_MOUNT = "/home/vagrant/" | ||
# load server configurations from YAML file | ||
CONFIGURATIONS = YAML.load_file('config.yaml') | ||
Vagrant.configure(2) do |config| | ||
|
||
# changing default timeout from 300 to 1000 seconds | ||
config.vm.boot_timeout = 1000 | ||
|
||
# loop through each server configuration specification | ||
CONFIGURATIONS['servers'].each do |server| | ||
# define the virtual machine configurations | ||
config.vm.define server['hostname'] do |server_config| | ||
# define the base Vagrant box to be used | ||
server_config.vm.box = server['box'] | ||
# define the virtual machine host name | ||
server_config.vm.host_name = server['hostname'] | ||
|
||
# Diasbling the synched folder | ||
server_config.vm.synced_folder ".", "/vagrant", disabled: true | ||
|
||
#generate the url | ||
url = "https://"+TOKEN+"@vagrant.wso2.com/boxes/"+server['box']+".box" | ||
|
||
server_config.vm.box_url = url | ||
|
||
# setup network configurations for the virtual machine | ||
# use private networking (recommended for multi-machine scenarios) | ||
server_config.vm.network :private_network, ip: server['ip'] | ||
|
||
#forwarding ports to access the server via localhost | ||
if server['ports'] | ||
server['ports'].each do |port| | ||
server_config.vm.network "forwarded_port", guest: port, host: port, guest_ip: server['ip'] | ||
end | ||
end | ||
|
||
memory = server['ram'] ? server['ram'] : 2048 | ||
cpu = server['cpu'] ? server['cpu'] : 1 | ||
# setup VirtualBox specific provider configurations | ||
server_config.vm.provider :virtualbox do |vb| | ||
vb.name = server['hostname'] | ||
vb.check_guest_additions = true | ||
vb.functional_vboxsf = false | ||
vb.gui = false | ||
vb.customize ['modifyvm', :id, '--memory', memory] | ||
vb.customize ['modifyvm', :id, '--cpus', cpu] | ||
end | ||
if server['conf_dir'] | ||
server_config.vm.provision "file", source: FILES_PATH + server['conf_dir'], destination: DEFAULT_MOUNT + server['conf_dir'] | ||
end | ||
# configure shell provisioner | ||
if !server['provisioner_script'] | ||
# if not defined, move to next server specification | ||
next | ||
end | ||
|
||
if server['provisioner_script_args'] | ||
# if argument(s) have been defined to be passed to the shell script | ||
server_config.vm.provision "shell", path: server['provisioner_script'], args: server['provisioner_script_args'] | ||
else | ||
# if no argument(s) have been defined to be passed to the shell script | ||
server_config.vm.provision "shell", path: server['provisioner_script'] | ||
end | ||
end | ||
end | ||
end |
Empty file.
Empty file.
Empty file.
112 changes: 112 additions & 0 deletions
112
...alytics/api-manager-analytics/confs/repository/conf/datasources/analytics-datasources.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
<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://172.28.128.3:3306/stats_db?autoReconnect=true&relaxAutoCommit=true</url> | ||
<username>root</username> | ||
<password>wso2carbon</password> | ||
<driverClassName>com.mysql.jdbc.Driver</driverClassName> | ||
<maxActive>50</maxActive> | ||
<maxWait>60000</maxWait> | ||
<validationQuery>SELECT 1</validationQuery> | ||
<defaultAutoCommit>false</defaultAutoCommit> | ||
<initialSize>0</initialSize> | ||
<testWhileIdle>true</testWhileIdle> | ||
<minEvictableIdleTimeMillis>4000</minEvictableIdleTimeMillis> | ||
<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://172.28.128.3:3306/stats_db?autoReconnect=true&relaxAutoCommit=true</url> | ||
<username>root</username> | ||
<password>wso2carbon</password> | ||
<driverClassName>com.mysql.jdbc.Driver</driverClassName> | ||
<maxActive>50</maxActive> | ||
<maxWait>60000</maxWait> | ||
<validationQuery>SELECT 1</validationQuery> | ||
<defaultAutoCommit>false</defaultAutoCommit> | ||
<initialSize>0</initialSize> | ||
<testWhileIdle>true</testWhileIdle> | ||
<minEvictableIdleTimeMillis>4000</minEvictableIdleTimeMillis> | ||
<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> | ||
|
||
32 changes: 32 additions & 0 deletions
32
...h-Analytics/api-manager-analytics/confs/repository/conf/datasources/stats-datasources.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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://172.28.128.3:3306/stats_db?autoReconnect=true&relaxAutoCommit=true</url> | ||
<username>root</username> | ||
<password>wso2carbon</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> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall we remove this additional line