SlideShare une entreprise Scribd logo
1  sur  37
Subversion on-the-fly replication
Do it like the Apache Software Foundation Infrastructure
                          Team
                       Norman Maurer

                     ApacheCon EU 2009
                       March 27, 2009
Norman Maurer
     Member of the Apache Software Foundation
 

     Apache Software Foundation Infrastructure Team
 

     PMC Apache JAMES
 

     Senior Unix System Engineer
 




                                   norman@apache.org
                                   norman.maurer@heagmedianet.de
                                   http://www.heagmedianet.com
                                   http://myblog.kicks-ass.org


                                                                   2
Subversion – The
Opensource Version
  Control System
 Keep track of your sourcecode




                                 3
What are the benefits of using Subversion


      Opensource
  



      Runs many OS
  



      Flexible plugin mechanism via hooks
  



      Very good integration with IDEs
  



      Many users / Well tested
  




                                            4
Replication
 Replicate Repositories on
as many servers as you like




                              5
Benefits when using Subversion
replication

       Copy of the data on more than one server
   



       Eliminate single point of failure
   



       Share load across servers
   



       Repositories on many different GEO locations
   



       Works with the usual load balancers in front
   



       READ / WRITE possible
   



                                                      6
Drawbacks of using Subversion
replication

       When the primary node fails, no commits are
   

       possible, but read-only still works ;)

       Big commits can take some time to replay to
   

       slaves

       Importing dumps will mean the slaves become
   

       out of sync!

       More servers to maintain
   




                                                     7
How it works – The concept
 Replication

                                         Commit
                            Subversion
               svn commit                 pass-
                            Slave
                                         through


 Users                                                     Subversion
                                                           Master
               svn update       Replay
                               changes

                                  svn commit                  svn update




                                                   Users
                                                                           8
Putting stuff together
  Installing all the needed bits




                                   9
Installation of Apache HTTP

       Ubuntu / Debian
   

       # apt-get install apache2

       Freebsd
   

       # portinstall apache22

       Others
   

       Check if there are prebuilt packages / build it on your
       own!
       Make sure you compile apache2 with mod_proxy
       support included.



                                                                 10
Installation of Subversion and
Apache HTTP module
       Ubuntu / Debian
   

       # apt-get install subversion libapache2-svn

       Freebsd
   

       # portinstall -m “-DMOD_DAV_SVN“ subversion

       Others
   

       Check if there are prebuilt packages / build it yourself
       from source




                                                                  11
Create the Subversion Repository

       Create Parent Directory
   

       # mkdir /path/to/repos-parent
       # chown $wwwuser:$wwwgroup -R /path/to/repos-parent
       # chmod 770 -R /path/to/repos-parent

       Create Repository
   

       # su $wwwuser -c 'svnadmin create /path/to/repository'




                                                                12
Setup the Master
Version-Control for all your data




                                    13
Configuration of Apache HTTP on the Master

       Setup Apache HTTPD config
   


                                                          Make sure
       # /path/to/apache/httpd.conf
       LoadModule dav_svn_module modules/mod_dav_svn.so
                                                          Subversion
       .......
                                                          module is loaded
       <Location /repos>
                                                          on startup
                DAV svn
                SVNPath /path/to/repos
                AuthName quot;SVN Reposquot;
                                                          Subversion
                AuthType Basic
                                                          Repository
                AuthBasicProvider file
                AuthUserFile /path/to/auth-file
                Require valid-user
       </Location>




                                                                         14
Setup the Slave
Mirror of your Main Subversion Repository




                                            15
Configuration of Apache HTTPD on the Slave

       Modify Apache HTTPD config
   


       # /path/to/apache/httpd.conf
                                                          Make sure
       LoadModule dav_svn_module modules/mod_dav_svn.so
                                                          Subversion
       .......
       <Location /repos>
                                                          module is loaded
                DAV svn
                                                          on startup
                SVNPath /path/to/repos
                SVNMasterURI http://<MASTER>/repos
                AuthName quot;SVN Reposquot;
                AuthType Basic
                                                          Subversion Master
                AuthBasicProvider file
                                                          Repository
                AuthUserFile /path/to/auth-file
                Require valid-user
       </Location>
       <Location /repos/proxy-sync>
                DAV svn
                                                          Subversion Sync
                SVNPath /path/to/repos
                Order deny,allow
                                                          Location
                Deny from all
                Allow from <MASTER>
       </Location>

                                                                            16
