SlideShare uma empresa Scribd logo
1 de 42
Baixar para ler offline
DepSync for Deployment Artifact
Synchronization Between the Cluster
Nodes


 Pradeep Fernando           Kasun Gajasinghe
 Senior Software Engineer   Software Engineer
 pradeep@wso2.com           kasung@wso2.com
Agenda

•   The need for deployment synchronization
•   Brief introduction to WSO2 product clusters
•   Demo - Complete Application server cluster with DepSync +
    fronted by WSO2 ELB
Why Deployment Synchronization?

•   Artifact distribution and deployment should be transparent to
    the end-users

•   Manual artifact copying is acceptable for some extent in
    standalone product clusters.

•   Will that work in an elastically scaling cloud environment ??
Typical WSO2 Product Cluster

•   Manager and Worker nodes.
•   Manager is for administration purposes - artifact upload,
    applying security,etc
•   Worker nodes responsible for serving requests.
•   The setup is only valid for products that support artifact
    deployment:
    •   Application Server
    •   Enterprise Service Bus
    •   etc
Management and Worker Node Separation
Why Management & Worker Node Separation
Crash Course
• Proper separation of concerns - management nodes
  specialize in management of the setup while worker
  nodes specialize in serving requests to deployment
  artifacts
• Only management nodes are authorized to add new
  artifacts into the system or make configuration changes
• Worker nodes can only deploy artifacts & read
  configuration
• Lower memory foot in the worker nodes because the
  management console related OSGi bundles are not loaded
• Improved security - management nodes can be behind the
  internal firewall & be exposed to clients running within
  the organization only, while worker nodes can be exposed
  to external clients.
Deployment Synchronization

• Distributing deployment artifacts & related metadata to
  all nodes in a homogeneous cluster is a typical
  requirement for a clustered deployment of any
  middleware platform

• Provides a consistent, and reliable cluster

• Automated synchronization without need of any user
  interaction

• Artifact Metadata contains service policies, and other
  important service configuration details
Deployment Synchronizer

• WSO2 products provides this through Deployment
  Synchronizer (DepSync) mechanism

• A new feature addition to WSO2 products

• Synchronization done using a central repository, usually,
  a SVN server

• We call it SVN-based Deployment Synchronizer

• Extensible - may be a Git based one in the future.
The Deployment Synchronization Mechanism
What it synchronizes?

• Web Applications
• JAXWS / JAXRS Applications
• Proxy Services
• Data Services
• BPEL
• Basically all the deployable artifacts in axis2 repo of
  Carbon products (ex. repository/deployment/server)
• Service Metadata – (details on policies, transports etc.)
Enabling DepSync : Carbon.xml
DepSync Configuration

<DeploymentSynchronizer>
          <Enabled>true</Enabled>
          <AutoCommit>true|false</AutoCommit>
          <AutoCheckout>true</AutoCheckout>
          <RepositoryType>svn</RepositoryType>
          <SvnUrl>https://10.100.3.115/svn/repos/as</SvnUrl>
          <SvnUser>wso2</SvnUser>
          <SvnPassword>wso2123</SvnPassword>
          <SvnUrlAppendTenantId>true</SvnUrlAppendTenantId>
</DeploymentSynchronizer>

ex. local-file system based SvnUrl - file:///C:/demo/svnrepo
Multicast vs. WKA

Multicast
 • Cluster is going to be set up in a network where
   multicasting is allowed

Well-Known Address
• Cloud based deployment
• Members are distributed across datacenters & regions
• Multicasting blocked
DepSync and Multi-Tenancy

• DepSync synchronizes the artifacts among the product
  cluster in a tenant aware manner.

• Ghost deployment is supported in the depsync aware
  manner in order reduce the initial deployment and
  request serving latencies.
Configuring a minimal WSO2 cluster setup w/ Deployment Synchronization


DEMONSTRATION
Deployment diagram
Process


1.   Set up the Environment for Deployment Synchronizer

2.   Configure Load Balancer

3.   Configure Management Node - Application Server

4.   Configure Worker Node - Application Server
PART 1


Set up the Environment for
Deployment Synchronizer
Set up the Environment for Deployment
Synchronizer

• We will setup the SVN-based DepSync
• For this, you need the following
   o svnkit osgi bundle

   o TortoiseSVN / Silk SVN (Windows), Subversion

     command line package(Unix) -optional
Set up the Environment for Deployment
Synchronizer

• Download svnkit bundle from here - http://goo.gl/CVR2F
• If you will be using a remote svn location for depsync, you may
  skip the creation of local svn repository.
• To create a local svn repository,
   o if you have svn command line client, enter following
      command.
       svnadmin create C:demosvnrepo

   o    if you are using TortoiseSVN, then first create a folder at
        any place you like. Say - C://demo/svnrepo . Now go in to
        that folder, right-click -> TortoiseSVN -> "Create Repsitory
        here"
   o    Now, the SVN URL for this location is -
        file:///C:/demo/svnrepo
Set up the Environment for Deployment
Synchronizer

• We will use this svn url when configuring the manager
  and worker nodes. So, remember the location where you
  created this. DepSync config will also be configured there.
Enabling DepSync : Carbon.xml
DepSync Configuration

<DeploymentSynchronizer>
          <Enabled>true</Enabled>
          <AutoCommit>true|false</AutoCommit>
          <AutoCheckout>true</AutoCheckout>
          <RepositoryType>svn</RepositoryType>
          <SvnUrl>https://10.100.3.115/svn/repos/as</SvnUrl>
          <SvnUser>wso2</SvnUser>
          <SvnPassword>wso2123</SvnPassword>
          <SvnUrlAppendTenantId>true</SvnUrlAppendTenantId>
