uncheck debug mode in Websphere Application Server through script - websphere

i need to uncheck Websphere Aplication Server debug mode through script,I'm WAS 7.0 server running on Windows 2008R2 64bit.

You should run wsadmin in your profile bin directory:
wsadmin.bat -lang jython -user *** -password ***
and in wsadmin promt:
AdminTask.setJVMProperties('[-nodeName node01 -serverName server1 -debugMode false]')
AdminConfig.save()
substituting node and server name, and select true of false.
And you can run this script as a file. Just add this two lines to, e.g. debugOff.py and call it as
wsadmin.bat -lang jython -user *** -password *** -f [real-path-to]/debugOff.py

You can disable debug mode even if Websphere is shut down. Open this file:
/usr/IBM/AppServer/profiles/<my profile>/config/cells/<my cell>/nodes/<my node>/servers/<server>/server.xml
Search for node jvmEntries, attribute debugMode="true" and set it to false. Start Websphere.

Related

How to start the installation of ear on WebSphere?

It is required to install the application on the WebSphere via jython using the AdminApp class.
I delete through the method AdminApp.uninstall
wsadmin.bat -user alex19 -password qwerty19 -c "AdminApp.uninstall('MK.MyApplicaiton')" -lang jython
I want to use the installation method to install the same ear, but I did not succeed using the IBM documentation. Please tell me how to use the wsadmin.bat and AdminApp to install the application?
I get such an error, but the problem is that I do not know how to transfer the file with the properties and the configuration file:
C:\WSAS\bin>wsadmin.bat -user alex19 -password qwerty19 -c "AdminApp.install('C:/ear/my-applicaiton.ear')" -lang jython
WASX7209I: Connected to process "adminagent" on node KSDD using SOAP connector; The type of process is: AdminAgent
WASX7015E: Exception running command: "AdminApp.install('C:/ear/my-applicaiton.ear')"; exception information:
com.ibm.websphere.management.exception.AdminException
javax.management.MBeanException
com.ibm.websphere.management.exception.AdminException
com.ibm.websphere.management.exception.AdminException: ADMA0043E: C:\Users\Administrator\AppData\Local\Temp\app9157482086909190098.ear does not exist for installation.
WASX7209I: Connected to process "adminagent"
You ran wsadmin against an admin agent, which cannot run applications. You should install applications to a deployment manager (ND) or an individual application server (base/standalone application servers)

Stopping/starting an application pool and site on a server

I would like to write a script and run it from my local PC to stop and start an application pool and site that exists on a server.
Value of App Pool and Site - Test
Value of server - SERVER1
Any guidance would be much appreciated.
Run Command Prompt with Administrative rights, and type the following:
C:\Windows\System32\inetsrv\appcmd start apppool /apppool.name:"MYAPPPOOLNAME"
or use the stop command. You could save this in a batch file, but it must be executed with higher privileges.
For the application pool on a remote server, you could use PsExec:
Psexec \\{Computer Name of ISS7 Server} C:\Windows\System32\inetsrv\appcmd recycle apppool my-app-pool

Deploying ear file to IBM WEBSPHERE8 with wsadmin.sh

