Ubuntu系统部署tomcat并启用JMX实战案例

                            作者:尹正杰

版权声明:原创作品,谢绝转载!否则将追究法律责任。

一.安装JDK环境

1>.更换阿里云的软件源

[root@zabbix_gateway250.yinzhengjie.org.cn ~]# vim /etc/apt/sources.list
[root@zabbix_gateway250.yinzhengjie.org.cn ~]#
[root@zabbix_gateway250.yinzhengjie.org.cn ~]# cat /etc/apt/sources.list
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
[root@zabbix_gateway250.yinzhengjie.org.cn ~]#
[root@zabbix_gateway250.yinzhengjie.org.cn ~]# apt-get update

2>.安装JDK

[root@tomcat250.yinzhengjie.org.cn ~]# apt-get -y install openjdk--jdk

3>.以二进制方式安装JDK

  博主推荐阅读:
    https://www.cnblogs.com/yinzhengjie/p/12199413.html

二.配置tomcat支持JMX功能

1>.基于二进制方式部署tomcat

  博主推荐阅读:
    https://www.cnblogs.com/yinzhengjie/p/12199468.html

2>.自定义tomcat测试首页

[root@tomcat250.yinzhengjie.org.cn ~]# echo "<h1>Jason Yin bolg is [https://www.cnblogs.com/yinzhengjie/].</h1>" > /yinzhengjie/softwares/tomcat/webapps/ROOT/index.html
[root@tomcat250.yinzhengjie.org.cn ~]#
[root@tomcat250.yinzhengjie.org.cn ~]# /yinzhengjie/softwares/tomcat/bin/catalina.sh start

3>.配置tomcat支持JMX功能(/yinzhengjie/softwares/tomcat/bin/catalina.sh)

#Add by yinzhengjie for enable JMX
CATALINA_OPTS="$CATALINA_OPTS -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=12345 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=172.200.5.250" 温馨提示:
  -Dcom.sun.management.jmxremote:
    启用远程监控JMX。
  -Dcom.sun.management.jmxremote.port=:
    默认启动的JMX端口号,要和zabbix添加主机时候的端口一致即可。
  -Dcom.sun.management.jmxremote.authenticate=false :
    不使用用户名密码。
  -Dcom.sun.management.jmxremote.ssl=false:  
    不使用ssl认证。
  -Djava.rmi.server.hostname=172.200.5.250":
    tomcat主机自己的IP地址,不要写zabbix服务器的地址。

4>.重启tomcat并确认tomcat服务

[root@tomcat250.yinzhengjie.org.cn ~]# ss -ntl
State Recv-Q Send-Q Local Address:Port Peer Address:Port
LISTEN 127.0.0.53%lo: 0.0.0.0:*
LISTEN 0.0.0.0: 0.0.0.0:*
LISTEN *: *:*
LISTEN [::]: [::]:*
LISTEN [::ffff:127.0.0.1]: *:*
[root@tomcat250.yinzhengjie.org.cn ~]#
[root@tomcat250.yinzhengjie.org.cn ~]#
[root@tomcat250.yinzhengjie.org.cn ~]# /yinzhengjie/softwares/tomcat/bin/catalina.sh stop
Using CATALINA_BASE: /yinzhengjie/softwares/tomcat
Using CATALINA_HOME: /yinzhengjie/softwares/tomcat
Using CATALINA_TMPDIR: /yinzhengjie/softwares/tomcat/temp
Using JRE_HOME: /usr
Using CLASSPATH: /yinzhengjie/softwares/tomcat/bin/bootstrap.jar:/yinzhengjie/softwares/tomcat/bin/tomcat-juli.jar
[root@tomcat250.yinzhengjie.org.cn ~]#
[root@tomcat250.yinzhengjie.org.cn ~]#
[root@tomcat250.yinzhengjie.org.cn ~]# ss -ntl
State Recv-Q Send-Q Local Address:Port Peer Address:Port
LISTEN 127.0.0.53%lo: 0.0.0.0:*
LISTEN 0.0.0.0: 0.0.0.0:*
LISTEN [::]: [::]:*
[root@tomcat250.yinzhengjie.org.cn ~]#
[root@tomcat250.yinzhengjie.org.cn ~]#

[root@tomcat250.yinzhengjie.org.cn ~]# /yinzhengjie/softwares/tomcat/bin/catalina.sh stop

三.使用JConsole连接tomcat jmx进行测试

1>.window操作系统安装JAVA

  博主推荐阅读:
    https://www.cnblogs.com/yinzhengjie2020/p/12206579.html

2>.如下图所示,运行JConsole并配置tomcat的JMX连接地址及端口,并点击"连接"

3>.点击"不安全的连接"

4>.查看你关心的监控数据

 