</DeploymentSynchronizer>


ex. local-file system based SvnUrl - file:///C:/demo/svnrepo
PART 2


Configure Load Balancer
Configure Load Balancer -
Loadbalancer.conf

• Download and extract wso2elb-2.0.0.zip
   o Let the extracted directory be WSO2_LB_HOME

• Open loadbalancer.conf file in the
  WSO2_LB_HOME/repository/conf
Configure Load Balancer

• Configuring the WSO2 Elastic Load Balancer is now
  complete
• To start the server
   o Go to the WSO2_LB_HOME/bin folder using command

     line
   o Enter the command `wso2server.bat`

   o Notice the logs printed by TribesClusteringAgent
PART 3


Configure Management Node
- Application Server
Configure Management Node

• Download and extract wso2as-5.0.0.zip
   o   Rename extracted directory to wso2as-5.0.0-manager
   o   Let the extracted directory be WSO2_AS_MGR_HOME
Configure Management Node -
axis2.xml
 • Enable clustering at axis2 level.
<clustering
class="org.apache.axis2.clustering.tribes.TribesClusteringAgent"
enable="true">


 • Change the membershipScheme of clustering to wka (well-
   known address)
<parameter name="membershipScheme">wka</parameter>


 • Set the cluster domain. This must be the same which we
   defined in loadbalancer.conf
<parameter name="domain">wso2.as.domain</parameter>
Configure Management Node -
axis2.xml
• Set localMemberHost
 <parameter
   name="localMemberHost">mgt.appserver.wso2.com</parameter>


• Set localMemberPort
<parameter name="localMemberPort">4250</parameter>


• Add a new property named "subDomain"and set it to
  'mgt' inside the parameter "properties"
 <parameter name="properties">
     <property name="backendServerURL"
   value="https://${hostName}:${httpsPort}/services/"/>
     <property name="mgtConsoleURL" value="https://${hostName}:${httpsPort}/"/>


      <property name="subDomain" value="mgt"/>

  </parameter>
• Add load balancer as a well-known member.
   o Use the IP/hostname and port defined in LB's

     axis2.xml
<members>
     <member>
         <hostName>127.0.0.1</hostName>
         <port>4000</port>
     </member>
 </members>
Configure Management Node –
catalina-server.xml
 • Since the mgt node is fronted by an LB, we need to
   configure
   proxy ports associated with HTTP and HTTPS connecters.
    o Defaults for http and https are 8280 and 8243

      respectively.
<Connector   protocol="org.apache.coyote.http11.Http11NioProtocol"
                 port="9763"
                 proxyPort="8280“
                 ---

<Connector   protocol="org.apache.coyote.http11.Http11NioProtocol"
                 port="9443“
                 proxyPort="8243“
                 ---
Configure Management Node –
carbon.xml
 • Set port offset to avoid port conflicts with other nodes
   (LB).
<Offset>1</Offset>


 • Update mgtHostName and HostName elements in
   carbon.xml as shown below
<HostName>appserver.wso2.com</HostName><MgtHostName>mgt.appserver
.wso2.com</MgtHostName>


 • Copy svnkit bundle to repository/components/dropins
Configure Management Node -
Deployment Synchronizer
 •   The deployment synchronizer config is in carbon.xml.
 •   Uncomment the DeploymentSynchronizer xml segment.
 •   Set AutoCommit to true.
 •   Set the SVNUrl
     • No need to set username/password if you didn't set it for local
       svn repo
<DeploymentSynchronizer>
     <Enabled>true</Enabled>
     <AutoCommit>true</AutoCommit>
     <AutoCheckout>true</AutoCheckout>
     <RepositoryType>svn</RepositoryType>
     <SvnUrl>file:///C:/webinar-setup/demo/final/svnrepo</SvnUrl>
     <SvnUser>username</SvnUser>
     <SvnPassword>password</SvnPassword>
     <SvnUrlAppendTenantId>true</SvnUrlAppendTenantId>
</DeploymentSynchronizer>
Configure Management Node

• Configuring the WSO2 Application Server is now complete
• To start the server
   o Go to the WSO2_AS_MGR_HOME/bin folder using

      command line
   o Enter the command `wso2server.bat`

   o Notice the logs printed by TribesClusteringAgent

      and corresponding cluster joining logs in load
      balancer.
• You can now login to management console via
  https://mgt.appserver.wso2.com:8243/carbon/
• Notice that requests we sent to services (including WSDL)
  will be directed to worker nodes.
PART 4


Configure Worker Node -
Application Server
Configure Worker Node

• We can use a copy of a management node, and convert it
  to a worker node easily since it will have most of the
  settings
• So, instead of using a fresh appserver copy, make a copy of
  the management node we just created
• Rename the new folder as wso2as-5.0.0-worker
• Let this directory be WSO2_AS_WORKER_HOME
Configure Worker Node -
axis2.xml
• In addition to the settings we already have, do the
  following.
• Set the localMemberPort to 4251
<parameter name="localMemberPort">4251</parameter>


• This node belongs to the "worker"subDomain, so, change
  the property "subDomain" to worker (instead of mgt)
  <parameter name="properties">
       <property name="backendServerURL"
  value="https://${hostName}:${httpsPort}/services/"/>
         <property name="mgtConsoleURL"
  value="https://${hostName}:${httpsPort}/"/>

     <property name="subDomain" value="worker"/>

   </parameter>
