2014-10-27 48 views
1

是否可以針對每個EC2彈性實例運行多個Bamboo代理?竹子:每個EC2彈性實例有多個代理?

我們在構建系統中使用Docker,而且這個過程似乎主要是網絡IO綁定。如果我們可以在一臺機器上運行多個代理程序,那將會很不錯。

通過一臺機器上運行多個代理,而不是啓動多臺機器,我們也不需要擔心機器之間的航運碼頭工人圖像作爲文物。

更新2014年10月30日:

我試圖複製當前的啓動腳本並添加一個新的家:

$ cat /opt/bamboo-elastic-agent/bin/bamboo-elastic-agent2 
#!/bin/sh 

bambooAgentBin=$(cd -P -- $(dirname $0) && pwd) 
. $bambooAgentBin/bambooShellFunctions.sh 

echo Starting Elastic Bamboo Agent... 
java -Dbamboo.home=/home/bamboo/bamboo-agent-home-2/ -Dimagefiles.version=3.3-SNAPSHOT -jar $bambooAgentBin/*installer*.jar 2>&1 | tee -a $(getHomeDir)/bamboo-elastic-agent.out 

這似乎是彈性版本建立某種隧道和崩潰因爲隧道已經在運行:

# su -c /opt/bamboo-elastic-agent/bin/bamboo-elastic-agent2 - bamboo & 
[1] 14143 
Starting Elastic Bamboo Agent... 
2014-10-30 08:39:31,804 INFO [main] [S3Sync] Syncing from: bamboo-agent-release-us-e1/5.6-OD-01-0070/cce16404c14f06456c6adc44181746abf8dd1206/ to /opt/bamboo-elastic-agent 
2014-10-30 08:39:31,979 INFO [main] [S3Utils] Syncing s3://bamboo-agent-release-us-e1/5.6-OD-01-0070/cce16404c14f06456c6adc44181746abf8dd1206/ to /opt/bamboo-elastic-agent 
2014-10-30 08:39:31,979 INFO [main] [S3Utils] Fetching the list of remote objects... 
2014-10-30 08:39:33,006 INFO [main] [S3Utils] Found 579 files in s3://bamboo-agent-release-us-e1/5.6-OD-01-0070/cce16404c14f06456c6adc44181746abf8dd1206/ 
2014-10-30 08:39:33,059 INFO [main] [S3Utils] Found 463 files in /opt/bamboo-elastic-agent 
2014-10-30 08:39:33,060 INFO [main] [S3Utils] Generating the list of files to fetch from S3... 
2014-10-30 08:39:33,076 INFO [main] [S3Utils] Generating the list of files to remove... 
2014-10-30 08:39:33,078 INFO [main] [S3Utils] Removing 0 files from /opt/bamboo-elastic-agent 
2014-10-30 08:39:33,079 INFO [main] [S3Utils] Fetching 155 files to /opt/bamboo-elastic-agent 
2014-10-30 08:39:39,969 INFO [main] [S3Utils] Fetched 113 MB from S3 
2014-10-30 08:39:39,973 INFO [main] [ElasticAgentInstaller] Starting [java, -server, -Xms32m, -Xmx256m, -XX:MaxPermSize=128m, -XX:+HeapDumpOnOutOfMemoryError, -Dimagefiles.version=3.3, -Dbamboo.agent.installDir=/opt/bamboo-elastic-agent, -cp, /opt/bamboo-elastic-agent/boot/annotations-13.0.jar:/opt/bamboo-elastic-agent/boot/gson-2.2.2-atlassian-1.jar:/opt/bamboo-elastic-agent/boot/atlassian-bamboo-api-agent-bootstrap-5.6-OD-01-0070.jar:/opt/bamboo-elastic-agent/boot/commons-io-2.4.jar:/opt/bamboo-elastic-agent/boot/jackson-core-2.1.1.jar:/opt/bamboo-elastic-agent/boot/atlassian-bamboo-agent-elastic-shared-5.6-OD-01-0070.jar:/opt/bamboo-elastic-agent/boot/atlassian-tunnel-0.21.jar:/opt/bamboo-elastic-agent/boot/stax-api-1.0-2.jar:/opt/bamboo-elastic-agent/boot/guava-bridge-11.0.2-atlassian-01.jar:/opt/bamboo-elastic-agent/boot/atlassian-bamboo-agent-elastic-5.6-OD-01-0070.jar:/opt/bamboo-elastic-agent/boot/commons-codec-1.8.jar:/opt/bamboo-elastic-agent/boot/atlassian-util-concurrent-2.4.1.jar:/opt/bamboo-elastic-agent/boot/joda-time-2.3.jar:/opt/bamboo-elastic-agent/boot/log4j-1.2.15.jar:/opt/bamboo-elastic-agent/boot/guava-11.0.2-atlassian-01.jar:/opt/bamboo-elastic-agent/boot/atlassian-bamboo-agent-bootstrap-5.6-OD-01-0070.jar:/opt/bamboo-elastic-agent/boot/commons-lang-2.6.jar:/opt/bamboo-elastic-agent/boot/atlassian-aws-1.0.71.jar:/opt/bamboo-elastic-agent/boot/jackson-databind-2.1.1.jar:/opt/bamboo-elastic-agent/boot/fugue-1.1.jar:/opt/bamboo-elastic-agent/boot/aws-java-sdk-1.7.1.jar:/opt/bamboo-elastic-agent/boot/httpclient-4.2.5.jar:/opt/bamboo-elastic-agent/boot/commons-logging-1.0.4.jar:/opt/bamboo-elastic-agent/boot/jackson-annotations-2.1.1.jar:/opt/bamboo-elastic-agent/boot/bcprov-jdk15on-1.48.jar:/opt/bamboo-elastic-agent/boot/atlassian-bamboo-core-agent-bootstrap-5.6-OD-01-0070.jar:/opt/bamboo-elastic-agent/boot/bcpkix-jdk15on-1.48.jar:/opt/bamboo-elastic-agent/boot/atlassian-annotations-0.4.jar:/opt/bamboo-elastic-agent/boot/jsr305-1.3.9.jar:/opt/bamboo-elastic-agent/boot/httpcore-4.2.5.jar:, com.atlassian.bamboo.agent.elastic.client.ElasticAgentBootstrap] 
2014-10-30 08:39:40,119 INFO [main] [ElasticAgentBootstrap] Starting Agent Bootstrap using Java 1.6.0_45 from Sun Microsystems Inc. 
2014-10-30 08:39:40,410 INFO [main] [ElasticAgentBootstrap] Using tunnelling. Setting virtual host name to https://xxxxxxx.atlassian.net/builds/agentServer/ 
2014-10-30 08:39:40,410 INFO [main] [ElasticAgentBootstrap] Using tunnelling for HTTP(S). Registering 'httpt' and 'httpst' protocols. 
2014-10-30 08:39:40,416 INFO [main] [ElasticAgentBootstrap] HTTP(S) tunnel: enabled 
2014-10-30 08:39:40,416 INFO [main] [ElasticAgentBootstrap] JMS tunnel: enabled 
2014-10-30 08:39:40,424 INFO [main] [ElasticAgentBootstrap] Starting tunnel server, waiting for 2 connections. 
2014-10-30 08:39:40,425 FATAL [tunnellogger-thread] [TunnelServer] [com.atlassian.tunnel.tunnel.server.TunnelServer] Fatal error in TunnelServer. 
java.net.BindException: Address already in use 
    at java.net.PlainSocketImpl.socketBind(Native Method) 
    at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:383) 
    at java.net.ServerSocket.bind(ServerSocket.java:328) 
    at java.net.ServerSocket.<init>(ServerSocket.java:194) 
    at java.net.ServerSocket.<init>(ServerSocket.java:150) 
    at javax.net.ssl.SSLServerSocket.<init>(SSLServerSocket.java:84) 
    at com.sun.net.ssl.internal.ssl.SSLServerSocketImpl.<init>(SSLServerSocketImpl.java:81) 
    at com.sun.net.ssl.internal.ssl.SSLServerSocketFactoryImpl.createServerSocket(SSLServerSocketFactoryImpl.java:58) 
    at com.atlassian.tunnel.tunnel.server.TunnelServer.run(TunnelServer.java:54) 
    at java.lang.Thread.run(Thread.java:662) 

任何想法的解決方法?

+0

嘿@konrad你能過來這個問題,並開始第二個代理? – benka 2015-10-02 08:32:50

回答

0

亞馬遜實例是歷史上壞提供I/O能力(我假設你的意思是網絡I/O)兌美元,因爲他們往往需要優化更多的CPU和內存密集型工作負載。您可能會發現在同一個節點上的其他進程可能沒有幫助。

如果您在託管服務器鏡像上安裝了Docker鏡像,並在鏡像安裝後採取snapshot to create an AMI,則可以根據需要啓動任意數量的使用該AMI的ec2實例。他們將預安裝圖像。

您還可以使用CloudFormation和/或雲初始化重新編譯或下載每個EC2實例圖像,而不必擔心手工泊塢窗左右移動圖像。

但是,如果您確實希望在節點上運行多個竹代理程序,您應該也可以長時間運行,因爲您爲每個代理程序實例設置了bamboo.home參數。

java -Dbamboo.home=/agent1Home -jar atlassian-bamboo-agent-installer-X.X-SNAPSHOT.jar \ 
     http://bamboo-host-server:8085/agentServer/ 
java -Dbamboo.home=/agent2Home -jar atlassian-bamboo-agent-installer-X.X-SNAPSHOT.jar \ 
     http://bamboo-host-server:8085/agentServer/ 
+0

感謝您的回覆。在我們的案例中,我們在Bamboo以外的工件(Docker容器)運輸不好(很大)。我們在本地SSD存儲中使用M3 Large實例,因此I/O不是問題。我更新了這個問題,並嘗試了基於你非常有用的竹節點提示,但是我遇到了一個它嘗試設置的隧道的問題。 – konrad 2014-10-30 08:51:32

1

我們(Atlassian的建設工程)已經建立了一套插件在集羣(ECS)是聯機運行基於數字泊塢代理商,建立一個單一的工作,然後退出。它應該能夠完成你所概述的內容。我們最近開源瞭解決方案。

請參閱https://bitbucket.org/atlassian/per-build-container瞭解更多詳情。