diff --git a/docker-compose/sp-distributed/docker-compose.yml b/docker-compose/sp-distributed/docker-compose.yml index 4092493..7c15540 100644 --- a/docker-compose/sp-distributed/docker-compose.yml +++ b/docker-compose/sp-distributed/docker-compose.yml @@ -97,7 +97,7 @@ services: ports: - "9001:9443" healthcheck: - test: ["CMD", "nc", "-z","localhost", "9001"] + test: ["CMD", "nc", "-z","localhost", "9443"] interval: 10s timeout: 120s retries: 5 @@ -109,7 +109,6 @@ services: environment: NODE_ID: wso2sp-worker-1 NODE_IP: 0.0.0.0 - NODE_PORT: 9001 links: - manager1 worker2: @@ -118,7 +117,7 @@ services: ports: - "9002:9443" healthcheck: - test: ["CMD", "nc", "-z","localhost", "9002"] + test: ["CMD", "nc", "-z","localhost", "9443"] interval: 10s timeout: 120s retries: 5 @@ -130,7 +129,6 @@ services: environment: NODE_ID: wso2sp-worker-2 NODE_IP: 0.0.0.0 - NODE_PORT: 9002 links: - manager1 worker3: @@ -139,7 +137,7 @@ services: ports: - "9003:9443" healthcheck: - test: ["CMD", "nc", "-z","localhost", "9003"] + test: ["CMD", "nc", "-z","localhost", "9443"] interval: 10s timeout: 120s retries: 5 @@ -151,7 +149,6 @@ services: environment: NODE_ID: wso2sp-worker-3 NODE_IP: 0.0.0.0 - NODE_PORT: 9003 links: - manager1 worker4: @@ -160,7 +157,7 @@ services: ports: - "9004:9443" healthcheck: - test: ["CMD", "nc", "-z","localhost", "9004"] + test: ["CMD", "nc", "-z","localhost", "9443"] interval: 10s timeout: 120s retries: 5 @@ -172,6 +169,5 @@ services: environment: NODE_ID: wso2sp-worker-4 NODE_IP: 0.0.0.0 - NODE_PORT: 9004 links: - manager1 diff --git a/docker-compose/sp-distributed/manager/deployment.yaml b/docker-compose/sp-distributed/manager/deployment.yaml index 4092493..2058005 100644 --- a/docker-compose/sp-distributed/manager/deployment.yaml +++ b/docker-compose/sp-distributed/manager/deployment.yaml @@ -1,177 +1,292 @@ -version: '2.3' -services: - zookeeper: - image: wurstmeister/zookeeper - container_name: zookeeper - ports: - - "2181:2181" - - "2888:2888" - - "3888:3888" - healthcheck: - test: ["CMD", "nc", "-z","localhost", "2181"] - interval: 10s - timeout: 120s - retries: 5 - environment: - ZOO_PORT: 2181 - ZOOKEEPER_AUTOPURGE_SNAP_RETAIN_COUNT: 10 - ZOOKEEPER_AUTOPURGE_PURGE_INTERVAL: 2 - kafka: - image: wurstmeister/kafka - container_name: kafka - ports: - - "9092:9092" - healthcheck: - test: ["CMD", "nc", "-z","localhost", "9092"] - interval: 10s - timeout: 120s - retries: 5 - depends_on: - zookeeper: - condition: service_healthy - environment: - KAFKA_ADVERTISED_PORT: 9092 - KAFKA_ADVERTISED_HOST_NAME: kafka - KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181 - mysql: - image: mysql:5.7.19 - container_name: sp-rdbms - ports: - - 3306 - environment: - MYSQL_ROOT_PASSWORD: root - volumes: - - ./mysql/scripts:/docker-entrypoint-initdb.d - command: --max-connections=10000 - healthcheck: - test: ["CMD", "mysqladmin" ,"ping", "-uroot", "-proot"] - interval: 30s - timeout: 60s - retries: 5 - depends_on: - kafka: - condition: service_healthy - manager1: - image: docker.wso2.com/wso2sp-manager:4.2.0 - container_name: wso2sp-manager-1 - ports: - - "9543:9543" - healthcheck: - test: ["CMD", "nc", "-z","localhost", "9543"] - interval: 10s - timeout: 120s - retries: 5 - volumes: - - ./manager:/home/wso2carbon/wso2-server-volume/conf/manager - depends_on: - mysql: - condition: service_healthy - environment: - NODE_ID: wso2sp-manager-1 - NODE_IP: 0.0.0.0 - links: - - mysql - manager2: - image: docker.wso2.com/wso2sp-manager:4.2.0 - container_name: wso2sp-manager-2 - ports: - - "9544:9543" - healthcheck: - test: ["CMD", "nc", "-z","localhost", "9543"] - interval: 10s - timeout: 120s - retries: 5 - volumes: - - ./manager:/home/wso2carbon/wso2-server-volume/conf/manager - depends_on: - manager1: - condition: service_healthy - environment: - NODE_ID: wso2sp-manager-2 - NODE_IP: 0.0.0.0 - links: - - manager1 - worker1: - image: docker.wso2.com/wso2sp-worker:4.2.0 - container_name: wso2sp-worker-1 - ports: - - "9001:9443" - healthcheck: - test: ["CMD", "nc", "-z","localhost", "9001"] - interval: 10s - timeout: 120s - retries: 5 - volumes: - - ./worker:/home/wso2carbon/wso2-server-volume/conf/worker - depends_on: - manager1: - condition: service_healthy - environment: - NODE_ID: wso2sp-worker-1 - NODE_IP: 0.0.0.0 - NODE_PORT: 9001 - links: - - manager1 - worker2: - image: docker.wso2.com/wso2sp-worker:4.2.0 - container_name: wso2sp-worker-2 - ports: - - "9002:9443" - healthcheck: - test: ["CMD", "nc", "-z","localhost", "9002"] - interval: 10s - timeout: 120s - retries: 5 - volumes: - - ./worker:/home/wso2carbon/wso2-server-volume/conf/worker - depends_on: - manager1: - condition: service_healthy - environment: - NODE_ID: wso2sp-worker-2 - NODE_IP: 0.0.0.0 - NODE_PORT: 9002 - links: - - manager1 - worker3: - image: docker.wso2.com/wso2sp-worker:4.2.0 - container_name: wso2sp-worker-3 - ports: - - "9003:9443" - healthcheck: - test: ["CMD", "nc", "-z","localhost", "9003"] - interval: 10s - timeout: 120s - retries: 5 - volumes: - - ./worker:/home/wso2carbon/wso2-server-volume/conf/worker - depends_on: - manager1: - condition: service_healthy - environment: - NODE_ID: wso2sp-worker-3 - NODE_IP: 0.0.0.0 - NODE_PORT: 9003 - links: - - manager1 - worker4: - image: docker.wso2.com/wso2sp-worker:4.2.0 - container_name: wso2sp-worker-4 - ports: - - "9004:9443" - healthcheck: - test: ["CMD", "nc", "-z","localhost", "9004"] - interval: 10s - timeout: 120s - retries: 5 - volumes: - - ./worker:/home/wso2carbon/wso2-server-volume/conf/worker - depends_on: - manager1: - condition: service_healthy - environment: - NODE_ID: wso2sp-worker-4 - NODE_IP: 0.0.0.0 - NODE_PORT: 9004 - links: - - manager1 +################################################################################ +# Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved +# +# 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. +################################################################################ + + # Carbon Configuration Parameters +wso2.carbon: + # value to uniquely identify a server + id: ${NODE_ID} + # server name + name: WSO2 Stream Processor + # ports used by this server + ports: + # port offset + offset: 0 + +wso2.transport.http: + transportProperties: + - + name: "server.bootstrap.socket.timeout" + value: 60 + - + name: "client.bootstrap.socket.timeout" + value: 60 + - + name: "latency.metrics.enabled" + value: true + listenerConfigurations: + - + id: "default" + host: "${NODE_IP}" + port: 9190 + - + id: "msf4j-https" + host: "${NODE_IP}" + port: 9543 + scheme: https + keyStoreFile: "${carbon.home}/resources/security/wso2carbon.jks" + keyStorePassword: wso2carbon + certPass: wso2carbon + senderConfigurations: + - + id: "http-sender" + + # Configuration used for the databridge communication +databridge.config: + # No of worker threads to consume events + # THIS IS A MANDATORY FIELD + workerThreads: 10 + # Maximum amount of messages that can be queued internally in MB + # THIS IS A MANDATORY FIELD + maxEventBufferCapacity: 10000000 + # Queue size; the maximum number of events that can be stored in the queue + # THIS IS A MANDATORY FIELD + eventBufferSize: 2000 + # Keystore file path + # THIS IS A MANDATORY FIELD + keyStoreLocation : ${sys:carbon.home}/resources/security/wso2carbon.jks + # Keystore password + # THIS IS A MANDATORY FIELD + keyStorePassword : wso2carbon + # Session Timeout value in mins + # THIS IS A MANDATORY FIELD + clientTimeoutMin: 30 + # Data receiver configurations + # THIS IS A MANDATORY FIELD + dataReceivers: + - + # Data receiver configuration + dataReceiver: + # Data receiver type + # THIS IS A MANDATORY FIELD + type: Thrift + # Data receiver properties + properties: + tcpPort: '7611' + sslPort: '7711' + + - + # Data receiver configuration + dataReceiver: + # Data receiver type + # THIS IS A MANDATORY FIELD + type: Binary + # Data receiver properties + properties: + tcpPort: '9611' + sslPort: '9711' + tcpReceiverThreadPoolSize: '100' + sslReceiverThreadPoolSize: '100' + hostName: ${NODE_IP} + + # Configuration of the Data Agents - to publish events through databridge +data.agent.config: + # Data agent configurations + # THIS IS A MANDATORY FIELD + agents: + - + # Data agent configuration + agentConfiguration: + # Data agent name + # THIS IS A MANDATORY FIELD + name: Thrift + # Data endpoint class + # THIS IS A MANDATORY FIELD + dataEndpointClass: org.wso2.carbon.databridge.agent.endpoint.thrift.ThriftDataEndpoint + # Data publisher strategy + publishingStrategy: async + # Trust store path + trustStorePath: '${sys:carbon.home}/resources/security/client-truststore.jks' + # Trust store password + trustStorePassword: 'wso2carbon' + # Queue Size + queueSize: 32768 + # Batch Size + batchSize: 200 + # Core pool size + corePoolSize: 1 + # Socket timeout in milliseconds + socketTimeoutMS: 30000 + # Maximum pool size + maxPoolSize: 1 + # Keep alive time in pool + keepAliveTimeInPool: 20 + # Reconnection interval + reconnectionInterval: 30 + # Max transport pool size + maxTransportPoolSize: 250 + # Max idle connections + maxIdleConnections: 250 + # Eviction time interval + evictionTimePeriod: 5500 + # Min idle time in pool + minIdleTimeInPool: 5000 + # Secure max transport pool size + secureMaxTransportPoolSize: 250 + # Secure max idle connections + secureMaxIdleConnections: 250 + # secure eviction time period + secureEvictionTimePeriod: 5500 + # Secure min idle time in pool + secureMinIdleTimeInPool: 5000 + # SSL enabled protocols + sslEnabledProtocols: TLSv1.1,TLSv1.2 + # Ciphers + ciphers: TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,TLS_DHE_RSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,TLS_DHE_RSA_WITH_AES_128_CBC_SHA,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 + - + # Data agent configuration + agentConfiguration: + # Data agent name + # THIS IS A MANDATORY FIELD + name: Binary + # Data endpoint class + # THIS IS A MANDATORY FIELD + dataEndpointClass: org.wso2.carbon.databridge.agent.endpoint.binary.BinaryDataEndpoint + # Data publisher strategy + publishingStrategy: async + # Trust store path + trustStorePath: '${sys:carbon.home}/resources/security/client-truststore.jks' + # Trust store password + trustStorePassword: 'wso2carbon' + # Queue Size + queueSize: 32768 + # Batch Size + batchSize: 200 + # Core pool size + corePoolSize: 1 + # Socket timeout in milliseconds + socketTimeoutMS: 30000 + # Maximum pool size + maxPoolSize: 1 + # Keep alive time in pool + keepAliveTimeInPool: 20 + # Reconnection interval + reconnectionInterval: 30 + # Max transport pool size + maxTransportPoolSize: 250 + # Max idle connections + maxIdleConnections: 250 + # Eviction time interval + evictionTimePeriod: 5500 + # Min idle time in pool + minIdleTimeInPool: 5000 + # Secure max transport pool size + secureMaxTransportPoolSize: 250 + # Secure max idle connections + secureMaxIdleConnections: 250 + # secure eviction time period + secureEvictionTimePeriod: 5500 + # Secure min idle time in pool + secureMinIdleTimeInPool: 5000 + # SSL enabled protocols + sslEnabledProtocols: TLSv1.1,TLSv1.2 + # Ciphers + ciphers: TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,TLS_DHE_RSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,TLS_DHE_RSA_WITH_AES_128_CBC_SHA,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 + + # Deployment configuration parameters +wso2.artifact.deployment: + # Scheduler update interval + updateInterval: 5 + + # Periodic Persistence Configuration +state.persistence: + enabled: false + intervalInMin: 1 + revisionsToKeep: 2 + persistenceStore: org.wso2.carbon.stream.processor.core.persistence.FileSystemPersistenceStore + config: + location: siddhi-app-persistence + + # Secure Vault Configuration +wso2.securevault: + secretRepository: + type: org.wso2.carbon.secvault.repository.DefaultSecretRepository + parameters: + privateKeyAlias: wso2carbon + keystoreLocation: ${sys:carbon.home}/resources/security/securevault.jks + secretPropertiesFile: ${sys:carbon.home}/conf/${sys:wso2.runtime}/secrets.properties + masterKeyReader: + type: org.wso2.carbon.secvault.reader.DefaultMasterKeyReader + parameters: + masterKeyReaderFile: ${sys:carbon.home}/conf/${sys:wso2.runtime}/master-keys.yaml +wso2.datasources: + dataSources: + - name: SP_MGT_DB + description: The datasource used for registry and user manager + jndiConfig: + name: jdbc/WSO2ClusterDB + definition: + type: RDBMS + configuration: + jdbcUrl: 'jdbc:mysql://sp-rdbms:3306/SP_MGT_DB?useSSL=false' + username: root + password: root + driverClassName: com.mysql.jdbc.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' + username: wso2carbon + password: wso2carbon + driverClassName: org.h2.Driver + maxPoolSize: 50 + idleTimeout: 60000 + connectionTestQuery: SELECT 1 + validationTimeout: 30000 + isAutoCommit: false + + # Cluster Configuration +cluster.config: + enabled: true + groupId: sp-mgt + coordinationStrategyClass: org.wso2.carbon.cluster.coordinator.rdbms.RDBMSCoordinationStrategy + strategyConfig: + datasource: SP_MGT_DB # define a mysql datasource configured to the shared database + heartbeatInterval: 1000 + heartbeatMaxRetry: 2 + eventPollingInterval: 1000 + + # Deployment Configuration for Distributed Deployment +deployment.config: + type: distributed + httpsInterface: + host: ${NODE_ID} + port: 9543 + 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: zookeeper:2181 # zookeeper urls