Configure Worker Node –
carbon.xml
 • First set a new port offset
<Offset>2</Offset>


 • Comment out/remove the mgtHostName configuration
 • Set the AutoCommit property inside Deployment Synchronizer
   to false. This MUST be done because the worker nodes of a
   cluster should NOT commit (write) artifacts
<DeploymentSynchronizer>
     <Enabled>true</Enabled>
     <AutoCommit>false</AutoCommit>
     <AutoCheckout>true</AutoCheckout>
     <RepositoryType>svn</RepositoryType>
     <SvnUrl>file:///C:/webinar-setup/demo/final/svnrepo</SvnUrl>
     <SvnUser>username</SvnUser>
     <SvnPassword>password</SvnPassword>
     <SvnUrlAppendTenantId>true</SvnUrlAppendTenantId>
</DeploymentSynchronizer>
Configure Worker Node –
carbon.xml
•
• Now, it's time to start the server.
   o NOTE: The workerNode system property must be set

     when starting the worker nodes every time.

wso2server.bat -DworkerNode=true
Testing the cluster

There are many ways to test our cluster deployment. Let's
follow a simpler path.

 • Log in to the management console of Application Server
   management node
 • Deploy a new Axis2 Web service (Go to Manage --> Axis2
   Services --> Add --> AAR service)
 • Once the service is deployed in the management node go
   to the services list and click on Tryit
 • Invoke the service
QUESTIONS?
THANK YOU!!

Mais conteúdo relacionado

Mais procurados

GUJavaSC - Criando Micro-serviços Reativos com Java
GUJavaSC - Criando Micro-serviços Reativos com JavaGUJavaSC - Criando Micro-serviços Reativos com Java
GUJavaSC - Criando Micro-serviços Reativos com JavaRodrigo Cândido da Silva
 
Play 2 Java Framework with TDD
Play 2 Java Framework with TDDPlay 2 Java Framework with TDD
Play 2 Java Framework with TDDBasav Nagur
 
Monitoring and Tuning GlassFish
Monitoring and Tuning GlassFishMonitoring and Tuning GlassFish
Monitoring and Tuning GlassFishC2B2 Consulting
 
JavaEE Microservices platforms
JavaEE Microservices platformsJavaEE Microservices platforms
JavaEE Microservices platformsPayara
 
Deploying Elastic Java EE Microservices in the Cloud with Docker
Deploying Elastic Java EE Microservices in the Cloud with DockerDeploying Elastic Java EE Microservices in the Cloud with Docker
Deploying Elastic Java EE Microservices in the Cloud with DockerPayara
 
JavaOne 2016 - Reactive Microservices with Java and Java EE
JavaOne 2016 - Reactive Microservices with Java and Java EEJavaOne 2016 - Reactive Microservices with Java and Java EE
JavaOne 2016 - Reactive Microservices with Java and Java EERodrigo Cândido da Silva
 
Microservices with Micronaut
Microservices with MicronautMicroservices with Micronaut
Microservices with MicronautQAware GmbH
 
How Class Data Sharing Can Speed up Your Jakarta EE Application Startup
How Class Data Sharing Can Speed up Your Jakarta EE Application StartupHow Class Data Sharing Can Speed up Your Jakarta EE Application Startup
How Class Data Sharing Can Speed up Your Jakarta EE Application StartupRudy De Busscher
 
Writing Java EE microservices using WildFly Swarm
Writing Java EE microservices using WildFly SwarmWriting Java EE microservices using WildFly Swarm
Writing Java EE microservices using WildFly SwarmComsysto Reply GmbH
 
Microsoft Azure 新功能導覽 @ Build 2014
Microsoft Azure 新功能導覽 @ Build 2014Microsoft Azure 新功能導覽 @ Build 2014
Microsoft Azure 新功能導覽 @ Build 2014Jeff Chu
 
Andrea Di Persio
Andrea Di PersioAndrea Di Persio
Andrea Di PersioCodeFest
 
Spring Boot. Boot up your development. JEEConf 2015
Spring Boot. Boot up your development. JEEConf 2015Spring Boot. Boot up your development. JEEConf 2015
Spring Boot. Boot up your development. JEEConf 2015Strannik_2013
 
Blazor, lo sapevi che...
Blazor, lo sapevi che...Blazor, lo sapevi che...
Blazor, lo sapevi che...Andrea Dottor
 
Deploy meteor in production
Deploy meteor in productionDeploy meteor in production
Deploy meteor in productionMiro Radenovic
 
Java on Azure JJUG Night Seminar 2016 0322
Java on Azure JJUG Night Seminar 2016 0322Java on Azure JJUG Night Seminar 2016 0322
Java on Azure JJUG Night Seminar 2016 0322Yoshio Terada
 
Robe - A brand new robe for Dropwizard
Robe - A brand new robe for DropwizardRobe - A brand new robe for Dropwizard
Robe - A brand new robe for DropwizardSeray Uzgur
 
Building microservices with vert.x 3.0
Building microservices with vert.x 3.0Building microservices with vert.x 3.0
Building microservices with vert.x 3.0Agraj Mangal
 
Real World Enterprise Reactive Programming using Vert.x
Real World Enterprise Reactive Programming using Vert.xReal World Enterprise Reactive Programming using Vert.x
Real World Enterprise Reactive Programming using Vert.xSascha Möllering
 
[WSO2Con EU 2017] Writing Microservices Using MSF4J
[WSO2Con EU 2017] Writing Microservices Using MSF4J[WSO2Con EU 2017] Writing Microservices Using MSF4J
[WSO2Con EU 2017] Writing Microservices Using MSF4JWSO2
 

