ActiveMQ共享存储集群部署

ActiveMQ是什么:ActiveMQ是消息中间件,是一种在分布式系统中应用程序借以传递消息的媒介,主要解决应用耦合,异步消息等
特点:多语言编写,spring支持,多种传输协议,支持AJAX
消息形式:点对点,一对多(发布,订阅)
持久化:默认为文本模式

  • 三台服务器操作
    下载apache-activemq-5.15.4-bin.tar.gz
    tar -zxf apache-activemq-5.15.4-bin.tar.gz
    cp -r apache-activemq-5.15.4 /usr/local/activemq-5.15.4
    cd /usr/local/activemq-5.15.4
    vim conf/activemq.xml
    hostname要写本主机IP
 
           
            
        

查到这一行,三台服务全都修改一样
brokerName="activemqCluster"

  • 所有节点启动
    cd /usr/local/activemq-5.15.4/bin
    ./activemq start #注意查看data目录下的log,如果有异常排错
    进入zookeeper目录,查看MQ是否添加
    cd /usr/local/zookeeper-3.5.3/bin/
    ./zkCli.sh
    ......忽略......
    ...........
    .......
    WatchedEvent state:SyncConnected type:None path:null
    [zk: localhost:2181(CONNECTED) 0] ls /
    [activemq, zookeeper]
    [zk: localhost:2181(CONNECTED) 1] ls /activemq
    [leveldb-stores]
    [zk: localhost:2181(CONNECTED) 2] ls /activemq/leveldb-stores
    [00000000000, 00000000001, 00000000002]
    [zk: localhost:2181(CONNECTED) 3] quit
    2018-11-14 16:48:51,660 [myid:] - INFO [main:ZooKeeper@1326] - Session: 0x10019dfbbd20001 closed
    2018-11-14 16:48:51,660 [myid:] - INFO [main-EventThread:ClientCnxn$EventThread@513] - EventThread shut down for session: 0x10019dfbbd20001
    [root@iZm5e88p52tbinrrlh2piuZ bin]#

你可能感兴趣的:(ActiveMQ共享存储集群部署)