Deploy EAR file to WAS 7 from command line - deployment

I need to deploy an EAR file that is located in sever A to a WebSphere Server located in server B. I need to know how to deploy the EAR from server A to my WAS through command line. I have seared the web but found results only fro WAS 6 (i have WAS 7).
does any one know how to deploy an EAR to WAS (in a different server) through command line?

I assume both servers are standalone. If so, use WAS_HOME/bin/wsadmin on server A, and specify the RMI host/port for serverB. If not, specify the host/port of the deployment manager for serverB.
wsadmin -host serverB.host.com -port serverBRMIPortNumber -c '$AdminApp install /path/to/localfile.ear {...options...}'
Note, this is UNIX syntax; for Windows syntax, use "double quotes". Alternatively, you can omit the -c and use interactive mode, or you can use -f file.jacl. Jython scripting is available with -lang jython. See the following for AdminApp install options (e.g., -appname or -usedefaultbindings):
http://publib.boulder.ibm.com/infocenter/wasinfo/fep/topic/com.ibm.websphere.nd.multiplatform.doc/info/ae/ae/rxml_taskoptions.html

You should really consider a nodeagent, that would make all of this go away. I'm assuming you're not in a clustered environment, otherwise a simple push to and synch of a nodeagent would do the trick.
The answer above is correct, but you could also simply FTP the package to be deployed to serverB and just use wsadmin to install locally, as well.

Related

How can I copy script from Rundeck server to a brand-new Windows Server

One of the requirements is to keep remote Windows Server intact.
No third party software allowed (no WinSCP, etc).
So we configure Windows Server with WinRM and allow remote access, AllowUnencrypted=true, Auth basic=true, etc...
Then we create job and execute command on Windows server like "ifconfig" successfully.
When it comes to executing inline script or copying file - Rundeck is trying to copy script/file to remote Windows server.
By default:
plugin.script-copy.default.command=get-services
where "get-services" seems to be free-form text rather than executable.
If we want to use SCP or SSH instead, here we have problem -> Windows Server doesn't have WinSCP or SSH or Python installed by default.
Is there any way to copy/deliver script to target/remote Windows Server 2008 using embedded capabilities only (no third-party software allowed) ?
Versions:
Rundeck 2.6.2 running on Linux
Windows Server 2008 R2 Enterprise, Service Pack 1
Thank you.
You can use the WinRM plugin (AKA "Overthere WinRM"), configure it, and use the copy file step on your job workflow (keep in mind that you need the 1.3.4 WinRM plugin at least which support copy file).
You need to download the plugin and put it in Rundeck the libext directory.
Add the Windows resources.xml entry (for "Overthere" WinRM plugin):
<node name="windows" description="Windows node" tags="" hostname="192.168.1.81" osArch="x86" osFamily="windows" osName="Windows 2008R2" osVersion="2008" username="user" winrm-protocol="http" winrm-auth-type="basic" winrm-cmd="CMD" winrm-password-storage-path="keys/winpasswd"/>
Set WinRM as your default node executor / default node file copier, and use the copy file step on your workflow like this.
So, this is important: the WinRM plugin isn't in active development (and Rundeck 2.6 branch is out of support/maintenance), the best way to deal with this is to move to the latest Rundeck version and use the PyWinRM plugin (out of the box with Rundeck, on active development and easiest to configure compared by the old "Overthere" WinRM plugin) and use the copy step as the same way.

Stopping Wildfly Windows Service failed

