java后端集群化专题

ActiveMq伪集群设置

2018-02-12  本文已影响46人  江江的大猪

自己学习ActiveMq集群化的时候可以使用多台虚拟机模拟真实环境。也可以在单机上使用多个ActiveMq节点,也就是单机多实例的伪集群方式

<broker xmlns="http://activemq.apache.org/schema/core" brokerName="localhost" dataDirectory="${activemq.data}">
     <!--省略-->
    <persistenceAdapter>
        <!-- 不使用kahadb,使用levelDB+zookeeper构建集群-->
        <!--<kahaDB directory="${activemq.data}/kahadb"/>-->
        <replicatedLevelDB
                directory="${activemq.data}/leveldb"
                replicas="3"
                bind="tcp://0.0.0.0:0"
                zkAddress="127.0.0.1:2181,127.0.0.1:2182,127.0.0.1:2183"
                zkPath="/activemq/leveldb-stores"
                hostname="localhost"
                />
    </persistenceAdapter>
    
    <transportConnectors>
        <!-- DOS protection, limit concurrent connections to 1000 and frame size to 100MB -->
        <transportConnector name="openwire"
                            uri="tcp://0.0.0.0:60001?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
        <transportConnector name="amqp"
                            uri="amqp://0.0.0.0:5672?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
        <transportConnector name="stomp"
                            uri="stomp://0.0.0.0:61613?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
        <transportConnector name="mqtt"
                            uri="mqtt://0.0.0.0:1883?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
        <transportConnector name="ws"
                            uri="ws://0.0.0.0:61614?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
    </transportConnectors>

    <plugins>
        <simpleAuthenticationPlugin>
            <users>
                <authenticationUser username="admin" password="admin" groups="users,admins"/>
                <!--<authenticationUser username="user" password="password" groups="users"/>-->
                <!--<authenticationUser username="guest" password="password" groups="guests"/>-->
            </users>
        </simpleAuthenticationPlugin>
    </plugins>
    <!--省略-->
</broker>
<networkConnectors>
    <networkConnector uri="static:(tcp://xxx:xxx,tcp://xxx:xxx,tcp://xxx:xxx)" duplex="false"/>
</networkConnectors>
上一篇下一篇

猜你喜欢

热点阅读