Mais procurados (20)

GUJavaSC - Criando Micro-serviços Reativos com Java
GUJavaSC - Criando Micro-serviços Reativos com JavaGUJavaSC - Criando Micro-serviços Reativos com Java
GUJavaSC - Criando Micro-serviços Reativos com Java
 
Play 2 Java Framework with TDD
Play 2 Java Framework with TDDPlay 2 Java Framework with TDD
Play 2 Java Framework with TDD
 
Monitoring and Tuning GlassFish
Monitoring and Tuning GlassFishMonitoring and Tuning GlassFish
Monitoring and Tuning GlassFish
 
JavaEE Microservices platforms
JavaEE Microservices platformsJavaEE Microservices platforms
JavaEE Microservices platforms
 
Deploying Elastic Java EE Microservices in the Cloud with Docker
Deploying Elastic Java EE Microservices in the Cloud with DockerDeploying Elastic Java EE Microservices in the Cloud with Docker
Deploying Elastic Java EE Microservices in the Cloud with Docker
 
JavaOne 2016 - Reactive Microservices with Java and Java EE
JavaOne 2016 - Reactive Microservices with Java and Java EEJavaOne 2016 - Reactive Microservices with Java and Java EE
JavaOne 2016 - Reactive Microservices with Java and Java EE
 
Microservices with Micronaut
Microservices with MicronautMicroservices with Micronaut
Microservices with Micronaut
 
How Class Data Sharing Can Speed up Your Jakarta EE Application Startup
How Class Data Sharing Can Speed up Your Jakarta EE Application StartupHow Class Data Sharing Can Speed up Your Jakarta EE Application Startup
How Class Data Sharing Can Speed up Your Jakarta EE Application Startup
 
Writing Java EE microservices using WildFly Swarm
Writing Java EE microservices using WildFly SwarmWriting Java EE microservices using WildFly Swarm
Writing Java EE microservices using WildFly Swarm
 
Microsoft Azure 新功能導覽 @ Build 2014
Microsoft Azure 新功能導覽 @ Build 2014Microsoft Azure 新功能導覽 @ Build 2014
Microsoft Azure 新功能導覽 @ Build 2014
 
Andrea Di Persio
Andrea Di PersioAndrea Di Persio
Andrea Di Persio
 
Lagom in Practice
Lagom in PracticeLagom in Practice
Lagom in Practice
 
Spring Boot. Boot up your development. JEEConf 2015
Spring Boot. Boot up your development. JEEConf 2015Spring Boot. Boot up your development. JEEConf 2015
Spring Boot. Boot up your development. JEEConf 2015
 
Blazor, lo sapevi che...
Blazor, lo sapevi che...Blazor, lo sapevi che...
Blazor, lo sapevi che...
 
Deploy meteor in production
Deploy meteor in productionDeploy meteor in production
Deploy meteor in production
 
Java on Azure JJUG Night Seminar 2016 0322
Java on Azure JJUG Night Seminar 2016 0322Java on Azure JJUG Night Seminar 2016 0322
Java on Azure JJUG Night Seminar 2016 0322
 
Robe - A brand new robe for Dropwizard
Robe - A brand new robe for DropwizardRobe - A brand new robe for Dropwizard
Robe - A brand new robe for Dropwizard
 
Building microservices with vert.x 3.0
Building microservices with vert.x 3.0Building microservices with vert.x 3.0
Building microservices with vert.x 3.0
 
Real World Enterprise Reactive Programming using Vert.x
Real World Enterprise Reactive Programming using Vert.xReal World Enterprise Reactive Programming using Vert.x
Real World Enterprise Reactive Programming using Vert.x
 
[WSO2Con EU 2017] Writing Microservices Using MSF4J
[WSO2Con EU 2017] Writing Microservices Using MSF4J[WSO2Con EU 2017] Writing Microservices Using MSF4J
[WSO2Con EU 2017] Writing Microservices Using MSF4J
 

Semelhante a [WSO2] Deployment Synchronizer for Deployment Artifact Synchronization Between the WSO2 Cluster Nodes

Practical solutions for connections administrators
Practical solutions for connections administratorsPractical solutions for connections administrators
Practical solutions for connections administratorsSharon James
 
The secret life of a dispatcher (Adobe CQ AEM)
The secret life of a dispatcher (Adobe CQ AEM)The secret life of a dispatcher (Adobe CQ AEM)
The secret life of a dispatcher (Adobe CQ AEM)Venugopal Gummadala
 
AAI-3218 Production Deployment Best Practices for WebSphere Liberty Profile
AAI-3218 Production Deployment Best Practices for WebSphere Liberty ProfileAAI-3218 Production Deployment Best Practices for WebSphere Liberty Profile
AAI-3218 Production Deployment Best Practices for WebSphere Liberty ProfileWASdev Community
 
Sa106 – practical solutions for connections administrators
Sa106 – practical solutions for connections administratorsSa106 – practical solutions for connections administrators
Sa106 – practical solutions for connections administratorsSharon James
 
Migration Station at SAS - DevOps for Fusion with Version Control and Continu...
Migration Station at SAS - DevOps for Fusion with Version Control and Continu...Migration Station at SAS - DevOps for Fusion with Version Control and Continu...
Migration Station at SAS - DevOps for Fusion with Version Control and Continu...Lucidworks
 
Swift configurator installation-manual
Swift configurator installation-manualSwift configurator installation-manual
Swift configurator installation-manualPramod Sharma
 
