简体   繁体   中英

Adding values to server start arguments oracle weblogic

Oracle has suggested to add few parameters to server start arguments which we are adding at Managed server -> configuration -> server start -> Arguments.

Now i need to make this changes in more than 100 domains with 4 managed servers each. I would like to know is there a way to add this in backend at server level so that i shall automate it with scripts. already there are few values under this, i am just appending the below values. can someone throw some light here? below are the values i am trying to add.

-Doracle.jdbc.ReadTimeout=600000 -Dweblogic.Chunksize=65535 -Dweblogic.jndi.responseReadTimeout=120000 -Dweblogic.jndi.connectTimeout=120000 -Dweblogic.UseEnhancedIncrementAdvisor=false

The correct mode is to use WLST .

WLST is the tool offered by Weblogic to script Domain configurations. In this way, you could save the configurations on an svc and you can automate this operation.

To add a start parameter to servers or to a cluster you have to write a.py file with the instructions and then launch it with the wlst console.

File example:

# JVM PARAMETER MANAGED SERVER
server_jvm_parameters = [{
    "cluster_name": "CLUSTER_NAME",
    "arguments": " -Doracle.jdbc.ReadTimeout=600000 -Dweblogic.Chunksize=65535 -Dweblogic.jndi.responseReadTimeout=120000 -Dweblogic.jndi.connectTimeout=120000 -Dweblogic.UseEnhancedIncrementAdvisor=false"                                                  
  }

def config_jvm_start_parameters(server_jvm_parameters):
  print "config_start_parameters " + str(server_jvm_parameters)
  for current in server_jvm_parameters:
    cluster_name = current['cluster_name']
    arguments = current['arguments']
    managed_servers = current.get('servers', None)

    print 'init configuration start parameters ' + cluster_name

    cluster_bean_path = getPath('com.bea:Name=' + cluster_name + ',Type=Cluster');
    cluster = getMBean('/'+cluster_bean_path); 
    servers = cluster.getServers();  
    for server in servers:
      server_name = server.getName()  
      cmo=cd('/Servers/'+server_name+'/ServerStart/'+server_name)
      argsSetted = False

      if (managed_servers is not None):
        for managed_server in managed_servers:
          managed_server_name = managed_server['managed_name']
          managed_server_arg = managed_server['arguments']
          if (managed_server_name == server_name):
            argsSetted = True
            cmo.setArguments(arguments +  ' ' + managed_server_arg)

      if (not argsSetted):
        cmo.setArguments(arguments)


connect(user, password, host)
edit()
startEdit()
config_jvm_start_parameters(server_jvm_parameters)
save()
activate()

And then run the command:

$ORACLE_MIDDLEWARE_HOME/oracle_common/common/bin/wlst.sh file.py

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM