Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagebash
$ cd /etc/apach2/sites-available
$ sudo a2enmod headers proxy_balancer proxy_http proxy lbmethod_byrequests slotmem_shm    ## 모듈 활성화
$ vi dcbitbucket.twoseed.co.kr.conf    ## 원하는 이름으로 .conf 파일 생성
---------------------------
<VirtualHost *:80>
  ServerName dcbitbucket.twoseed.co.kr
  Header add Set-Cookie "ROUTEID=.%{BALANCER_WORKER_ROUTE}e; path=/" env=BALANCER_ROUTE_CHANGED

  <Proxy balancer://bitbucketcluster>
     BalancerMember http://14.36***.***.48.220:6990 route=node1
     BalancerMember http://175.197***.***.124.236:6990 route=node2
  </Proxy>

  ProxyPass / balancer://bitbucketcluster/ lbmethod=byrequests stickysession=ROUTEID
  ProxyPreserveHost On
</VirtualHost>
----------------------------
$ sudo a2ensite dcbitbucket.twoseed.co.kr.conf     ## 사이트 활성화
$ sudo service apache2 reload     ## apach 서버 다시 시작

...

    • Application Title, Base URL, License key 입력

    • Bitbucket Internal Admin 계정 생성

      Internal Admin 계정이므로 정보 입력 후 “Go to Bitbucket” 버튼 클릭

  • 공유폴더 설정

    • Bitbucket 인스턴스 종료

      Code Block
      languagebash
      $ cd /opt/datacenter/atlassian/bitbucket/bin/
      $ ./stop-bitbucket.sh
    • Home 디렉토리의 shared 폴더를 NFS 로 복사

      Code Block
      languagebash
      $ cd /home/datacenter/atlassian/bitbucket/
      $ mv shared /home/share/atlassian/bitbucket/
      $ ln -sf /home/share/atlassian/bitbucket/shared shared

  • Node 설정

    • Node 이름 설정

      Code Block
      languagebash
      $ cd /opt/datacenter/atlassian/bitbucket/bin/
      $ vi _start-webapp.sh
      ---------------------------
      ...
      JVM_SUPPORT_RECOMMENDED_ARGS="-Dcluster.node.name=node1"
      ...
      ---------------------------
    • bitbucket.properties 파일에 Node 관련 설정 추가

      Code Block
      languagebash
      $ cd /home/share/atlassian/bitbucket/shared
      $ vi bitbucket.properties
      --------------------------
      # Use multicast to discover cluster nodes (recommended).
      hazelcast.network.multicast=false
      
      # If your network does not support multicast, you may uncomment the following lines and substitute
      # the IP addresses of some or all of your cluster nodes. (Not all of the cluster nodes have to be
      # listed here but at least one of them has to be active when a new node joins.)
      hazelcast.network.tcpip=true
      hazelcast.network.tcpip.members=14.36***.***.48.220:5703,175.197***.***.124.236:5701
      
      # The following should uniquely identify your cluster on the LAN.
      hazelcast.group.name=Twoseed-cluster
      hazelcast.group.password=Twoseed-cluster
      --------------------------

...

  • Remote Elasticsearch 설정

    Code Block
    languagebash
    $ cd /home/share/atlassian/bitbucket/shared
    $ vi bitbucket.properties
    --------------------------
    plugin.search.elasticsearch.baseurl=http://14.36***.***.48.220:6991/   ## Elasticsearch URL
    plugin.search.elasticsearch.username=twoseed   ## buckler.yml에 지정한 username
    plugin.search.elasticsearch.password=admin   ## buckler.yml에 지정한 password
    --------------------------

  • Install, Home directory 백업 및 node2에 복사

    Code Block
    $ cd /opt/datacenter/atlassian
    $ tar cvfz bitbucket_install.tgz bitbucket/
    $ cd /home/datacenter/atlassian
    $ tar cvfz bitbucket_home.tgz bitbucket/

  • Bitbucket 인스턴스 시작

    Code Block
    $ cd /opt/datacenter/atlassian/bitbucket/bin/
    $ ./start-bitbucket.sh --no-search   ## 번들 Elasticsearch가 실행되지 않도록 옵션 추가

...