Cloud computing 3702
Cloud computing 3702Cloud computing 3702
Cloud computing 3702Jess Coburn
 
Installation Openstack Swift
Installation Openstack SwiftInstallation Openstack Swift
Installation Openstack Swiftymtech
 
MS Cloud Day - Deploying and monitoring windows azure applications
MS Cloud Day - Deploying and monitoring windows azure applicationsMS Cloud Day - Deploying and monitoring windows azure applications
MS Cloud Day - Deploying and monitoring windows azure applicationsSpiffy
 
(ARC402) Deployment Automation: From Developers' Keyboards to End Users' Scre...
(ARC402) Deployment Automation: From Developers' Keyboards to End Users' Scre...(ARC402) Deployment Automation: From Developers' Keyboards to End Users' Scre...
(ARC402) Deployment Automation: From Developers' Keyboards to End Users' Scre...Amazon Web Services
 
FIWARE Tech Summit - Docker Swarm Secrets for Creating Great FIWARE Platforms
FIWARE Tech Summit - Docker Swarm Secrets for Creating Great FIWARE PlatformsFIWARE Tech Summit - Docker Swarm Secrets for Creating Great FIWARE Platforms
FIWARE Tech Summit - Docker Swarm Secrets for Creating Great FIWARE PlatformsFIWARE
 
AWS Application Migration Service-Hands-On Guide
AWS Application Migration Service-Hands-On GuideAWS Application Migration Service-Hands-On Guide
AWS Application Migration Service-Hands-On GuideManas Mondal
 
Docker Swarm secrets for creating great FIWARE platforms
Docker Swarm secrets for creating great FIWARE platformsDocker Swarm secrets for creating great FIWARE platforms
Docker Swarm secrets for creating great FIWARE platformsFederico Michele Facca
 
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...Amazon Web Services
 
How To Configure Nginx Load Balancer on CentOS 7
How To Configure Nginx Load Balancer on CentOS 7How To Configure Nginx Load Balancer on CentOS 7
How To Configure Nginx Load Balancer on CentOS 7VCP Muthukrishna
 
Docker presentasjon java bin
Docker presentasjon java binDocker presentasjon java bin
Docker presentasjon java binOlve Hansen
 
[NYC Meetup] Docker at Nuxeo
[NYC Meetup] Docker at Nuxeo[NYC Meetup] Docker at Nuxeo
[NYC Meetup] Docker at NuxeoNuxeo
 
Mmik_Powershell_DSC_Azure_DSC
Mmik_Powershell_DSC_Azure_DSCMmik_Powershell_DSC_Azure_DSC
Mmik_Powershell_DSC_Azure_DSCMmik Huang
 
Mmik powershell dsc_slideshare_v1
Mmik powershell dsc_slideshare_v1Mmik powershell dsc_slideshare_v1
Mmik powershell dsc_slideshare_v1Mmik Huang
 
Openstack Rally - Benchmark as a Service. Openstack Meetup India. Ananth/Rahul.
Openstack Rally - Benchmark as a Service. Openstack Meetup India. Ananth/Rahul.Openstack Rally - Benchmark as a Service. Openstack Meetup India. Ananth/Rahul.
Openstack Rally - Benchmark as a Service. Openstack Meetup India. Ananth/Rahul.Rahul Krishna Upadhyaya
 

Semelhante a [WSO2] Deployment Synchronizer for Deployment Artifact Synchronization Between the WSO2 Cluster Nodes (20)

Practical solutions for connections administrators
Practical solutions for connections administratorsPractical solutions for connections administrators
Practical solutions for connections administrators
 
The secret life of a dispatcher (Adobe CQ AEM)
The secret life of a dispatcher (Adobe CQ AEM)The secret life of a dispatcher (Adobe CQ AEM)
The secret life of a dispatcher (Adobe CQ AEM)
 
AAI-3218 Production Deployment Best Practices for WebSphere Liberty Profile
AAI-3218 Production Deployment Best Practices for WebSphere Liberty ProfileAAI-3218 Production Deployment Best Practices for WebSphere Liberty Profile
AAI-3218 Production Deployment Best Practices for WebSphere Liberty Profile
 
Sa106 – practical solutions for connections administrators
Sa106 – practical solutions for connections administratorsSa106 – practical solutions for connections administrators
Sa106 – practical solutions for connections administrators
 
Migration Station at SAS - DevOps for Fusion with Version Control and Continu...
Migration Station at SAS - DevOps for Fusion with Version Control and Continu...Migration Station at SAS - DevOps for Fusion with Version Control and Continu...
Migration Station at SAS - DevOps for Fusion with Version Control and Continu...
 
Swift configurator installation-manual
Swift configurator installation-manualSwift configurator installation-manual
Swift configurator installation-manual
 
Cloud computing 3702
Cloud computing 3702Cloud computing 3702
Cloud computing 3702
 
Installation Openstack Swift
Installation Openstack SwiftInstallation Openstack Swift
Installation Openstack Swift
 
MS Cloud Day - Deploying and monitoring windows azure applications
MS Cloud Day - Deploying and monitoring windows azure applicationsMS Cloud Day - Deploying and monitoring windows azure applications
MS Cloud Day - Deploying and monitoring windows azure applications
 
(ARC402) Deployment Automation: From Developers' Keyboards to End Users' Scre...
(ARC402) Deployment Automation: From Developers' Keyboards to End Users' Scre...(ARC402) Deployment Automation: From Developers' Keyboards to End Users' Scre...
(ARC402) Deployment Automation: From Developers' Keyboards to End Users' Scre...
 
