本文重点:WLST导航和定位MBean

 
 

  1. MBean切换图

    如上:红色的字体表示切换的命令。ls和cd是在当前树下切换,其他命令是在不同树之间切换。

    其中:

  • DomainMBeanServer有三种状态:
    • 运行domainConfig() 进入到DomainMBean中。
    • 运行domainRuntime() 进入到Domain-RuntimeMBean中。
    • 运行domainCustom() 进入到Domain-CustomMBean中。(自定义MBean,需要先挂载)
  • EditMBeanServer只有一种状态:
    • 运行edit() 进入到DomainMBean中。
  • RuntimeMBeanServer也有三种状态:
    • 运行serverConfig() 进入到DomainMBean中。
    • 运行serverRuntime() 进入到Server-RuntimeMBean中。
    • 运行Custom() 进入到custom() 中。(自定义MBean,需要先挂载)
  • 如果在管理服务器上,那么RuntimeMBeanServer和DomainMBeanServer的数据是相同的。
  1. 各模式下切换。
    1. 首先要启动管理服务器,然后启动wlst.sh脚本。

[root@wls1 ~]# /opt/weblogic/wlserver_10.3/common/bin/wlst.sh

 
 

CLASSPATH=/opt/weblogic/patch_wls1036/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/opt/weblogic/patch_ocp371/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/opt/jdk1.8.0_144/lib/tools.jar:/opt/weblogic/wlserver_10.3/server/lib/weblogic_sp.jar:/opt/weblogic/wlserver_10.3/server/lib/weblogic.jar:/opt/weblogic/modules/features/weblogic.server.modules_10.3.6.0.jar:/opt/weblogic/wlserver_10.3/server/lib/webservices.jar:/opt/weblogic/modules/org.apache.ant_1.7.1/lib/ant-all.jar:/opt/weblogic/modules/net.sf.antcontrib_1.1.0.0_1-0b2/lib/ant-contrib.jar::/opt/weblogic/utils/config/10.3/config-launch.jar::/opt/weblogic/wlserver_10.3/common/derby/lib/derbynet.jar:/opt/weblogic/wlserver_10.3/common/derby/lib/derbyclient.jar:/opt/weblogic/wlserver_10.3/common/derby/lib/derbytools.jar::

Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=128m; support was removed in 8.0

 
 

Initializing WebLogic Scripting Tool (WLST) ...

 
 

Welcome to WebLogic Server Administration Scripting Shell

 
 

Type help() for help on available commands

 
 

wls:/offline> connect() # 连接

Please enter your username :weblogic # 帐号

Please enter your password : # 密码

