zoukankan      html  css  js  c++  java
  • 03-14_WLST配置现有的Domain

    本文重点:

    1. WLST在线模式配置现有的domains。
    2. WLST离线模式配置现有的domains。

       

       

    1WLST在线模式配置现有的domains

    由于和一个活动的domain进行交互,所有的在线更改必须由weblogic变更管理的进程来做控制。

       

    1:wlst脚本创建一个受管服务器

    connect("username", "password", "0.0.0.0:port) # 连接一个运行中的实例

    edit() # 进入可更改的树

    startEdit() # 开启一个start session,获取一个配置锁

    svr = cmo.createServer("managedServer") # 创建一个受管服务器

    svr.setListenPort(8001) # 设置受管服务器端口

    svr.setListenAddress("my-address") # 设置监听地址

    save() # 保存更改,类似控制台中点击保存按钮

    activate(block="true") # 激活所有更改,类似控制台中应用更改按钮,block参数代表是否等待activate操作完成才进入下一步操作,true代表等待。

       

    # get the server mbean to target it

    tBean = getMBean("Servers/managedServer") # 判断是否创建成功

    if tBean != None:

    print "Found our target"

       

    disconnect() # 断开连接

    exit() # 退出脚本

       

    2:修改至生产模式

    wls:/offline> connect('weblogic', '!QAZ2wsx', '127.0.0.1:7001')

    Connecting to t3://127.0.0.1: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> edit()

    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)

       

    wls:/base_domains/edit> startEdit()

    Starting an edit session ...

    Started edit session, please be sure to save and activate your

    changes once you are done.

    wls:/base_domains/edit !> cmo.setProductionModeEnabled(false)

    wls:/base_domains/edit !> activate()

    Activating all your changes, this may take a while ...

    The edit lock associated with this edit session is released

    once the activation is completed.

       

    The following non-dynamic attribute(s) have been changed on MBeans

    that require server re-start:

    MBean Changed : com.bea:Name=AdminServer,Type=WebServerLog,Server=AdminServer,WebServer=AdminServer

    Attributes changed : RotateLogOnStartup

       

    MBean Changed : com.bea:Name=Server-0,Type=WebServerLog,Server=Server-0,WebServer=Server-0

    Attributes changed : RotateLogOnStartup

       

    MBean Changed : com.bea:Name=AdminServer,Type=Log,Server=AdminServer

    Attributes changed : RotateLogOnStartup

       

    MBean Changed : com.bea:Name=AdminServer,Type=DataSourceLogFile,DataSource=AdminServer,Server=AdminServer

    Attributes changed : RotateLogOnStartup

       

    MBean Changed : com.bea:Name=base_domains,Type=Log

    Attributes changed : RotateLogOnStartup

       

    MBean Changed : com.bea:Name=base_domains,Type=Domain

    Attributes changed : ProductionModeEnabled

       

    MBean Changed : com.bea:Name=Server-0,Type=Log,Server=Server-0

    Attributes changed : RotateLogOnStartup

       

    MBean Changed : com.bea:Name=Server-0,Type=DataSourceLogFile,DataSource=Server-0,Server=Server-0

    Attributes changed : RotateLogOnStartup

       

    Activation completed

    wls:/base_domains/edit> exit()

       

       

    Exiting WebLogic Scripting Tool.

    3:跟踪配置更改

    wls:/offline> connect('weblogic', '!QAZ2wsx', '127.0.0.1:7001')

    Connecting to t3://127.0.0.1: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> edit()

    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)

       

    wls:/base_domains/edit> startEdit()

    Starting an edit session ...

    Started edit session, please be sure to save and activate your

    changes once you are done.

    wls:/base_domains/edit !> cmo.createServer('managed2')

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

    wls:/base_domains/edit !> cd('Servers/managed2')

    wls:/base_domains/edit/Servers/managed2 !> cmo.setListenPort(7702)

    wls:/base_domains/edit/Servers/managed2 !> showChanges() # 查看未提交更改

       

    All changes that are made but not yet activated are:

       

    MBean Changed : com.bea:Name=base_domains,Type=Domain

    Operation Invoked : create

    Attribute Modified : Servers

    Attributes Old Value : null

    Attributes New Value : managed2

    Server Restart Required : false

       

       

    MBean Changed : com.bea:Name=managed2,Type=Server

    Operation Invoked : modify

    Attribute Modified : ListenPort

    Attributes Old Value : null

    Attributes New Value : 7702

    Server Restart Required : false

       

    wls:/base_domains/edit/Servers/managed2 !> save()

    Saving all your changes ...

    Saved all your changes successfully.

    wls:/base_domains/edit/Servers/managed2 !> activate()

    Activating all your changes, this may take a while ...

    The edit lock associated with this edit session is released

    once the activation is completed.

    Activation completed

    4:另两个重要的命令undocancelEdit

    undo:可以反转没有保存或者没有激活的更改。

    cancelEdit:直接退出edit(),会反转没有保存或者没有激活的更改,还会释放编辑锁。

       

    更多的属性操作和更改:

    上一节中描述的标准change-management命令是用于调用configurationManagerMBean中操作的便捷命令。 除了这些操作之外,configurationManagerMBean还包含描述编辑会话的属性和操作。

       

    有关详细信息,请参阅Oracle WebLogic Server MBean Reference中的"configurationManagerMBean"

       

    要访问此MBean,请使用WLST getConfigManager命令。

       

    示例中的WLST联机脚本以管理员身份将WLST连接到服务器实例,检查进行更改的当前编辑器是否是特定的运算符,然后取消配置编辑。 该脚本还会清除所有已完成的激活任务。

       

    1. WLST离线模式配置现有的domains(本文略,详见:03-07_创建域自定义模版)

         

  • 相关阅读:
    solidity 学习笔记(5)接口
    solidity 学习笔记(4)library库
    以太坊开发教程(二) 利用truffle发布宠物商店 DAPP 到 以太坊测试环境Ropsten
    以太坊开发教程(一) truffle框架简介/安装/使用
    软分叉/硬分叉/重放攻击/重放保护
    linux安装node.js
    jq获取元素偏移量offset()
    js:把字符串转为变量使用; js下将字符串当函数去执行的方法
    JS中json数组多字段排序方法(解决兼容性问题)(转)
    javascript之取余数、去商、天花板取整、地板取整
  • 原文地址:https://www.cnblogs.com/cishi/p/8395494.html
Copyright © 2011-2022 走看看