---
title: "一台电脑上运行JBoss多个实例"
author: "steeven"
date: "2010-04-17T21:18:41Z"
tags: []
categories: ["编程语言"]
slug: "jboss"
draft: false
lastmod: "2010-04-17T21:18:41Z"
id: 646427
url: "https://steeven.iteye.com/blog/646427"
---

参见: http://community.jboss.org/wiki/ConfiguringMultipleJBossInstancesOnOnemachine

一般为了测试目的, 会用多个实例. 很简单. 给电脑添加多个IP, 然后把server复制成多份就搞定. jboss的绑定IP工作很到位.

在Solaris10下面操作如下:
ifconfig bge0:2 plumb
ifconfig bge0:2 192.168.0.10 up
ifconfig bge0:3 plumb
ifconfig bge0:3 192.168.0.11 up
./run.sh -c node1 -b 192.168.0.10 -Djboss.messaging.ServerPeerID=1
./run.sh -c node2 -b 192.168.0.11 -Djboss.messaging.ServerPeerID=2

注意JBoss5.1里面的JMS cluster必须指定这个PeerID参数.