Please enter your server URL [t3://localhost:7001] : # 连接的地址

Connecting to t3://localhost:7001 with userid weblogic ...

Successfully connected to Admin Server 'AdminServer' that belongs to domain 'base_domains'.

 
 

Warning: An insecure protocol was used to connect to the

server. To ensure on-the-wire security, the SSL port or

Admin port should be used instead.

 
 

wls:/base_domains/serverConfig>

  1. 连接后,默认进入serverConfig状态

wls:/base_domains/serverConfig>

wls:/base_domains/serverConfig> cmo # 打印当前对象的名字和类型。

[MBeanServerInvocationHandler]com.bea:Name=base_domains,Type=Domain

wls:/base_domains/serverConfig> ls() # 列出MBean的层级结构。

dr-- AdminConsole

dr-- AppDeployments

dr-- BridgeDestinations

dr-- Clusters

dr-- CoherenceClusterSystemResources

..

 
 

-r-- AdminServerName AdminServer

-r-- AdministrationMBeanAuditingEnabled false

-r-- AdministrationPort 9002

-r-- AdministrationPortEnabled false

..

 
 

-r-x freezeCurrentValue Void : String(attributeName)

-r-x isSet Boolean : String(propertyName)

-r-x unSet Void : String(propertyName)

 
 

如上所示:dr--,四个标识

第一位:"d" 代表是MBean实例或类型,可以看作是目录,确实如目录一样操作。 "-" 代表是MBean的属性

第二位:"r" 代表可读,"-" 代表不可读。

第三位:"w" 代表可写,"-" 代表不可写。

第四位:"x" 代表执行,"-" 代表不可执行。

 
 

wls:/base_domains/serverConfig> cd('Servers') # 进入到servers

wls:/base_domains/serverConfig/Servers> cmo

[MBeanServerInvocationHandler]com.bea:Name=base_domains,Type=Domain

wls:/base_domains/serverConfig/Servers> ls() # 列出该节点下属性。

dr-- AdminServer

dr-- Server-0

  

  1. 进入domainConfig状态

wls:/base_domains/serverConfig/Servers> domainConfig()

Location changed to serverRuntime tree. This is a read-only tree with DomainMBean as the root.

For more help, use help(domainConfig)

 
 

wls:/base_domains/domainConfig> cmo # 打印当前对象的名字和类型。

[MBeanServerInvocationHandler]com.bea:Name=base_domains,Location=base_domains,Type=Domain

wls:/base_domains/domainConfig> ls() # 该状态下ls()列出的数据和serverConfig状态下的数据大致一样(初步验证)。

dr-- AdminConsole

dr-- AppDeployments

dr-- BridgeDestinations

dr-- Clusters

dr-- CoherenceClusterSystemResources

dr-- CoherenceServers

..

  1. 进入domainRuntime状态

wls:/base_domains/domainConfig> domainRuntime()

Location changed to domainRuntime tree. This is a read-only tree with DomainMBean as the root.

For more help, use help(domainRuntime)

 
 

wls:/base_domains/domainRuntime> cmo

[MBeanServerInvocationHandler]com.bea:Name=base_domains,Type=DomainRuntime

wls:/base_domains/domainRuntime> ls() # ls列出的数据

dr-- AppRuntimeStateRuntime

dr-- CoherenceServerLifeCycleRuntimes

dr-- ConsoleRuntime

dr-- DeployerRuntime

dr-- DeploymentManager

dr-- DomainServices

dr-- LogRuntime

dr-- MessageDrivenControlEJBRuntime

dr-- MigratableServiceCoordinatorRuntime

dr-- MigrationDataRuntimes

dr-- PolicySubjectManagerRuntime

dr-- SNMPAgentRuntime

dr-- ServerLifeCycleRuntimes

dr-- ServerRuntimes

dr-- ServerServices

dr-- ServiceMigrationDataRuntimes

 
 

-r-- ActivationTime Tue Jan 30 22:36:28 CST 2018

-r-- MigrationDataRuntimes null

-r-- Name base_domains

-rw- Parent null

-r-- ServiceMigrationDataRuntimes null

-r-- Type DomainRuntime

 
 

-r-x preDeregister Void :

-r-x restartSystemResource Void : WebLogicMBean(weblogic.management.configuration.SystemResourceMBean)

  1. 进入serverRuntime状态

wls:/base_domains/domainRuntime> serverRuntime()

Location changed to serverRuntime tree. This is a read-only tree with ServerRuntimeMBean as the root.

For more help, use help(serverRuntime)

 
 

wls:/base_domains/serverRuntime> cmo

[MBeanServerInvocationHandler]com.bea:Name=AdminServer,Type=ServerRuntime

wls:/base_domains/serverRuntime> ls() # 注意,和domainRuntime的数据并不相同

dr-- ApplicationRuntimes

dr-- AsyncReplicationRuntime

dr-- ClusterRuntime

dr-- ConnectorServiceRuntime

dr-- DefaultExecuteQueueRuntime

dr-- EntityCacheCumulativeRuntime

dr-- EntityCacheCurrentStateRuntime

dr-- EntityCacheHistoricalRuntime

..

-r-- SocketsOpenedTotalCount 1

-r-- State RUNNING

-r-- StateVal 2

-r-- Type ServerRuntime

-r-- WANReplicationRuntime null

-r-- WLECConnectionServiceRuntime null

-r-- WeblogicHome /opt/weblogic/wlserver_10.3

-r-- WeblogicVersion WebLogic Server 10.3.6.0 Tue Nov 15 08:52:36 PST 2011 1441050

-r-- WseeClusterFrontEndRuntime null

 
 

-r-x addRequestClassRuntime Boolean : WebLogicMBean(weblogic.management.runtime.RequestClassRuntimeMBean)

-r-x forceShutdown Void :

-r-x forceSuspend Void :

-r-x getIPv4URL String : String(protocol)

-r-x getIPv6URL String : String(protocol)

-r-x getServerChannel java.net.InetSocketAddress : String(protocol)

-r-x getURL String : String(protocol)

-r-x preDeregister Void :

-r-x restartSSLChannels Void :

-r-x resume Void :

-r-x shutdown Void :

-r-x shutdown Void : Integer(timeout),Boolean(ignoreSessions)

-r-x start Void :

-r-x suspend Void :

-r-x suspend Void : Integer(timeout),Boolean(ignoreSessions)

  1. 进入domainCustom()状态

wls:/base_domains/domainRuntime> domainCustom()

Location changed to domain custom tree. This is a writable tree with No root. # 这棵树可写,但是没有存根

For more help, use help(domainCustom)

 
 

wls:/base_domains/domainCustom> cmo

'No Stub Available' # 没有存根

wls:/base_domains/domainCustom> ls()

drw- JMImplementation

drw- com.sun.management

drw- java.lang

drw- java.nio

drw- java.util.logging

  1. 进入custom()状态

wls:/base_domains/domainCustom> custom()

Location changed to custom tree. This is a writable tree with No root.

For more help, use help(custom)

 
 

wls:/base_domains/custom> cmo

'No Stub Available'

wls:/base_domains/custom> ls()

drw- JMImplementation

drw- com.sun.management

drw- java.lang

drw- java.nio

drw- java.util.logging

  1. 进入edit()状态

wls:/base_domains/custom> edit() # 这是一个编辑树,可写;使用domainMBean做为根,如果要进行更改,需要startEdit()编辑会话。

Location changed to edit tree. This is a writable tree with

DomainMBean as the root. To make changes you will need to start

an edit session via startEdit().

 
 

For more help, use help(edit)

You already have an edit session in progress and hence WLST will

continue with your edit session.

 
 

wls:/base_domains/edit !> cmo # 进入的是domainMBean中

[MBeanServerInvocationHandler]com.bea:Name=base_domains,Type=Domain

wls:/base_domains/edit !> ls()

dr-- AdminConsole

dr-- AppDeployments

dr-- BridgeDestinations

dr-- Clusters

dr-- CoherenceClusterSystemResources

  1. 高级操作
    1. 获取属性值

wls:/base_domains/edit !> serverConfig()

 
 

wls:/base_domains/serverConfig> cd('Servers')

wls:/base_domains/serverConfig/Servers> ls()

dr-- AdminServer

dr-- Server-0

 
 

wls:/base_domains/serverConfig/Servers> cd('Server-0')

wls:/base_domains/serverConfig/Servers/Server-0> cmo.getXMLEntityCache() # 该值因为为空

wls:/base_domains/serverConfig/Servers/Server-0> cmo.getVirtualMachineName()

'base_domains_Server-0'

wls:/base_domains/serverConfig/Servers/Server-0> get('VirtualMachineName') # 另一种方式获取值

'base_domains_Server-0'

wls:/base_domains/serverConfig/Servers/Server-0/WebServer> cd('..') # 返回根目录

wls:/base_domains/serverConfig/Servers/Server-0> cd('/') # 返回父目录

wls:/base_domains/serverConfig> find('VirtualMachineName') # 可以使用find命令查找

Finding 'VirtualMachineName' in all registered MBean instances ...

/Servers/AdminServer VirtualMachineName base_domains_AdminServer

/Servers/Server-0 VirtualMachineName base_domains_Server-0

wls:/base_domains/serverConfig> bean1 = getMBean('/Servers/AdminServer')

wls:/base_domains/serverConfig> bean1

[MBeanServerInvocationHandler]com.bea:Name=AdminServer,Type=Server

wls:/base_domains/serverConfig> bean1.getVirtualMachineName()

'base_domains_AdminServer'

  1. 受管服务器上只有RuntimeMBeanServer

     
     

03-13_WLST导航和定位MBean的更多相关文章

  1. ROS探索总结(十五)——amcl(导航与定位)

    在理解了move_base的基础上,我们开始机器人的定位与导航.gmaping包是用来生成地图的,需要使用实际的机器人获取激光或者深度数据,所以我们先在已有的地图上进行导航与定位的仿真. amcl是移 ...

  2. Android高效率编码-第三方SDK详解系列(一)——百度地图,绘制,覆盖物,导航,定位,细腻分解!

    Android高效率编码-第三方SDK详解系列(一)--百度地图,绘制,覆盖物,导航,定位,细腻分解! 这是一个系列,但是我也不确定具体会更新多少期,最近很忙,主要还是效率的问题,所以一些有效的东西还 ...

  3. ROS探索总结(十三)——导航与定位框架

    导航与定位是机器人研究中的重要部分.         一般机器人在陌生的环境下需要使用激光传感器(或者深度传感器转换成激光数据),先进行地图建模,然后在根据建立的地图进行导航.定位.在ROS中也有很多 ...

  4. Flutter实战视频-移动电商-03.底部导航栏制作

    03.底部导航栏制作 material是谷歌退出的 还有另外的一种:cupertino是IOS的风格 我们底部的导航栏,静态的widget是不合适的,这垃圾我们用到动态的widget 这重新改成动态的 ...

  5. js实现导航固定定位

                                                                                   js实现导航固定定位 <!DOCTY ...

  6. Javascript实现页面滚动时导航智能定位

    遇到的问题: 在做官网的时候,需要滚动定位的区块的图片不确定,无法确定用户浏览区域对应的模块导航 之前的解决方案是: 通过定位滚动条的位置来判断用户浏览区域对应的模块导航,这种方法的弊端是,区块的高度 ...

  7. jQuery实现页面导航内容定位效果,并支持内容切换

    需求 页面向下滚动时,需要将顶部的搜索栏信息和导航菜单吸顶,并且,搜索栏信息和导航菜单之间可以切换. 效果 https://www.iguopin.com/index.php?m=&c=ind ...

  8. Android百度地图开发03之地图控制 + 定位

    前两篇关于百度地图的blog写的是,一些基本图层的展示 和 覆盖物的添加+地理编码和反地理编码. 接下来,这篇blog主要说一些关于地图控制方面的内容和定位功能. 百度地图提供的关于地图的操作主要有: ...

  9. pc端监听屏幕实现导航固定定位

    要点:占位符 js,监听屏幕滚动事件,当滚动条距离浏览器顶部的距离 大于 要固定定位开始以下元素的距离,则给要固定元素添加fixed样式. 初始化方法时,要给占位符添加样式 function sort ...

随机推荐

  1. 【转】php结合redis实现高并发下的抢购、秒杀功能

    抢购.秒杀是如今很常见的一个应用场景,主要需要解决的问题有两个:1 高并发对数据库产生的压力2 竞争状态下如何解决库存的正确减少("超卖"问题)对于第一个问题,已经很容易想到用缓存 ...

  2. CountDownLatch 和 CyclicBarrier 的基本使用

    CountDownLatch 和 CyclicBarrier 是并发编程中常用的辅助类,两者使用上有点类似,但又有不同. 一.CountDownLatch CountDownLatch 可是实现类似计 ...

  3. easyui combobox下拉列表的多选值

    html: <input id="cc" class="easyui-combobox" value="" data-options= ...

  4. 新手易犯的典型缺陷--C#

    这段时间花了点时间整理了几个新手易犯的典型缺陷(专门针对C#的),但是个人的力量毕竟有限缺陷的覆盖面比较窄,有些缺陷的描述也不够准确,这里先贴出来看看能不能集思广益,收集整理出更多的典型缺陷.目标就是 ...

  5. Python机器学习笔记:不得不了解的机器学习面试知识点(1)

    机器学习岗位的面试中通常会对一些常见的机器学习算法和思想进行提问,在平时的学习过程中可能对算法的理论,注意点,区别会有一定的认识,但是这些知识可能不系统,在回答的时候未必能在短时间内答出自己的认识,因 ...

  6. Linux 安装 JDK

    本篇博客用于记录一下在 Linux 系统下安装 Java 环境. 在大部分的 Linux 系统中都有安装 Open JDK,所以最好是先卸载 Open JDK 后在进行我们的 JDK 安装.Open ...

  7. Redis之集群环境搭建

    前面文章介绍了Redis的主从复制,虽然该模式能够在一定程度上提高系统的稳定性,但是在数据访问量比较大的情况下,单个master应付起来还是比较吃力的,这时我们可以考虑将redis集群部署,本文就来重 ...

  8. NLog日志框架使用探究-1

    目录 前言 为什么是NLog? 目的 配置 基本配置 日志等级 输出例子 目标 参数 规则 日志分发 日志收集 结语 参考文档 前言 日志是每个程序的基本模块.本文是为了探究如何通过NLog方便及记录 ...

  9. ZooKeeper 分布式锁

    在Redis分布式锁一文中, 作者介绍了如何使用Redis开发分布式锁. Redis分布式锁具有轻量高吞吐量的特点,但是一致性保证较弱.我们可以使用Zookeeper开发分布式锁,来满足对高一致性的要 ...

  10. [JZOJ5987] 仙人掌毒题

    Description Solution 套路题... 全他娘的是套路... 首先如何处理仙人掌,可以在线拿 \(lct\) 维护,或者离线之后树剖.(\(lct\) 维护太毒了写不来,就离线树剖了又 ...