Skip to content

Commit

Permalink
Merge pull request #13 from ThilinaManamgoda/master
Browse files Browse the repository at this point in the history
Basic deployment pattern
  • Loading branch information
msmshariq authored Mar 8, 2018
2 parents e505191 + 1af5654 commit a2a7458
Show file tree
Hide file tree
Showing 8 changed files with 80 additions and 138 deletions.
43 changes: 43 additions & 0 deletions docker-compose/editor-worker-dashboard/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# WSO2 Stream Processor Distributed setup

Runs a pre configured Stream Processor setup with Stream Processor editor, worker and dashboard nodes.

## Prerequisites

* [Docker](https://www.docker.com/get-docker) and [Docker Compose](https://docs.docker.com/compose/install/#install-compose) are required for running this Docker Compose file.

## How to deploy

1. Build the Stream Processor editor, worker and dashboard images using [SP Dockerfiles](../../dockerfiles/README.md)

> In the `docker-compose.yml`, remove the `dockerhub.wso2.com/` prefix from the `image` name
> For example, change the line `image: dockerhub.wso2.com/wso2sp-manager:4.0.0` to `image: wso2sp-manager:4.0.0`
2. Pull MySQL Docker image:
```
docker pull mysql:5.7.19
```
3. Download the latest Stream Processor Docker resources release zip file from the [releases](https://github.com/wso2/docker-sp/releases) page or clone this repository to your local machine and switch to the latest tag.
> Note that the local copy of `docker-sp` repository will be referred to as `[docker-sp]` from this point onwards.
4. Switch to the docker-compose/editor-worker-dashboard folder:
```
cd [docker-sp]/docker-compose/editor-worker-dashboard
```
5. Execute the following Docker Compose command to start the deployment:
```
docker-compose up
```
6. Add the following host entry for Stream Processor dashboard component;
```
127.0.0.1 wso2sp-dashboard
```
> The Stream Processor dashboard can be accessed using the following URL
```
https://wso2sp-dashboard:9643/monitoring/
```
Original file line number Diff line number Diff line change
Expand Up @@ -14,34 +14,16 @@ services:
interval: 30s
timeout: 60s
retries: 5
kafka:
image: dockerhub.wso2.com/kafka:2.11-0.10.0.0
container_name: wso2sp-kafka
editor:
image: dockerhub.wso2.com/wso2sp-editor:4.0.0
container_name: wso2sp-editor
ports:
- "2181:2181"
- "9092:9092"
- "9390:9390"
healthcheck:
test: ["CMD", "nc", "-z", "localhost", "9092"]
interval: 30s
timeout: 60s
retries: 5
manager:
image: dockerhub.wso2.com/wso2sp-manager:4.0.0
container_name: wso2sp-manager
ports:
- "9543:9543"
healthcheck:
test: ["CMD", "nc", "-z","localhost", "9190"]
test: ["CMD", "nc", "-z","localhost", "9090"]
interval: 10s
timeout: 120s
retries: 5
depends_on:
kafka:
condition: service_healthy
volumes:
- ./manager/conf/deployment.yaml:/home/wso2carbon/wso2sp-4.0.0/conf/manager/deployment.yaml
links:
- kafka
worker:
image: dockerhub.wso2.com/wso2sp-worker:4.0.0
container_name: wso2sp-worker
Expand All @@ -52,13 +34,13 @@ services:
interval: 10s
timeout: 120s
retries: 5
depends_on:
manager:
condition: service_healthy
volumes:
- ./worker/conf/deployment.yaml:/home/wso2carbon/wso2sp-4.0.0/conf/worker/deployment.yaml
- ./worker/conf/deployment.yaml:/home/wso2carbon/wso2sp-4.0.0/conf/worker/deployment.yaml
depends_on:
mysql:
condition: service_healthy
links:
- manager
- mysql
dashboard:
image: dockerhub.wso2.com/wso2sp-dashboard:4.0.0
container_name: wso2sp-dashboard
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ wso2.carbon:
# ports used by this server
ports:
# port offset
offset: 1
offset: 3

wso2.transport.http:
transportProperties:
Expand All @@ -40,12 +40,12 @@ wso2.transport.http:
listenerConfigurations:
-
id: "default"
host: "0.0.0.0"
port: 9190
host: "127.0.0.1"
port: 9390
-
id: "msf4j-https"
host: "0.0.0.0"
port: 9543
port: 9743
scheme: https
keyStoreFile: "${carbon.home}/resources/security/wso2carbon.jks"
keyStorePassword: wso2carbon
Expand Down Expand Up @@ -210,7 +210,7 @@ data.agent.config:
# Deployment configuration parameters
wso2.artifact.deployment:
# Scheduler update interval
updateInterval: 5
updateInterval: 2

# Periodic Persistence Configuration
state.persistence:
Expand All @@ -233,32 +233,16 @@ wso2.securevault:
type: org.wso2.carbon.secvault.reader.DefaultMasterKeyReader
parameters:
masterKeyReaderFile: ${sys:carbon.home}/conf/${sys:wso2.runtime}/master-keys.yaml

# Datasource Configurations
wso2.datasources:
dataSources:
- name: SP_MGT_DB
- name: WSO2_CARBON_DB
description: The datasource used for registry and user manager
definition:
type: RDBMS
configuration:
jdbcUrl: 'jdbc:h2:${sys:carbon.home}/wso2/${sys:wso2.runtime}/database/SP_MGT_DB;DB_CLOSE_ON_EXIT=FALSE;LOCK_TIMEOUT=60000'
username: wso2carbon
password: wso2carbon
driverClassName: org.h2.Driver
maxPoolSize: 50
idleTimeout: 60000
connectionTestQuery: SELECT 1
validationTimeout: 30000
isAutoCommit: false

- name: WSO2_PERMISSIONS_DB
description: The datasource used for permission feature
jndiConfig:
name: jdbc/PERMISSION_DB
useJndiReference: true
definition:
type: RDBMS
configuration:
jdbcUrl: 'jdbc:h2:${sys:carbon.home}/wso2/${sys:wso2.runtime}/database/PERMISSION_DB;IFEXISTS=TRUE;DB_CLOSE_ON_EXIT=FALSE;LOCK_TIMEOUT=60000;MVCC=TRUE'
jdbcUrl: 'jdbc:h2:${sys:carbon.home}/wso2/${sys:wso2.runtime}/database/WSO2_CARBON_DB;DB_CLOSE_ON_EXIT=FALSE;LOCK_TIMEOUT=60000'
username: wso2carbon
password: wso2carbon
driverClassName: org.h2.Driver
Expand All @@ -274,20 +258,12 @@ cluster.config:
groupId: sp
coordinationStrategyClass: org.wso2.carbon.cluster.coordinator.rdbms.RDBMSCoordinationStrategy
strategyConfig:
datasource: SP_MGT_DB # define a mysql datasource configured to the shared database
datasource: WSO2_CARBON_DB
heartbeatInterval: 1000
heartbeatMaxRetry: 2
eventPollingInterval: 1000

# Deployment Configuration for Distributed Deployment
deployment.config:
type: distributed
httpInterface:
host: manager
port: 9190
heartbeatInterval: 2000
heartbeatMaxRetry: 2
datasource: SP_MGT_DB # define a mysql datasource in datasources and refer it from here.
minResourceCount: 1
bootstrapURLs: kafka:9092 # kafka urls
zooKeeperURLs: kafka:2181 # zookeeper urls
#Authentication Configurations: Authentication is disabled in editor profile
auth.configs:
restAPIAuthConfigs:
authEnable: false
Original file line number Diff line number Diff line change
Expand Up @@ -375,16 +375,16 @@ cluster.config:
# retryAppSyncPeriod: 60000

# Sample of deployment.config for Distributed deployment
deployment.config:
type: distributed
httpInterface:
host: worker
port: 9090
username: admin
password: admin
leaderRetryInterval: 10000
resourceManagers:
- host: manager
port: 9190
username: admin
password: admin
#deployment.config:
# type: distributed
# httpInterface:
# host: worker
# port: 9090
# username: admin
# password: admin
# leaderRetryInterval: 10000
# resourceManagers:
# - host: manager
# port: 9190
# username: admin
# password: admin
59 changes: 0 additions & 59 deletions docker-compose/manager-worker-dashboard/README.md

This file was deleted.

0 comments on commit a2a7458

Please sign in to comment.