Add Subversion hooks

      Add hook on Slave
  


      #/!bin/sh
      #/path/to/repos/hooks/pre-revprop-change
                                                                 Limit revprop
      USER=$3
                                                                 changes to the
      if [ quot;$USERquot; != quot;svnsyncquot; ]; then
                                                                 svnsync user
          echo >&2 quot;Only the svnsync user is allowed to change
      revpropsquot;
          exit 1
      fi

      exit 0




                                                                              17
Set the correct permissions and group

       Make sure the hooks are owned by the right
   

       group
       slave# chgrp $wwwgroup /path/to/repos/hooks/pre-
       revprop-change

       Get sure the hooks are executable
   

       slave# chmod 750 /path/to/repos/hooks/pre-revprop-
       change




                                                            18
Final steps
Last steps to complete replication




                                     19
Init the Slave Repository

       Init the Slave Repository to set properties
   

       master# svnsync --source-username=svnsync --sync-
       username=svnsync init http://<SLAVE>/repos
       http://<MASTER>/repos

       Check if this was successful
   

       master# svn propget svn:sync-from-url --revprop -r 0
       http://<SLAVE>/repos

                                             This should return
                                             the url to the master
                                             repository

                                                                     20
First replication to the Slave Repository

       First sync should probably be started in a
   

       “screen“ session, because it will take some time
       master# screen

       Start the initial sync by hand
   

       master# svnsync --source-username=svnsync --sync-
       username=svnsync sync http://<SLAVE>/repos



                                            Sync started!


                                                            21
Add Subversion hooks to the Master for
on-the-fly replication
       Add hooks needed for replication
   

       #/!bin/sh
                                                               Sync revprop
       #/path/to/repos/hooks/post-revprop-change
                                                               changes to Slave via
       REV=$2
       /path/to/svnsync --source-username=svnsync --sync-
                                                               svnsync
       username=svnsync http://<SLAVE>/repos/proxy-sync $REV
       2>>/var/log/svnsynclog &


       #!/bin/sh                                               Sync commits to
       #/path/to/repos/hooks/post-commit
                                                               Slave via svnsync
       /path/to/svnsync --source-username=svnsync --sync-
       username=svnsync sync http://<SLAVE>/repos/proxy-sync
       2>>/var/log/svnsynclog &




                                                                               22
Set the correct permissions and group

       Make sure the hooks are owned by the right
   

       group
       master# chgrp $wwwgroup /path/to/repos/hooks/post-
       revprop-change
       master# chgrp $wwwgroup /path/to/repos/hooks/post-
       commit

       Get sure the hooks are executable
   

       master# chmod 750 /path/to/repos/hooks/post-revprop-
       change
       master# chmod 750 /path/to/repos/hooks/post-commit



                                                              23
Subversion Replication in
        Production
Our setup within the Apache Software Foundation




                                                  24
Details about the setup – Part I

       Master / Slave
   

       OS:                   FreeBSD-7.0
       Filesystem:           ZFS (raidz2)
       Repository Size:      ~65GB
       Apache HTTPD:         2.2.11
       Subversion:           1.5.5

       Master
   

                             3500000 – 4500000
       Hits/day:
       SVN-Operations/day:   200000 - 250000

       Slave
   

                             70000 – 130000
       Hits/day:
       SVN-Operations/day:   9000 - 90000

                                                 25
Details about the setup – Part II

       Different GEO Locations
   

       Master:                   US (OSUOSL)
       Slave:                    EU (SARA)




                                               26
Known problems
Problems we saw at Apache Software Foundation




                                                27
Problems with file locking – Part I

       File locking will not work well enough with
   

       svnsync
       Use this locking utility written by Joe Schaefer




                                               See „Useful
                                               resources“ for
                                               download link




                                                                28