as mentioned from the title i have a problem stopping the wildfly windows service.
When i tried to stop the wildfly service via the server manager - services window the status of the wildfly service doens't change to stop from stop pending. But wildfly isn't running anymore (my web service is not reachable and also the server log says that wildfly was successfully stopped). to start the service again i have to restart the windows server.
i've tested this with different scenarios:
Windows Server 2008 R2 Datacenter + Wildfly 9
Windwos Server 2012 Datacenter + Wildfly 10
Windows 7 + Wildfly 10
I also tried to make changes in the service.bat like Chris French mentioned on https://developer.jboss.org/thread/238135?tstart=0 but there is no change.
Interessting is that the problem doens't exists on any of the scenarios when i added the service without adding any deployments to wildfly (so just the blank server). What means that i am able to start and stop the wildfly service successfully from the server manager services window when the wildfly server is "blank" and without any changes (for e.g. in standalone.xml).
So i think the problem must be my java ee project which contains a web service and a simple persistent project to access different my sql databases. In the standalone.xml i just added the mysql driver and the databases and i do some edits in the interface section (ip adress changes).
Any Ideas? Do i have to made changes in different config files (for e.g. the service.bat) when im deploying something to wildfly?
Sorry for my english and thanks a lot!
When installing the WildFly service, make sure you have the following parameters specified:
In WildFly 8: /user <username> /password <password>
in WildFly 10: /jbossuser <username> /jbosspass <password>
In the services.bat the documentation reads:
/user: username for the shutdown command
/password: password for the shutdown command
According to my experience, without these parameters, WildFly will move to status "stopping", but will not stop.
That works for me:
1. Always run the CMD as admin first.
2. If your JBOSS_HOME environment is not set, get sure that you navigate to WildFly home directory before you execute the script.
For example: cd "C:\Program Files\wildfly
It's matter, because the service.bat takes your current dir (%CD%) as JBOSS_HOME, if it's not set.
3. You’ve to install the service with a special parameter. /controller
It’s important that you tell wildfly service on which port your wildfly admin console is running.
Take a look in standalone.xml, search for “management-http”, get sure that you use the same port in parameter.
Example: (Default port is 9990)
./bin/service/service.bat install /controller localhost:9990
Done. Now start the service and wait until you can reach the wildfly console page.
After try to stop or restart the service in service.msc or with service.bat (service.bat start/stop/restart).
I had similar issue but it turned out I needed a JAVA_HOME in standalone.conf.bat under bin folder. Simply uncomment the line that sets the JAVA_HOME variable and update its value with the desired path.
set "JAVA_HOME=C:\Program Files\Java\jdk1.8.0_121"
Above solution worked for me.
I had the "stopping" problem, when JAVA_HOME was set directly in jboss_cli.bat, pointing to the older jdk version previously installed on my machine. Check jboss_cli.bat for correct path of JAVA_HOME or simply use the JAVA_HOME environment variable (you might have to delete set JAVA_HOME line in jboss_cli.bat).

Nagios - installing custom plugin on Windows 7 that executes and sends back data to the server

I have setup Nagios 4 core on ubuntu machine and I have installed NSClient++ on windows 7 machine. For the out-of-box monitoring like CPU, memory , etc. everything works.
I also have written an EXE in .Net that gathers some metrics on the windows machine and the hope is that NSClient on the windows machine would execute this EXE and marshal these output back to the server. The problem is that I don't know how to install the plug in. Do you install it on the server? On the client? Both? If so where? Needless to say that ubuntu (where the nagios server is) shouldn't try to execute the .net EXE.
When I look at the configuration files on the server, I see that the nagios server uses Check_NT for communicating with the NSclient. We have a syntax like Check_nt!blah. Will I need to use the same syntax when executing my .Net EXE which is not part of the core?
I hardly found any detailed documentation as how to install a windows plugin and have the server and client talk to each other. So either it is extremely easy or extremely complicated. I also looked at some YouTube videos ...there is nothing there for the problem that I"m facing.
Any help is appreciated. Thanks all!
You'll want to define it as an NRPE check on your monitor, then define the check using the same name # NSClient++ on Windows. The NSClient++ configuration has a section for NRPE handlers, just for this (source: op5 kb):
[NRPE Handlers]
The nrpe handlers provide a way to execute any custom plugin/check command on the monitored Windows server. In this section you configure all the commands that should be available.
Adding a custom NRPE command to NSClient++ follow this syntax:
command[my_custom]=c:\mycustomdir\my_prog.exe
To test the check from your monitoring system you can use NRPE from the CLI to call my_custom:
./check_nrpe -H 10.0.0.1 -c my_custom
And then define the service in your Nagios config like so:
define service{
use generic-service
host_name windowshost
service_description CPU Load
check_command check_nrpe!my_custom
}
You may need to do some extra work to format the output correctly. In BASH, exit 1 and exit 0 are commonly used to indicate state, IE: OK/Critical (source), and you may find it easier to augment your EXE's output with some simple scripting like that.