FIWARE Tech Summit - Docker Swarm Secrets for Creating Great FIWARE Platforms
FIWARE Tech Summit - Docker Swarm Secrets for Creating Great FIWARE PlatformsFIWARE Tech Summit - Docker Swarm Secrets for Creating Great FIWARE Platforms
FIWARE Tech Summit - Docker Swarm Secrets for Creating Great FIWARE Platforms
 
AWS Application Migration Service-Hands-On Guide
AWS Application Migration Service-Hands-On GuideAWS Application Migration Service-Hands-On Guide
AWS Application Migration Service-Hands-On Guide
 
Docker Swarm secrets for creating great FIWARE platforms
Docker Swarm secrets for creating great FIWARE platformsDocker Swarm secrets for creating great FIWARE platforms
Docker Swarm secrets for creating great FIWARE platforms
 
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...
 
How To Configure Nginx Load Balancer on CentOS 7
How To Configure Nginx Load Balancer on CentOS 7How To Configure Nginx Load Balancer on CentOS 7
How To Configure Nginx Load Balancer on CentOS 7
 
Docker presentasjon java bin
Docker presentasjon java binDocker presentasjon java bin
Docker presentasjon java bin
 
[NYC Meetup] Docker at Nuxeo
[NYC Meetup] Docker at Nuxeo[NYC Meetup] Docker at Nuxeo
[NYC Meetup] Docker at Nuxeo
 
Mmik_Powershell_DSC_Azure_DSC
Mmik_Powershell_DSC_Azure_DSCMmik_Powershell_DSC_Azure_DSC
Mmik_Powershell_DSC_Azure_DSC
 
Mmik powershell dsc_slideshare_v1
Mmik powershell dsc_slideshare_v1Mmik powershell dsc_slideshare_v1
Mmik powershell dsc_slideshare_v1
 
Openstack Rally - Benchmark as a Service. Openstack Meetup India. Ananth/Rahul.
Openstack Rally - Benchmark as a Service. Openstack Meetup India. Ananth/Rahul.Openstack Rally - Benchmark as a Service. Openstack Meetup India. Ananth/Rahul.
Openstack Rally - Benchmark as a Service. Openstack Meetup India. Ananth/Rahul.
 

Mais de Kasun Gajasinghe

Building Services with WSO2 Microservices framework for Java and WSO2 AS
Building Services with WSO2 Microservices framework for Java and WSO2 ASBuilding Services with WSO2 Microservices framework for Java and WSO2 AS
Building Services with WSO2 Microservices framework for Java and WSO2 ASKasun Gajasinghe
 
Distributed caching with java JCache
Distributed caching with java JCacheDistributed caching with java JCache
Distributed caching with java JCacheKasun Gajasinghe
 
Scheduler Activations - Effective Kernel Support for the User-Level Managemen...
Scheduler Activations - Effective Kernel Support for the User-Level Managemen...Scheduler Activations - Effective Kernel Support for the User-Level Managemen...
Scheduler Activations - Effective Kernel Support for the User-Level Managemen...Kasun Gajasinghe
 
Survey on Frequent Pattern Mining on Graph Data - Slides
Survey on Frequent Pattern Mining on Graph Data - SlidesSurvey on Frequent Pattern Mining on Graph Data - Slides
Survey on Frequent Pattern Mining on Graph Data - SlidesKasun Gajasinghe
 
Google Summer of Code 2011 Sinhalese flyer
Google Summer of Code  2011 Sinhalese flyer Google Summer of Code  2011 Sinhalese flyer
Google Summer of Code 2011 Sinhalese flyer Kasun Gajasinghe
 

Mais de Kasun Gajasinghe (6)

Building Services with WSO2 Microservices framework for Java and WSO2 AS
Building Services with WSO2 Microservices framework for Java and WSO2 ASBuilding Services with WSO2 Microservices framework for Java and WSO2 AS
Building Services with WSO2 Microservices framework for Java and WSO2 AS
 
Distributed caching with java JCache
Distributed caching with java JCacheDistributed caching with java JCache
Distributed caching with java JCache
 
Siddhi CEP Engine
Siddhi CEP EngineSiddhi CEP Engine
Siddhi CEP Engine
 
Scheduler Activations - Effective Kernel Support for the User-Level Managemen...
Scheduler Activations - Effective Kernel Support for the User-Level Managemen...Scheduler Activations - Effective Kernel Support for the User-Level Managemen...
Scheduler Activations - Effective Kernel Support for the User-Level Managemen...
 
Survey on Frequent Pattern Mining on Graph Data - Slides
Survey on Frequent Pattern Mining on Graph Data - SlidesSurvey on Frequent Pattern Mining on Graph Data - Slides
Survey on Frequent Pattern Mining on Graph Data - Slides
 
Google Summer of Code 2011 Sinhalese flyer
Google Summer of Code  2011 Sinhalese flyer Google Summer of Code  2011 Sinhalese flyer
Google Summer of Code 2011 Sinhalese flyer
 

