RocketMq 在 ubuntu 安装

前端之家收集整理的这篇文章主要介绍了RocketMq 在 ubuntu 安装前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

一、安装

环境:

Linux version ubuntu 16.04
RocketMQ 4.1.0
java 1.8
maven 3.3.9
1,安装java8
$ sudo add-apt-repository ppa:webupd8team/java
$ sudo apt-get update
$ sudo apt-get install oracle-java8-installer
java -version(查看是否安装成功)

sudo update-alternatives --config java (通过这个命令可以看到java安装路径)

sudo vim /etc/environment

文件最后添加上:

JAVA_HOME="/usr/lib/jvm/java-8-oracle"

source /etc/environment
/etc/profile

2,安装maven

sudo apt-get install maven
mvn -version

3,设置mvn 国内镜像

sudo vim /etc/maven/settings.xml

  
  
  1. <mirror>
  2. id>alimaven</>
  3. mirrorOf>centralname>aliyunmavenurl>http://maven.aliyun.com/nexus/content/groups/public/
  4. >ui>HumanReadableNameforthisMirror.>http://uk.maven.org/maven2/
  5. >jboss-public-repository-group>JBossPublicRepositoryGroup>http://repository.jboss.org/nexus/content/groups/public>


4,下载源代码及编译


> git clone -b develop https://github.com/apache/rocketmq.git
  > cd rocketmq
  > mvn -Prelease-all -DskipTests clean install -U
  > cd distribution/target/apache-rocketmq


5,启动 name server

> nohup sh bin/mqnamesrv &
  > tail -f ~/logs/rocketmqlogs/namesrv.log
  The Name Server boot success...

6,启动 broker

> nohup sh bin/mqbroker -n localhost:9876 &
  > tail -f ~/logs/rocketmqlogs/broker.log 
  The broker[%s,172.30.30.233:10911] boot success...

猜你在找的Ubuntu相关文章