diff --git a/docker-compose/editor-worker-dashboard/README.md b/docker-compose/editor-worker-dashboard/README.md new file mode 100644 index 0000000..31c87c9 --- /dev/null +++ b/docker-compose/editor-worker-dashboard/README.md @@ -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/ + ``` diff --git a/docker-compose/manager-worker-dashboard/dashboard/conf/deployment.yaml b/docker-compose/editor-worker-dashboard/dashboard/conf/deployment.yaml similarity index 100% rename from docker-compose/manager-worker-dashboard/dashboard/conf/deployment.yaml rename to docker-compose/editor-worker-dashboard/dashboard/conf/deployment.yaml diff --git a/docker-compose/manager-worker-dashboard/docker-compose.yml b/docker-compose/editor-worker-dashboard/docker-compose.yml similarity index 59% rename from docker-compose/manager-worker-dashboard/docker-compose.yml rename to docker-compose/editor-worker-dashboard/docker-compose.yml index cee295b..2ea41a5 100644 --- a/docker-compose/manager-worker-dashboard/docker-compose.yml +++ b/docker-compose/editor-worker-dashboard/docker-compose.yml @@ -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 @@ -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 diff --git a/docker-compose/manager-worker-dashboard/manager/conf/deployment.yaml b/docker-compose/editor-worker-dashboard/editor/conf/deployment.yaml similarity index 86% rename from docker-compose/manager-worker-dashboard/manager/conf/deployment.yaml rename to docker-compose/editor-worker-dashboard/editor/conf/deployment.yaml index 7968bc5..19ca3f5 100644 --- a/docker-compose/manager-worker-dashboard/manager/conf/deployment.yaml +++ b/docker-compose/editor-worker-dashboard/editor/conf/deployment.yaml @@ -23,7 +23,7 @@ wso2.carbon: # ports used by this server ports: # port offset - offset: 1 + offset: 3 wso2.transport.http: transportProperties: @@ -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 @@ -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: @@ -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 @@ -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 diff --git a/docker-compose/manager-worker-dashboard/mysql/scripts/metrics.sql b/docker-compose/editor-worker-dashboard/mysql/scripts/metrics.sql similarity index 100% rename from docker-compose/manager-worker-dashboard/mysql/scripts/metrics.sql rename to docker-compose/editor-worker-dashboard/mysql/scripts/metrics.sql diff --git a/docker-compose/manager-worker-dashboard/mysql/scripts/status.sql b/docker-compose/editor-worker-dashboard/mysql/scripts/status.sql similarity index 100% rename from docker-compose/manager-worker-dashboard/mysql/scripts/status.sql rename to docker-compose/editor-worker-dashboard/mysql/scripts/status.sql diff --git a/docker-compose/manager-worker-dashboard/worker/conf/deployment.yaml b/docker-compose/editor-worker-dashboard/worker/conf/deployment.yaml similarity index 97% rename from docker-compose/manager-worker-dashboard/worker/conf/deployment.yaml rename to docker-compose/editor-worker-dashboard/worker/conf/deployment.yaml index 55be440..b05c237 100644 --- a/docker-compose/manager-worker-dashboard/worker/conf/deployment.yaml +++ b/docker-compose/editor-worker-dashboard/worker/conf/deployment.yaml @@ -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 diff --git a/docker-compose/manager-worker-dashboard/README.md b/docker-compose/manager-worker-dashboard/README.md deleted file mode 100644 index 7f288a6..0000000 --- a/docker-compose/manager-worker-dashboard/README.md +++ /dev/null @@ -1,59 +0,0 @@ -# WSO2 Stream Processor Distributed setup - -Runs a pre configured Stream Processor setup with Kafka broker and Stream Processor manager, 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 Kafka, Stream Processor manager, 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/kafka:2.11-0.10.0.0` to `image: kafka:2.11-0.10.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/manager-worker-dashboard folder: - ``` - cd [docker-sp]/docker-compose/manager-worker-dashboard - ``` - - 5. Execute the following Docker Compose command to start the deployment: - ``` - docker-compose up - ``` - - 6. In order to publish events from the Docker host machine, configure the Kafka container's id in the /etc/hosts file. This can be done as follows; - - Get the `container_id` of the Kafka container using `docker ps` command, name of the Kafka container is `wso2sp-kafka` - - Use the `container_id` obtained above to find the IP address of the container using, `docker inspect ` command - - Add a host entry for the `container_id` with the IP address obtained above - - > The host entry should be as follows; - - ``` - - ``` - - 7. In the Siddhi apps, set the hostname of the `bootstrap.server` as `kafka` as shown below; - ``` - bootstrap.servers='kafka:9092', - ``` - - 8. 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/ - ``` \ No newline at end of file