[WSO2] Deployment Synchronizer for Deployment Artifact Synchronization Between the WSO2 Cluster Nodes

  • 1. DepSync for Deployment Artifact Synchronization Between the Cluster Nodes Pradeep Fernando Kasun Gajasinghe Senior Software Engineer Software Engineer pradeep@wso2.com kasung@wso2.com
  • 2. Agenda • The need for deployment synchronization • Brief introduction to WSO2 product clusters • Demo - Complete Application server cluster with DepSync + fronted by WSO2 ELB
  • 3. Why Deployment Synchronization? • Artifact distribution and deployment should be transparent to the end-users • Manual artifact copying is acceptable for some extent in standalone product clusters. • Will that work in an elastically scaling cloud environment ??
  • 4. Typical WSO2 Product Cluster • Manager and Worker nodes. • Manager is for administration purposes - artifact upload, applying security,etc • Worker nodes responsible for serving requests. • The setup is only valid for products that support artifact deployment: • Application Server • Enterprise Service Bus • etc
  • 5. Management and Worker Node Separation
  • 6. Why Management & Worker Node Separation Crash Course • Proper separation of concerns - management nodes specialize in management of the setup while worker nodes specialize in serving requests to deployment artifacts • Only management nodes are authorized to add new artifacts into the system or make configuration changes • Worker nodes can only deploy artifacts & read configuration • Lower memory foot in the worker nodes because the management console related OSGi bundles are not loaded • Improved security - management nodes can be behind the internal firewall & be exposed to clients running within the organization only, while worker nodes can be exposed to external clients.
  • 7. Deployment Synchronization • Distributing deployment artifacts & related metadata to all nodes in a homogeneous cluster is a typical requirement for a clustered deployment of any middleware platform • Provides a consistent, and reliable cluster • Automated synchronization without need of any user interaction • Artifact Metadata contains service policies, and other important service configuration details
  • 8. Deployment Synchronizer • WSO2 products provides this through Deployment Synchronizer (DepSync) mechanism • A new feature addition to WSO2 products • Synchronization done using a central repository, usually, a SVN server • We call it SVN-based Deployment Synchronizer • Extensible - may be a Git based one in the future.
  • 10. What it synchronizes? • Web Applications • JAXWS / JAXRS Applications • Proxy Services • Data Services • BPEL • Basically all the deployable artifacts in axis2 repo of Carbon products (ex. repository/deployment/server) • Service Metadata – (details on policies, transports etc.)
  • 11. Enabling DepSync : Carbon.xml DepSync Configuration <DeploymentSynchronizer> <Enabled>true</Enabled> <AutoCommit>true|false</AutoCommit> <AutoCheckout>true</AutoCheckout> <RepositoryType>svn</RepositoryType> <SvnUrl>https://10.100.3.115/svn/repos/as</SvnUrl> <SvnUser>wso2</SvnUser> <SvnPassword>wso2123</SvnPassword> <SvnUrlAppendTenantId>true</SvnUrlAppendTenantId> </DeploymentSynchronizer> ex. local-file system based SvnUrl - file:///C:/demo/svnrepo
  • 12. Multicast vs. WKA Multicast • Cluster is going to be set up in a network where multicasting is allowed Well-Known Address • Cloud based deployment • Members are distributed across datacenters & regions • Multicasting blocked
  • 13. DepSync and Multi-Tenancy • DepSync synchronizes the artifacts among the product cluster in a tenant aware manner. • Ghost deployment is supported in the depsync aware manner in order reduce the initial deployment and request serving latencies.
  • 14. Configuring a minimal WSO2 cluster setup w/ Deployment Synchronization DEMONSTRATION
  • 16. Process 1. Set up the Environment for Deployment Synchronizer 2. Configure Load Balancer 3. Configure Management Node - Application Server 4. Configure Worker Node - Application Server
  • 17. PART 1 Set up the Environment for Deployment Synchronizer
  • 18. Set up the Environment for Deployment Synchronizer • We will setup the SVN-based DepSync • For this, you need the following o svnkit osgi bundle o TortoiseSVN / Silk SVN (Windows), Subversion command line package(Unix) -optional
  • 19. Set up the Environment for Deployment Synchronizer • Download svnkit bundle from here - http://goo.gl/CVR2F • If you will be using a remote svn location for depsync, you may skip the creation of local svn repository. • To create a local svn repository, o if you have svn command line client, enter following command. svnadmin create C:demosvnrepo o if you are using TortoiseSVN, then first create a folder at any place you like. Say - C://demo/svnrepo . Now go in to that folder, right-click -> TortoiseSVN -> "Create Repsitory here" o Now, the SVN URL for this location is - file:///C:/demo/svnrepo
  • 20. Set up the Environment for Deployment Synchronizer • We will use this svn url when configuring the manager and worker nodes. So, remember the location where you created this. DepSync config will also be configured there.
  • 21. Enabling DepSync : Carbon.xml DepSync Configuration <DeploymentSynchronizer> <Enabled>true</Enabled> <AutoCommit>true|false</AutoCommit> <AutoCheckout>true</AutoCheckout> <RepositoryType>svn</RepositoryType> <SvnUrl>https://10.100.3.115/svn/repos/as</SvnUrl> <SvnUser>wso2</SvnUser> <SvnPassword>wso2123</SvnPassword> <SvnUrlAppendTenantId>true</SvnUrlAppendTenantId> </DeploymentSynchronizer> ex. local-file system based SvnUrl - file:///C:/demo/svnrepo
  • 23. Configure Load Balancer - Loadbalancer.conf • Download and extract wso2elb-2.0.0.zip o Let the extracted directory be WSO2_LB_HOME • Open loadbalancer.conf file in the WSO2_LB_HOME/repository/conf
  • 24. Configure Load Balancer • Configuring the WSO2 Elastic Load Balancer is now complete • To start the server o Go to the WSO2_LB_HOME/bin folder using command line o Enter the command `wso2server.bat` o Notice the logs printed by TribesClusteringAgent
  • 25. PART 3 Configure Management Node - Application Server
  • 26. Configure Management Node • Download and extract wso2as-5.0.0.zip o Rename extracted directory to wso2as-5.0.0-manager o Let the extracted directory be WSO2_AS_MGR_HOME
  • 27. Configure Management Node - axis2.xml • Enable clustering at axis2 level. <clustering class="org.apache.axis2.clustering.tribes.TribesClusteringAgent" enable="true"> • Change the membershipScheme of clustering to wka (well- known address) <parameter name="membershipScheme">wka</parameter> • Set the cluster domain. This must be the same which we defined in loadbalancer.conf <parameter name="domain">wso2.as.domain</parameter>
  • 28. Configure Management Node - axis2.xml • Set localMemberHost <parameter name="localMemberHost">mgt.appserver.wso2.com</parameter> • Set localMemberPort <parameter name="localMemberPort">4250</parameter> • Add a new property named "subDomain"and set it to 'mgt' inside the parameter "properties" <parameter name="properties"> <property name="backendServerURL" value="https://${hostName}:${httpsPort}/services/"/> <property name="mgtConsoleURL" value="https://${hostName}:${httpsPort}/"/> <property name="subDomain" value="mgt"/> </parameter>
  • 29. • Add load balancer as a well-known member. o Use the IP/hostname and port defined in LB's axis2.xml <members> <member> <hostName>127.0.0.1</hostName> <port>4000</port> </member> </members>
  • 30. Configure Management Node – catalina-server.xml • Since the mgt node is fronted by an LB, we need to configure proxy ports associated with HTTP and HTTPS connecters. o Defaults for http and https are 8280 and 8243 respectively. <Connector protocol="org.apache.coyote.http11.Http11NioProtocol" port="9763" proxyPort="8280“ --- <Connector protocol="org.apache.coyote.http11.Http11NioProtocol" port="9443“ proxyPort="8243“ ---
  • 31. Configure Management Node – carbon.xml • Set port offset to avoid port conflicts with other nodes (LB). <Offset>1</Offset> • Update mgtHostName and HostName elements in carbon.xml as shown below <HostName>appserver.wso2.com</HostName><MgtHostName>mgt.appserver .wso2.com</MgtHostName> • Copy svnkit bundle to repository/components/dropins
  • 32. Configure Management Node - Deployment Synchronizer • The deployment synchronizer config is in carbon.xml. • Uncomment the DeploymentSynchronizer xml segment. • Set AutoCommit to true. • Set the SVNUrl • No need to set username/password if you didn't set it for local svn repo <DeploymentSynchronizer> <Enabled>true</Enabled> <AutoCommit>true</AutoCommit> <AutoCheckout>true</AutoCheckout> <RepositoryType>svn</RepositoryType> <SvnUrl>file:///C:/webinar-setup/demo/final/svnrepo</SvnUrl> <SvnUser>username</SvnUser> <SvnPassword>password</SvnPassword> <SvnUrlAppendTenantId>true</SvnUrlAppendTenantId> </DeploymentSynchronizer>
  • 33. Configure Management Node • Configuring the WSO2 Application Server is now complete • To start the server o Go to the WSO2_AS_MGR_HOME/bin folder using command line o Enter the command `wso2server.bat` o Notice the logs printed by TribesClusteringAgent and corresponding cluster joining logs in load balancer. • You can now login to management console via https://mgt.appserver.wso2.com:8243/carbon/ • Notice that requests we sent to services (including WSDL) will be directed to worker nodes.
  • 34.
  • 35. PART 4 Configure Worker Node - Application Server
  • 36. Configure Worker Node • We can use a copy of a management node, and convert it to a worker node easily since it will have most of the settings • So, instead of using a fresh appserver copy, make a copy of the management node we just created • Rename the new folder as wso2as-5.0.0-worker • Let this directory be WSO2_AS_WORKER_HOME
  • 37. Configure Worker Node - axis2.xml • In addition to the settings we already have, do the following. • Set the localMemberPort to 4251 <parameter name="localMemberPort">4251</parameter> • This node belongs to the "worker"subDomain, so, change the property "subDomain" to worker (instead of mgt) <parameter name="properties"> <property name="backendServerURL" value="https://${hostName}:${httpsPort}/services/"/> <property name="mgtConsoleURL" value="https://${hostName}:${httpsPort}/"/> <property name="subDomain" value="worker"/> </parameter>
  • 38. Configure Worker Node – carbon.xml • First set a new port offset <Offset>2</Offset> • Comment out/remove the mgtHostName configuration • Set the AutoCommit property inside Deployment Synchronizer to false. This MUST be done because the worker nodes of a cluster should NOT commit (write) artifacts <DeploymentSynchronizer> <Enabled>true</Enabled> <AutoCommit>false</AutoCommit> <AutoCheckout>true</AutoCheckout> <RepositoryType>svn</RepositoryType> <SvnUrl>file:///C:/webinar-setup/demo/final/svnrepo</SvnUrl> <SvnUser>username</SvnUser> <SvnPassword>password</SvnPassword> <SvnUrlAppendTenantId>true</SvnUrlAppendTenantId> </DeploymentSynchronizer>
  • 39. Configure Worker Node – carbon.xml • • Now, it's time to start the server. o NOTE: The workerNode system property must be set when starting the worker nodes every time. wso2server.bat -DworkerNode=true
  • 40. Testing the cluster There are many ways to test our cluster deployment. Let's follow a simpler path. • Log in to the management console of Application Server management node • Deploy a new Axis2 Web service (Go to Manage --> Axis2 Services --> Add --> AAR service) • Once the service is deployed in the management node go to the services list and click on Tryit • Invoke the service