ActiveMq工作笔记002---Centos7.3安装ActiveMq

技术交流QQ群【JAVA,.NET,BigData,AI】:170933152

很简单,先安装jdk,然后下载,解压,启动,访问ok

下载:

[root@localhost usr]# wget http://archive.apache.org/dist/activemq/5.14.5/apache-activemq-5.14.5-bin.tar.gz
--2019-03-29 21:45:50--  http://archive.apache.org/dist/activemq/5.14.5/apache-activemq-5.14.5-bin.tar.gz
Resolving archive.apache.org (archive.apache.org)... 163.172.17.199
Connecting to archive.apache.org (archive.apache.org)|163.172.17.199|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://59.80.44.98/archive.apache.org/dist/activemq/5.14.5/apache-activemq-5.14.5-bin.tar.gz [following]
--2019-03-29 21:45:50--  http://59.80.44.98/archive.apache.org/dist/activemq/5.14.5/apache-activemq-5.14.5-bin.tar.gz
Connecting to 59.80.44.98:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 54294367 (52M) [application/x-gzip]
Saving to: ‘apache-activemq-5.14.5-bin.tar.gz’

100%[=========================================================================================================================================>] 54,294,367  2.56MB/s   in 25s    

[root@localhost usr]# mv apache-activemq-5.14.5-bin.tar.gz /opt
[root@localhost opt]# cp apache-activemq-5.14.5-bin.tar.gz /usr/activemq

解压

[root@localhost activemq]# tar zxvf apache-activemq-5.14.5-bin.tar.gz 

重新命名,看着舒服: 

[root@localhost activemq]# mv apache-activemq-5.14.5 activemq

进入bin目录启动:

[root@localhost activemq]# cd activemq/
[root@localhost activemq]# ll
total 15888
-rwxr-xr-x 1 root root 16211254 Apr 11  2017 activemq-all-5.14.5.jar
drwxr-xr-x 5 root root      147 Mar 29 21:49 bin
drwxr-xr-x 2 root root     4096 Mar 29 21:49 conf
drwxr-xr-x 2 root root       26 Mar 29 21:49 data
drwxr-xr-x 2 root root       76 Mar 29 21:49 docs
drwxr-xr-x 7 root root       71 Apr 11  2017 examples
drwxr-xr-x 6 root root     4096 Mar 29 21:49 lib
-rw-r--r-- 1 root root    40580 Apr 11  2017 LICENSE
-rw-r--r-- 1 root root     3334 Apr 11  2017 NOTICE
-rw-r--r-- 1 root root     2610 Apr 11  2017 README.txt
drwxr-xr-x 6 root root       95 Mar 29 21:49 webapps
drwxr-xr-x 3 root root       18 Mar 29 21:49 webapps-demo

 启动吧:

[root@localhost bin]# ./activemq start
INFO: Loading '/usr/activemq/activemq//bin/env'
INFO: Using java '/lib/jvm/bin/java'
INFO: Starting - inspect logfiles specified in logging.properties and log4j.properties to get details
INFO: pidfile created : '/usr/activemq/activemq//data/activemq.pid' (pid '1447')
[root@localhost bin]# ps -ef|grep activemq
root       1447      1 86 23:02 pts/0    00:00:12 /lib/jvm/bin/java -Xms64M -Xmx1G -Djava.util.logging.config.file=logging.properties -Djava.security.auth.login.config=/usr/activemq/activemq//conf/login.config -Dcom.sun.management.jmxremote -Djava.awt.headless=true -Djava.io.tmpdir=/usr/activemq/activemq//tmp -Dactivemq.classpath=/usr/activemq/activemq//conf:/usr/activemq/activemq//../lib/: -Dactivemq.home=/usr/activemq/activemq/ -Dactivemq.base=/usr/activemq/activemq/ -Dactivemq.conf=/usr/activemq/activemq//conf -Dactivemq.data=/usr/activemq/activemq//data -jar /usr/activemq/activemq//bin/activemq.jar start
root       1490   1312  0 23:02 pts/0    00:00:00 grep --color=auto activemq
[root@localhost bin]# http://192.168.0.110:8161/admin/

浏览器测试:

http://192.168.136.110:8161/admin/

然后,admin admin 用户名密码

就进去了。

如果有防火墙的话,关闭一下防火墙,或者设置防火墙规则:

防火墙的设置添加8161和61616端口号:

firewall-cmd --zone=public --add-port=8161/tcp --permanent (--permanent永久生效,没有此参数重启后失效)

重新载入 firewall-cmd --reload

查看端口是否设置成功:firewall-cmd --zone=public --list-ports

9、最后验证结果输入http://ip地址:8161/admin   用户名:admin 密码:admin

 

主意防火墙,一定要关闭或者配置规则要不然,嗝屁...

1、firewalld的基本使用

启动: systemctl start firewalld

关闭: systemctl stop firewalld

查看状态: systemctl status firewalld 

开机禁用  : systemctl disable firewalld

开机启用  : systemctl enable firewalld

 

 

2.systemctl是CentOS7的服务管理工具中主要的工具,它融合之前service和chkconfig的功能于一体。

启动一个服务:systemctl start firewalld.service
关闭一个服务:systemctl stop firewalld.service
重启一个服务:systemctl restart firewalld.service
显示一个服务的状态:systemctl status firewalld.service
在开机时启用一个服务:systemctl enable firewalld.service
在开机时禁用一个服务:systemctl disable firewalld.service
查看服务是否开机启动:systemctl is-enabled firewalld.service
查看已启动的服务列表:systemctl list-unit-files|grep enabled
查看启动失败的服务列表:systemctl --failed

3.配置firewalld-cmd

查看版本: firewall-cmd --version

查看帮助: firewall-cmd --help

显示状态: firewall-cmd --state

查看所有打开的端口: firewall-cmd --zone=public --list-ports

更新防火墙规则: firewall-cmd --reload

查看区域信息:  firewall-cmd --get-active-zones

查看指定接口所属区域: firewall-cmd --get-zone-of-interface=eth0

拒绝所有包:firewall-cmd --panic-on

取消拒绝状态: firewall-cmd --panic-off

查看是否拒绝: firewall-cmd --query-panic

 

那怎么开启一个端口呢

添加

firewall-cmd --zone=public --add-port=80/tcp --permanent    (--permanent永久生效,没有此参数重启后失效)

重新载入

firewall-cmd --reload

查看

firewall-cmd --zone= public --query-port=80/tcp

删除

firewall-cmd --zone= public --remove-port=80/tcp --permanent

 

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

添柴程序猿

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值