Ubuntu系统部署tomcat并启用JMX实战案例的更多相关文章

  1. 基于Ubuntu系统的Tomcat部署项目

    第一步.拿到项目war包 第二步.上传到服务器/var/lib/tomcat8/webapps/ROOT目录下 第三步.使用命令解压war包 jar -xvf star1.0.0.war 第三步.重启 ...

  2. ubuntu系统部署python3.6.4

    Ubuntu的版本为16.04,系统自带的Python版本较低,使用亲本版本3.6.4,下为安装步骤: 一.官网下载Python3.6.4版本 新建目录: sudo mkidr /usr/local/ ...

  3. Ubuntu上部署tomcat后无法访问8080端口问题

    在tomacat的bin目录下,修改startup.sh文件,添加信息: #set java environment export JAVA_HOME=/usr/java/jdk1.8.0_111 e ...

  4. ubuntu系统部署web项目

    1.安装java 下载java安装文件 可至http://www.oracle.com/technetwork/java/javase/downloads/index.html下载最新的JDK版本,当 ...

  5. 使用zabbix server监控tomcat实战案例

    使用zabbix server监控tomcat实战案例 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 大家都知道,zabbix server效率高是使用C语言编写的,有很多应用程序 ...

  6. 高级运维(四):Nginx常见问题处理、安装部署Tomcat服务器、使用Tomcat部署虚拟主机

    一.Nginx常见问题处理 目标: 本案例要求对Nginx服务器进行适当优化,以提升服务器的处理性能: 1> 不显示Nginx软件版本号 2> 如果客户端访问服务器提示“Too many ...

  7. 使用Ubuntu系统编译安装Zabbix企业级监控系统

    使用Ubuntu系统编译安装Zabbix企业级监控系统   作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. Ubuntu系统部署笔记:https://www.cnblogs.com/ ...

  8. Ubuntu部署Tomcat Web服务

    在Ubuntu平台中安装TomCat 本文将为大家介绍TomCat在Ubuntu平台中如何进行部署使用,带你快速入门使用TomCat TomCat简介 Tomcat是Apache 软件基金会(Apac ...

  9. CentOS和Ubuntu系统下安装 HttpFS (助推Hue部署搭建)

    不多说,直接上干货! 我的集群机器情况是 bigdatamaster(192.168.80.10).bigdataslave1(192.168.80.11)和bigdataslave2(192.168 ...

随机推荐

  1. iOS 10.3 以上系统实现应用内评分及开发者回复评论

    在 iOS 10.3 之前,如果你要给一个应用评分,那么你需要打开 App Store,搜索应用,找到评论,点击撰写评论,然后评分.整个评分流程非常繁琐,还要忍受漫长的页面加载,导致很少有用户愿意主动 ...

  2. 【JavaWeb】导入Excel并进行校验

    一.需要实现的目标 1.界面编写 2.导入表读取表名,进行校验,后台匹配(判断此表的名称是否能够模糊匹配上) 3.确定表存在,读取其中的数据,暂存 4.正则表达式数据校验(判断是否已存在,数据是否符合 ...

  3. 「NOI2009」植物大战僵尸

    「NOI2009」植物大战僵尸 传送门 这是一道经典的最大权闭合子图问题,可以用最小割解决(不会的可以先自学一下) 具体来说,对于这道题,我们对于两个位置的植物 \(i\) 和 \(j\) ,如果 \ ...

  4. 【摘录自MDN】客户端和服务器

    客户端和服务器 连接到互联网的计算机被称作客户端和服务器.下面是一个简单描述它们如何交互的图表: 客户端是典型的Web用户入网设备(比如,你连接了Wi-Fi的电脑,或接入移动网络的手机)和设备上可联网 ...

  5. druid监控sql完整版

    利用Druid实现应用和SQL监控 一.关于Druid Druid是一个JDBC组件,它包括三部分: DruidDriver 代理Driver,能够提供基于Filter-Chain模式的插件体系. D ...

  6. 面试官:说说Spring中的事务传播行为

    前言 在开发中,相信大家都使用过Spring的事务管理功能.那么,你是否有了解过,Spring的事务传播行为呢? Spring中,有7种类型的事务传播行为.事务传播行为是Spring框架提供的一种事务 ...

  7. 牛茶冲天的ip命令

    一.修改二层链路相关设置 1.修改网卡名称(修改前要先停止) ip link set eth0 name  testname 2.修改网卡地址 ip link set eth0 address xxx ...

  8. 记录下 k8s (1.14.2)使用kubeadm方式搭建和rancher搭建需要的镜像清单

    kubeadm方式 之前一直用的1.12.2版本的,最近想试一下新的版本1.14.2 当然相应的组件镜像版本也需要更新了.镜像版本如下(网络插件使用flannel) k8s.gcr.io/kube-p ...

  9. 列表推导式、生成器表达式以及zip()max()max()/min()sum()sort()map()filter()的用法

    列表推导式: 基本格式: variable = [out_exp_res for out_exp in input_list if out_exp == 2] #out_exp_res: 列表生成元素 ...

  10. 深浅copy浅析

    Python代码在开始执行的时候,代码会被系统从硬盘调入内存,等候CPU执行,至于怎么个调入逻辑,还不清楚. 在高级语言中,变量是对内存及其地址的抽象.也就是说变量就是内存地址. 那么我们先来介绍两种 ...