2017-09-26 79 views
0

以下是我在3臺不同機器上設置羣集的步驟。如何在不同的機器1,機器2和機器3上配置熔斷器組中的負載均衡器?

解壓JBoss的保險絲在三個不同的文件夾,使您有以下配置:

- machine1/jboss-fuse-6.3.0.redhat-187 
    - machine2/jboss-fuse-6.3.0.redhat-187 
    - machine3/jboss-fuse-6.3.0.redhat-187 

。編輯etc/org.apache.karaf.management.cfg和更改rmiRegistryPortrmiServerPort,assiging一個唯一的端口:

**#machine1** 

rmiRegistryPort = 1099       
rmiServerPort = 44444       

**#machine2** 

rmiRegistryPort = 1100       
rmiServerPort = 44445       

**#machine3** 

rmiRegistryPort = 1101       
rmiServerPort = 44446 

3.編輯etc/org.apache.karaf.shell.cfg和改變sshPort,assiging一個唯一的端口:

#machine1 
sshPort = 8101 
#machine2 
sshPort = 8102 
#machine3 
sshPort = 8103 

4.編輯等/系統的.properties。更改karaf.name,org.osgi.service.http.port,activemq.port,assiging一個唯一的端口:

#machine1 
karaf.name = root1       
org.osgi.service.http.port=8181      
activemq.port = 61616 

#machine2 
karaf.name = root2       
org.osgi.service.http.port=8182     
activemq.port = 61617 

#machine3 
karaf.name = root3       
org.osgi.service.http.port=8183      
activemq.port = 61618 

5.啓動目錄root1集裝箱

./fuse 

6.並創建面料:

JBossFuse:[email protected]> fabric:create --new-user administrator --new-user-password password --new-user-role Administrator --zookeeper-password ZooPass1 --resolver manualip --manual-ip 192.168.1.9 --wait-for-provisioning 

Above is My root1 machine1 IP Address : 192.168.1.9 

7.現在,啓動根-2集裝箱和加入面料:

./fuse 
JBossFuse:[email protected]> fabric:join 192.168.1.10:2181 
Ensemble password: ZooPass1 

8.現在,啓動root3容器並加入面料:

./fuse 
JBossFuse:[email protected]> fabric:join 192.168.1.11:2181 
Ensemble password: ZooPass1 

9.運行下面的命令來合奏:

JBossFuse:[email protected]> fabric:ensemble-add root2 root3 
This will change of the zookeeper connection string. 
Are you sure want to proceed(yes/no):yes 

JBossFuse:[email protected]> fabric:ensemble-list 
[id] 
root1 
root2 
root3 

然後,我在所有3個節點上部署了其餘服務,並創建了該配置文件還添加了要求配置文件HTTP GETEWAY for load balancer and HA但是請求並沒有失去throgh機器2和機器3.即使我也無法訪問機器1和機器2 hawtio控制檯按照給每個URL。

192.168.1.10:8182/hawtio/login 
192.168.1.10:8183/hawtio/login 

任何人都可以幫助實現3臺不同機器的集羣環境負載平衡嗎?

回答

2

我會建議 - 不要做任何這些:)如果您使用的是Fabric8,請安裝一個Fuse實例,執行fabric:create,然後使用container-create-ssh --host localhost在同一臺機器上設置其他容器。這將自動處理我懷疑是問題根源的所有港口衝突。 Fabric8使用很多很多端口,並試圖手動修復它們是一件可怕的工作。

+0

我能夠使用創建3個節點在同一臺機器上實現loadbalancer。我關心的是通過3臺不同的機器實現它。你能提供如何配置3臺機器的信息嗎? –

+1

如果以推薦的方式進行操作,那麼容器所在的位置(只要您沒有防火牆等)就不會有任何區別。安裝一個容器。使用container-create-ssh從該容器創建其他人。創建容器以容納HTTP網關,該網關可以是SSH容器或子容器,並添加gateway-http配置文件。而已。當這種情況不能如預期的那樣工作時,通常是因爲網絡基礎設施中存在阻礙容器之間連接的事情,或者整個系統的名稱與IP之間的一致性不足。 –

相關問題