Problems with file locking – Part II

       Svnsync died but the lock file is still present
   

       Delete lock file and wait for the resync
                                                 Make sure
       master# ps aux | grep svnsync             svnsync is
                                                 not running
       master# svn proplist --
       username=$syncuser --revprop -r0
       http://$slave/repos/proxy-sync/ | grep
                                                 Check for
       svn:sync-lock
                                                 lock
       master# svn propdel svn:sync-lock --
       username=$syncuser --revprop -r0
       http://$slave/repos/proxy-sync/
                                                 Delete
                                                 the lock      29
Out-of-sync on big commits / imports

       Commit to slave server is not possible due to
   

       the out-of-sync of revisions
       Nothing can really help here, but here are
       some suggestions:
             Schedule big imports to low-traffic time
         

             Notify your users about the “downtime“ if
         

             neccessary
             Poke the Subversion Development Team to
         

             better handle such situations in the next
             release=P



                                                         30
Other useful stuff
Random stuff you maybe find useful, just as we
                   did!




                                                 31
Monitoring

       Monitor the sync-state of your repositories with
   

       Nagios
       Send notification if the repositories are out-of-
       sync!
       SVN=/usr/bin/svn
       GREP=/bin/grep
       CUT=/usr/bin/cut
       MASTER_SVN=$1
       SLACK=10
                                                         See „Useful
       SLAVE_ERROR=
                                                         resources“ for
       # check if needed args are given
                                                         download link
       if [ $# -gt 1 ]
       then
           # get the revision of the master repos
           MASTER_REV=`$SVN info $MASTER_SVN | grep -i
       ^revision | cut -f2 -d ' '`
       .....

                                                                          32
Useful resources

       Apache HTTPD
   
       http://httpd.apache.org


       Subversion
   
       http://subversion.tigris.org



       Better Locking script
   
       http://people.apache.org/~norman/talks/setlock.pl


       Nagios monitoring script
   
       http://people.apache.org/~norman/talks/check_svn_replication.sh



                                                                         33
Questions at all?




                    34
Some last words....
     Listen carefully




                        35
Some last words...

 Please use the closest Subversion Server to help
 us..

       lower the load on svn.apache.org
   

       split the bandwidth
   

       improve our setup
   




                                                    36
Thank you for your attention!




                                37

Contenu connexe

Tendances

[대전AI포럼] 위성영상 분석 기술 개발 현황 소개
[대전AI포럼] 위성영상 분석 기술 개발 현황 소개[대전AI포럼] 위성영상 분석 기술 개발 현황 소개
[대전AI포럼] 위성영상 분석 기술 개발 현황 소개
Taegyun Jeon
 
Nginx internals
Nginx internalsNginx internals
Nginx internals
liqiang xu
 

Tendances (20)

PRISMACLOUD Cloud Security and Privacy by Design
PRISMACLOUD Cloud Security and Privacy by DesignPRISMACLOUD Cloud Security and Privacy by Design
PRISMACLOUD Cloud Security and Privacy by Design
 
Introduction to Nginx
Introduction to NginxIntroduction to Nginx
Introduction to Nginx
 
서버 성능에 대한 정의와 이해
서버 성능에 대한 정의와 이해서버 성능에 대한 정의와 이해
서버 성능에 대한 정의와 이해
 
Docker Swarm for Beginner
Docker Swarm for BeginnerDocker Swarm for Beginner
Docker Swarm for Beginner
 
VMware Cloud on AWS -- A Technical Deep Dive PPT
VMware Cloud on AWS -- A Technical Deep Dive PPTVMware Cloud on AWS -- A Technical Deep Dive PPT
VMware Cloud on AWS -- A Technical Deep Dive PPT
 
[대전AI포럼] 위성영상 분석 기술 개발 현황 소개
[대전AI포럼] 위성영상 분석 기술 개발 현황 소개[대전AI포럼] 위성영상 분석 기술 개발 현황 소개
[대전AI포럼] 위성영상 분석 기술 개발 현황 소개
 
Introduction to Amazon Web Services - How to Scale your Next Idea on AWS : A ...
Introduction to Amazon Web Services - How to Scale your Next Idea on AWS : A ...Introduction to Amazon Web Services - How to Scale your Next Idea on AWS : A ...
Introduction to Amazon Web Services - How to Scale your Next Idea on AWS : A ...
 
마이크로서비스 기반 클라우드 아키텍처 구성 모범 사례 - 윤석찬 (AWS 테크에반젤리스트)
마이크로서비스 기반 클라우드 아키텍처 구성 모범 사례 - 윤석찬 (AWS 테크에반젤리스트) 마이크로서비스 기반 클라우드 아키텍처 구성 모범 사례 - 윤석찬 (AWS 테크에반젤리스트)
마이크로서비스 기반 클라우드 아키텍처 구성 모범 사례 - 윤석찬 (AWS 테크에반젤리스트)
 
VMware Tanzu Introduction
VMware Tanzu IntroductionVMware Tanzu Introduction
VMware Tanzu Introduction
 
SRE Conference 2022 - How to Build a Healthy On-Call Culture
SRE Conference 2022 - How to Build a Healthy On-Call CultureSRE Conference 2022 - How to Build a Healthy On-Call Culture
SRE Conference 2022 - How to Build a Healthy On-Call Culture
 
Reactive programming with examples
Reactive programming with examplesReactive programming with examples
Reactive programming with examples
 
웹서버 부하테스트 실전 노하우
웹서버 부하테스트 실전 노하우웹서버 부하테스트 실전 노하우
웹서버 부하테스트 실전 노하우
 
Redis cluster
Redis clusterRedis cluster
Redis cluster
 
Nginx internals
Nginx internalsNginx internals
Nginx internals
 
分布式Key Value Store漫谈
分布式Key Value Store漫谈分布式Key Value Store漫谈
分布式Key Value Store漫谈
 
영속성 컨텍스트로 보는 JPA
영속성 컨텍스트로 보는 JPA영속성 컨텍스트로 보는 JPA
영속성 컨텍스트로 보는 JPA
 
Serverless
ServerlessServerless
Serverless
 
잘 키운 모노리스 하나 열 마이크로서비스 안 부럽다
잘 키운 모노리스 하나 열 마이크로서비스 안 부럽다잘 키운 모노리스 하나 열 마이크로서비스 안 부럽다
잘 키운 모노리스 하나 열 마이크로서비스 안 부럽다
 
실시간 이상탐지를 위한 머신러닝 모델에 Druid _ Imply 활용하기
실시간 이상탐지를 위한 머신러닝 모델에 Druid _ Imply 활용하기실시간 이상탐지를 위한 머신러닝 모델에 Druid _ Imply 활용하기
실시간 이상탐지를 위한 머신러닝 모델에 Druid _ Imply 활용하기
 
Pegasus In Depth (2018/10)
Pegasus In Depth (2018/10)Pegasus In Depth (2018/10)
Pegasus In Depth (2018/10)
 

En vedette

new-product-development-process
new-product-development-processnew-product-development-process
new-product-development-process
arunalapati
 
High Availability != High-cost
High Availability != High-costHigh Availability != High-cost
High Availability != High-cost
normanmaurer
 
Zero-Copy Event-Driven Servers with Netty
Zero-Copy Event-Driven Servers with NettyZero-Copy Event-Driven Servers with Netty
Zero-Copy Event-Driven Servers with Netty
Daniel Bimschas
 
structural-packaging-josep-m-garrofe
 structural-packaging-josep-m-garrofe structural-packaging-josep-m-garrofe
structural-packaging-josep-m-garrofe
Anirudh Chaiworaporn
 

En vedette (20)

Netty4
Netty4Netty4
Netty4
 
Saudi Arabia’s National Open Education Strategy, Master Plan & Policy
Saudi Arabia’s National Open Education Strategy, Master Plan & PolicySaudi Arabia’s National Open Education Strategy, Master Plan & Policy
Saudi Arabia’s National Open Education Strategy, Master Plan & Policy
 
time-management-ppt
time-management-ppttime-management-ppt
time-management-ppt
 
new-product-development-process
new-product-development-processnew-product-development-process
new-product-development-process
 
Forrester On Using Subversion to Optimize Globally Distributed Development
Forrester On Using Subversion to Optimize Globally Distributed DevelopmentForrester On Using Subversion to Optimize Globally Distributed Development
Forrester On Using Subversion to Optimize Globally Distributed Development
 
High Availability != High-cost
High Availability != High-costHigh Availability != High-cost
High Availability != High-cost
 
How To Produce A Short Film By Conor Barry SP Films
How To Produce A Short Film By Conor Barry SP FilmsHow To Produce A Short Film By Conor Barry SP Films
How To Produce A Short Film By Conor Barry SP Films
 
M&amp;R Poster P1 Event Manager Website Rajopadhye Mhatre Nimmagadda
M&amp;R Poster P1 Event Manager Website Rajopadhye Mhatre NimmagaddaM&amp;R Poster P1 Event Manager Website Rajopadhye Mhatre Nimmagadda
M&amp;R Poster P1 Event Manager Website Rajopadhye Mhatre Nimmagadda
 
Non blocking io with netty
Non blocking io with nettyNon blocking io with netty
Non blocking io with netty
 
Zero-Copy Event-Driven Servers with Netty
Zero-Copy Event-Driven Servers with NettyZero-Copy Event-Driven Servers with Netty
Zero-Copy Event-Driven Servers with Netty
 
Integrated Marketing Communication
Integrated Marketing Communication Integrated Marketing Communication
Integrated Marketing Communication
 
Checking Progress On Your Lean Journey
Checking Progress On Your Lean JourneyChecking Progress On Your Lean Journey
Checking Progress On Your Lean Journey
 
Action research
Action researchAction research
Action research
 
Subversion User Guide
Subversion User GuideSubversion User Guide
Subversion User Guide
 
Approaching Galleries & Proposal Writing for Artists
Approaching Galleries & Proposal Writing for ArtistsApproaching Galleries & Proposal Writing for Artists
Approaching Galleries & Proposal Writing for Artists
 
セキュリティを重視した本格ビジネスサイトをWordPressで作るためのセミナー
セキュリティを重視した本格ビジネスサイトをWordPressで作るためのセミナーセキュリティを重視した本格ビジネスサイトをWordPressで作るためのセミナー
セキュリティを重視した本格ビジネスサイトをWordPressで作るためのセミナー
 
structural-packaging-josep-m-garrofe
 structural-packaging-josep-m-garrofe structural-packaging-josep-m-garrofe
structural-packaging-josep-m-garrofe
 
visionary leaders
visionary leadersvisionary leaders
visionary leaders
 
SEEA Agriculture Forestry and Fisheries Accounting Tools: Accounting Exercises
SEEA Agriculture Forestry and Fisheries Accounting Tools: Accounting ExercisesSEEA Agriculture Forestry and Fisheries Accounting Tools: Accounting Exercises
SEEA Agriculture Forestry and Fisheries Accounting Tools: Accounting Exercises
 
The 5 dysfunctions of a team Management Presentation
The 5 dysfunctions of a team Management PresentationThe 5 dysfunctions of a team Management Presentation
The 5 dysfunctions of a team Management Presentation
 

Similaire à Subversion on-the-fly replication

Ubuntu安装SVN总结
Ubuntu安装SVN总结Ubuntu安装SVN总结
Ubuntu安装SVN总结
wensheng wei
 
Infrastructure testing with Jenkins, Puppet and Vagrant - Agile Testing Days ...
Infrastructure testing with Jenkins, Puppet and Vagrant - Agile Testing Days ...Infrastructure testing with Jenkins, Puppet and Vagrant - Agile Testing Days ...
Infrastructure testing with Jenkins, Puppet and Vagrant - Agile Testing Days ...
Carlos Sanchez
 
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
Carlos Sanchez
 
From Dev to DevOps - FOSDEM 2012
From Dev to DevOps - FOSDEM 2012From Dev to DevOps - FOSDEM 2012
From Dev to DevOps - FOSDEM 2012
Carlos Sanchez
 
ByPat博客出品Lvs+keepalived
ByPat博客出品Lvs+keepalivedByPat博客出品Lvs+keepalived
ByPat博客出品Lvs+keepalived
redhat9
 
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
 
From Dev to DevOps - Codemotion ES 2012
From Dev to DevOps - Codemotion ES 2012From Dev to DevOps - Codemotion ES 2012
From Dev to DevOps - Codemotion ES 2012
Carlos Sanchez
 
Setting up and open fidy dev environment
Setting up and open fidy dev environmentSetting up and open fidy dev environment
Setting up and open fidy dev environment
ianibbo
 

Similaire à Subversion on-the-fly replication (20)

Ubuntu安装SVN总结
Ubuntu安装SVN总结Ubuntu安装SVN总结
Ubuntu安装SVN总结
 
Infrastructure testing with Jenkins, Puppet and Vagrant - Agile Testing Days ...
Infrastructure testing with Jenkins, Puppet and Vagrant - Agile Testing Days ...Infrastructure testing with Jenkins, Puppet and Vagrant - Agile Testing Days ...
Infrastructure testing with Jenkins, Puppet and Vagrant - Agile Testing Days ...
 
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
 
Control your deployments with Capistrano
Control your deployments with CapistranoControl your deployments with Capistrano
Control your deployments with Capistrano
 
From Dev to DevOps - FOSDEM 2012
From Dev to DevOps - FOSDEM 2012From Dev to DevOps - FOSDEM 2012
From Dev to DevOps - FOSDEM 2012
 
Deploying Symfony | symfony.cat
Deploying Symfony | symfony.catDeploying Symfony | symfony.cat
Deploying Symfony | symfony.cat
 
Usando o Cloud
Usando o CloudUsando o Cloud
Usando o Cloud
 
ByPat博客出品Lvs+keepalived
ByPat博客出品Lvs+keepalivedByPat博客出品Lvs+keepalived
ByPat博客出品Lvs+keepalived
 
Svn Subversion
Svn SubversionSvn Subversion
Svn Subversion
 
Capistrano
CapistranoCapistrano
Capistrano
 
4. open mano set up and usage
4. open mano set up and usage4. open mano set up and usage
4. open mano set up and usage
 
Cooking with Chef
Cooking with ChefCooking with Chef
Cooking with Chef
 
Continuous Delivery: The Next Frontier
Continuous Delivery: The Next FrontierContinuous Delivery: The Next Frontier
Continuous Delivery: The Next Frontier
 
Vagrant introduction for Developers
Vagrant introduction for DevelopersVagrant introduction for Developers
Vagrant introduction for Developers
 
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...
 
Subversionn Introduction at SuperMondays 2009-09-01
Subversionn Introduction at SuperMondays 2009-09-01Subversionn Introduction at SuperMondays 2009-09-01
Subversionn Introduction at SuperMondays 2009-09-01
 
From Dev to DevOps - Codemotion ES 2012
From Dev to DevOps - Codemotion ES 2012From Dev to DevOps - Codemotion ES 2012
From Dev to DevOps - Codemotion ES 2012
 
infra-as-code
infra-as-codeinfra-as-code
infra-as-code
 
Setting up and open fidy dev environment
Setting up and open fidy dev environmentSetting up and open fidy dev environment
Setting up and open fidy dev environment
 
Java Builds with Maven and Ant
Java Builds with Maven and AntJava Builds with Maven and Ant
Java Builds with Maven and Ant
 

Dernier

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Dernier (20)

Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 

Subversion on-the-fly replication

  • 1. Subversion on-the-fly replication Do it like the Apache Software Foundation Infrastructure Team Norman Maurer ApacheCon EU 2009 March 27, 2009
  • 2. Norman Maurer Member of the Apache Software Foundation  Apache Software Foundation Infrastructure Team  PMC Apache JAMES  Senior Unix System Engineer  norman@apache.org norman.maurer@heagmedianet.de http://www.heagmedianet.com http://myblog.kicks-ass.org 2
  • 3. Subversion – The Opensource Version Control System Keep track of your sourcecode 3
  • 4. What are the benefits of using Subversion Opensource  Runs many OS  Flexible plugin mechanism via hooks  Very good integration with IDEs  Many users / Well tested  4
  • 5. Replication Replicate Repositories on as many servers as you like 5
  • 6. Benefits when using Subversion replication Copy of the data on more than one server  Eliminate single point of failure  Share load across servers  Repositories on many different GEO locations  Works with the usual load balancers in front  READ / WRITE possible  6
  • 7. Drawbacks of using Subversion replication When the primary node fails, no commits are  possible, but read-only still works ;) Big commits can take some time to replay to  slaves Importing dumps will mean the slaves become  out of sync! More servers to maintain  7
  • 8. How it works – The concept Replication Commit Subversion svn commit pass- Slave through Users Subversion Master svn update Replay changes svn commit svn update Users 8
  • 9. Putting stuff together Installing all the needed bits 9
  • 10. Installation of Apache HTTP Ubuntu / Debian  # apt-get install apache2 Freebsd  # portinstall apache22 Others  Check if there are prebuilt packages / build it on your own! Make sure you compile apache2 with mod_proxy support included. 10
  • 11. Installation of Subversion and Apache HTTP module Ubuntu / Debian  # apt-get install subversion libapache2-svn Freebsd  # portinstall -m “-DMOD_DAV_SVN“ subversion Others  Check if there are prebuilt packages / build it yourself from source 11
  • 12. Create the Subversion Repository Create Parent Directory  # mkdir /path/to/repos-parent # chown $wwwuser:$wwwgroup -R /path/to/repos-parent # chmod 770 -R /path/to/repos-parent Create Repository  # su $wwwuser -c 'svnadmin create /path/to/repository' 12
  • 13. Setup the Master Version-Control for all your data 13
  • 14. Configuration of Apache HTTP on the Master Setup Apache HTTPD config  Make sure # /path/to/apache/httpd.conf LoadModule dav_svn_module modules/mod_dav_svn.so Subversion ....... module is loaded <Location /repos> on startup DAV svn SVNPath /path/to/repos AuthName quot;SVN Reposquot; Subversion AuthType Basic Repository AuthBasicProvider file AuthUserFile /path/to/auth-file Require valid-user </Location> 14
  • 15. Setup the Slave Mirror of your Main Subversion Repository 15
  • 16. Configuration of Apache HTTPD on the Slave Modify Apache HTTPD config  # /path/to/apache/httpd.conf Make sure LoadModule dav_svn_module modules/mod_dav_svn.so Subversion ....... <Location /repos> module is loaded DAV svn on startup SVNPath /path/to/repos SVNMasterURI http://<MASTER>/repos AuthName quot;SVN Reposquot; AuthType Basic Subversion Master AuthBasicProvider file Repository AuthUserFile /path/to/auth-file Require valid-user </Location> <Location /repos/proxy-sync> DAV svn Subversion Sync SVNPath /path/to/repos Order deny,allow Location Deny from all Allow from <MASTER> </Location> 16
  • 17. Add Subversion hooks Add hook on Slave  #/!bin/sh #/path/to/repos/hooks/pre-revprop-change Limit revprop USER=$3 changes to the if [ quot;$USERquot; != quot;svnsyncquot; ]; then svnsync user echo >&2 quot;Only the svnsync user is allowed to change revpropsquot; exit 1 fi exit 0 17
  • 18. Set the correct permissions and group Make sure the hooks are owned by the right  group slave# chgrp $wwwgroup /path/to/repos/hooks/pre- revprop-change Get sure the hooks are executable  slave# chmod 750 /path/to/repos/hooks/pre-revprop- change 18
  • 19. Final steps Last steps to complete replication 19
  • 20. Init the Slave Repository Init the Slave Repository to set properties  master# svnsync --source-username=svnsync --sync- username=svnsync init http://<SLAVE>/repos http://<MASTER>/repos Check if this was successful  master# svn propget svn:sync-from-url --revprop -r 0 http://<SLAVE>/repos This should return the url to the master repository 20
  • 21. First replication to the Slave Repository First sync should probably be started in a  “screen“ session, because it will take some time master# screen Start the initial sync by hand  master# svnsync --source-username=svnsync --sync- username=svnsync sync http://<SLAVE>/repos Sync started! 21
  • 22. Add Subversion hooks to the Master for on-the-fly replication Add hooks needed for replication  #/!bin/sh Sync revprop #/path/to/repos/hooks/post-revprop-change changes to Slave via REV=$2 /path/to/svnsync --source-username=svnsync --sync- svnsync username=svnsync http://<SLAVE>/repos/proxy-sync $REV 2>>/var/log/svnsynclog & #!/bin/sh Sync commits to #/path/to/repos/hooks/post-commit Slave via svnsync /path/to/svnsync --source-username=svnsync --sync- username=svnsync sync http://<SLAVE>/repos/proxy-sync 2>>/var/log/svnsynclog & 22
  • 23. Set the correct permissions and group Make sure the hooks are owned by the right  group master# chgrp $wwwgroup /path/to/repos/hooks/post- revprop-change master# chgrp $wwwgroup /path/to/repos/hooks/post- commit Get sure the hooks are executable  master# chmod 750 /path/to/repos/hooks/post-revprop- change master# chmod 750 /path/to/repos/hooks/post-commit 23
  • 24. Subversion Replication in Production Our setup within the Apache Software Foundation 24
  • 25. Details about the setup – Part I Master / Slave  OS: FreeBSD-7.0 Filesystem: ZFS (raidz2) Repository Size: ~65GB Apache HTTPD: 2.2.11 Subversion: 1.5.5 Master  3500000 – 4500000 Hits/day: SVN-Operations/day: 200000 - 250000 Slave  70000 – 130000 Hits/day: SVN-Operations/day: 9000 - 90000 25
  • 26. Details about the setup – Part II Different GEO Locations  Master: US (OSUOSL) Slave: EU (SARA) 26
  • 27. Known problems Problems we saw at Apache Software Foundation 27
  • 28. Problems with file locking – Part I File locking will not work well enough with  svnsync Use this locking utility written by Joe Schaefer See „Useful resources“ for download link 28
  • 29. Problems with file locking – Part II Svnsync died but the lock file is still present  Delete lock file and wait for the resync Make sure master# ps aux | grep svnsync svnsync is not running master# svn proplist -- username=$syncuser --revprop -r0 http://$slave/repos/proxy-sync/ | grep Check for svn:sync-lock lock master# svn propdel svn:sync-lock -- username=$syncuser --revprop -r0 http://$slave/repos/proxy-sync/ Delete the lock 29
  • 30. Out-of-sync on big commits / imports Commit to slave server is not possible due to  the out-of-sync of revisions Nothing can really help here, but here are some suggestions: Schedule big imports to low-traffic time  Notify your users about the “downtime“ if  neccessary Poke the Subversion Development Team to  better handle such situations in the next release=P 30
  • 31. Other useful stuff Random stuff you maybe find useful, just as we did! 31
  • 32. Monitoring Monitor the sync-state of your repositories with  Nagios Send notification if the repositories are out-of- sync! SVN=/usr/bin/svn GREP=/bin/grep CUT=/usr/bin/cut MASTER_SVN=$1 SLACK=10 See „Useful SLAVE_ERROR= resources“ for # check if needed args are given download link if [ $# -gt 1 ] then # get the revision of the master repos MASTER_REV=`$SVN info $MASTER_SVN | grep -i ^revision | cut -f2 -d ' '` ..... 32
  • 33. Useful resources Apache HTTPD  http://httpd.apache.org Subversion  http://subversion.tigris.org Better Locking script  http://people.apache.org/~norman/talks/setlock.pl Nagios monitoring script  http://people.apache.org/~norman/talks/check_svn_replication.sh 33
  • 35. Some last words.... Listen carefully 35
  • 36. Some last words... Please use the closest Subversion Server to help us.. lower the load on svn.apache.org  split the bandwidth  improve our setup  36
  • 37. Thank you for your attention! 37