Weblogic 10.3.3.0 application debugging with eclipse

Hello I saw some 11g tutorials with a Google search:
http://saltnlight5.blogspot.com/2014/04/how-to-setup-remote-debug-with-weblogic.html
http://java.dzone.com/articles/how-setup-remote-debug
They both specify adding something like:
JAVA_OPTIONS="$JAVA_OPTIONS -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=y"
Two questions I have is:
One, at my work we have domains/domainName/bin/setDomainEnv.sh and in the same "domainName" directory another folder called servers, with a bunch of our servers on it. I am not an expert in infrastructure but I am looking for a way to remotely debug an application on Weblogic through Eclipse that is located on one of the servers. What is the best way to sync up the one server and its application with Eclipse rather than effecting all of the severs (unless I am misunderstanding).
Second, is there not a way to set this up through the Weblogic Administration Console? I tried looking around for anything intuitive, but nothing stood out.
If you are starting your servers with NodeManager, you should be able to add the arguments to "Arguments" in the Weblogic Admin Console under:
Environment -> Servers -> Your Server -> Configuration (tab) -> Server Start (sub-tab)
setDomainEnv - set debugFlag="true" and every server you start will listen on the port specified, allowing remote debug connections.
Inside of Eclipse, select, Run > Debug Configuration and then select Remote Java Application Choose the host your server runs on with the port from setDomainEnv
This will affect all servers, so if you have two running on the same host you will have a port conflict. You can do something simple like putting an if statement into setDomainEnv so the debug is only turned on for a specific SERVER_NAME
<domain>/servers - this is the folder where weblogic caches security information, application information, startup params, etc for each server. You shouldn't be manipulating this directly on the file system
Another thing that may be of interest to you it the Oracle Enterprise Pack for Eclipse (OEPE). It allows you to start/stop servers directly from Eclipse as well as additional debug support.
Sample from my setDomainEnv.sh:
debugFlag="true"
export debugFlag
JAVA_DEBUG=""
export JAVA_DEBUG
if [ "${debugFlag}" = "true" ] ; then
JAVA_DEBUG="-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=8453,server=y,suspend=n -Djava.compiler=NONE"
export JAVA_DEBUG
JAVA_OPTIONS="${JAVA_OPTIONS} ${enableHotswapFlag} -ea -da:com.bea... -da:javelin... -da:weblogic... -ea:com.bea.wli... -ea:com.bea.broker... -ea:com.bea.sbconsole..."
export JAVA_OPTIONS
fi

How should I deploy a war file into wildfly server?

I'm making a CI environment using Jenkins and wildfly. I used the following command:
jboss-cli.bat --connect --controller=ip:adminPort --user=admin --password=*** --commands="deploy test.war --force"
It works fine, I can successfully access to the application after this command finished, but if I execute this command around 5 times through exec call, wildfly never respond eventually...
I'm wondering if this way of deployment is not correct. I need to find the way to deploy a war file many times. Any help will be appreciated.
I changed the command slightly as below and slowness or server stop haven't happened so far (for several months)
one of big difference is not using "commands" in the new command but I'm not sure why result is different.
/opt/wildfly-8.2.0.Final/bin/jboss-cli.sh --connect "deploy --force /home/wildfly/test/build/libs/test.war"
my wildfly version is wildfly-8.2.0.Final.