I am new to Websphere and I found many answers for *.ear file deployment. Most of them use format similar to "
./wsadmin.sh -host vmllkb056933n.myspace.com -port 5000 -c '$AdminApp> install /apps/test-app.ear'
I am always getting errors like:
WASX8011W: AdminTask object is not available. WASX7015E: Exception running command: "$AdminApp install /apps/cdm-fi.ear"; exception
information: com.ibm.ws.scripting.ScriptingException: WASX7206W: The
application management service is not running. Application management
commands will not run.
I am in a RHEL 6 Environment and runing IBM Websphere 8.5.5.3
What is the easiest way to deploy ear file to IBM Websphere 8.5.5
Make sure your are using the deployment manager wsadmin.sh and that the dmgr process is running. Also the port you reference should be the SOAP_CONNECTOR_ADDRESS of the dmgr. Referencing the cluster or server name in a federated environment tells the dmgr where to put the code, as in the two examples below.
$AdminApp install "myapp.ear" {-cluster clusterName}
or
$AdminApp install app_server_root/installableApps/DynaCacheEsi.ear
{-appname MyApp -cell myCell -node myNode -server server1
-filepermission .*\\.jsp=777#.*\\.xml=755}
Don't forget to save and syncnodes. As in the jython below.
AdminConfig.save()
AdminNodeManagement.syncActiveNodes()
Try this.
Syntax :
installApp $earFile $appName $destinationDir $serverName $nodeName $cellName $wasprofile

PostgreSQL pg_ctl register error under Windows 7

Under Windows 7, PostgreSQL 9.3.2, I'm trying to register as a service a second instance of PostgreSQL on the same server, using a different port number and data directory. The 2nd cluster was successfully created with the initdb command, under C:\Program Files\PostgreSQL\9.3\data2.
When I run the following pg_ctl register command from C:\Program Files\PostgreSQL\9.3\bin, I get an error message:
pg_ctl register -N postgresql9.2_2nd_cluster -U "NT AUTHORITY\NetworkService" -D "C:\Program Files\PostgreSQL\9.3\data2" -S auto -o "-p 5431"
pg_ctl: could not open service manager
I googled this, but without much success.
This error:
pg_ctl: could not open service manager
would suggest that you're probably on a UAC-enabled machine, and you're running in a non-admin console.
When you launch your console from Start->Command Prompt, right click on it and choose "Run as Administrator".
Open Command Prompt as admin
Open services (win+R -> services.msc)
If u can see PostgreSQL, then unregister it.
To Unregister the PostgreSQL,
pg-ctl unregister [-N SERVICENAME]
**%path%\PostgreSQL\12\bin\pg_ctl unregister -N "service_name"**
*service name will be displayed on services

wsadmin is taking 10 minutes to connect to Application Server

wsadmin is taking about 10 minutes to connect to the WebSphere Application Server 7.0
i tried this:
C:\WAS_HOME\profiles\PROFILE_NAME\bin>wsadmin -lang jython -user -password -javaoption -Djava.net.preferIPv4Stack=true
but very disappointed to wait to get a session within the shell, for example:
wsadmin>
http://groups.google.com/group/ibm.software.websphere.application-server/browse_thread/thread/2f94111985009e39
http://www-01.ibm.com/support/docview.wss?rs=0&uid=swg21174765
===========
thank you for your feedback Rick!
i tried to get the port number and hostname by using AdminControl.getHost() and AdminControl.getPort() and I was eventually connected to the server despite some delay.
I noticed that I was connected to the server much faster when the hostname and port number were provided in the list of arguments.
Then i tried -conntype none and I was connected to the server almost immediately. do you have any idea why this happens? is there a log file i can take a look to understand the configurations?
=============
Perhaps you can try to specify the host and port when you invoke wsadmin to remove any problems that may come in due to resolving host names?
wsadmin.bat -host xyx -port soap_port
Another debug option is to specify -conntype none. This launches wsadmin without connecting to the DMGR. If that also takes a long time, you have some other problems.
wsadmin.bat -conntype none
Your wsadmin connects that long probably due to DNS issues. Ideally you should resolve the root (DNS) problem, but as a workaround you may try the following.
Save the following Jython script as set_dns_props.py:
for jvm in AdminConfig.list('JavaVirtualMachine').splitlines():
AdminConfig.create('Property', jvm, [ ['name', 'networkaddress.cache.negative.ttl'], ['value', '600'] ])
AdminConfig.create('Property', jvm, [ ['name', 'java.net.preferIPv4Stack'], ['value', 'true'] ])
AdminConfig.create('Property', jvm, [ ['name', 'networkaddress.cache.ttl'], ['value', '-1'] ])
AdminConfig.create('Property', jvm, [ ['name', 'com.ibm.cacheLocalHost'], ['value', 'true'] ])
AdminConfig.save()
then start your wsadmin with:
./wsadmin.sh -lang jython -f set_dns_props.py -user USERNAME - password PASSWORD -host LOCALHOST -port 9999 -javaoption -Djava.net.preferIPv4Stack=true -javaoption -Dnetworkaddress.cache.negative.ttl=600 -javaoption -Dnetworkaddress.cache.ttl=-1 -Dcom.ibm.cacheLocalHost=true
then logon to the AdminConsole, make sure that all nodes are synchronized (assuming WAS ND), and finally restart ALL servers, nodeagents, and the deployment manager.
Afterwards, always use this syntax to start your wsadmin session:
./wsadmin.sh -lang jython -user USERNAME - password PASSWORD -host LOCALHOST -port 9999 -javaoption -Djava.net.preferIPv4Stack=true -javaoption -Dnetworkaddress.cache.negative.ttl=600 -javaoption -Dnetworkaddress.cache.ttl=-1 -Dcom.ibm.cacheLocalHost=true
The above trick configures some DNS & TCP/IP-related properties for server and client JVMs.
Use -conntype NONE option only if you know what you're doing:
In an essence: you get the best value if your server is stopped during your wsadmin session and you only work with the configuration and applications. Using -conntype NONE gives you a chance to apply some configuration even before you start your server for the first time. Really useful when setting up a new environment.
You can't access WAS runtime with -conntype NONE.
If your server is started during such wsadmin (-conntype NONE) session, changes made to WAS configuration are very unlikely to be reflected without server restart. The server just isn't aware that configuration files are being modified.
would it be advisable to use -Djava.net.preferIPv4Stack=true as the value in the argument?
for example
wsadmin -lang jython -user USERNAME - password PASSWORD -host LOCALHOST -port 9999 -javaoption -Djava.net.preferIPv4Stack=true
it still took me quite some time to connect to the applications server

Resources