Objective:
=========
connect to server1 as root and execute commands and postprocess the command output to get a list of servers (let's say this is server2)
change to non-root user in server1
3)connect to server2 as a non-root user via server1
change to root user on server2
execute commands on server2 and from the output of the command, build another command and run it
==========
I wrote a program using pexpect/pxssh. However, the program is awfully slow while I run commands on server-2
Would you please advise to resolve this issue? Any alternative is welcome.
Regards,
Ashish
We were using an older version of Jboss 4.x with JDK 5 on CentOS 5.x, this version of Jboss is very old now, even this version is also not supported by RedHat now.
Now we are upgrading to jboss-eap 6.2 and jdk1.7.0_60 and CentOS 6.x in UAT and AWS Linux1 AMI for Production, I have installed Jboss 6.2 in /var/lib/jboss-eap-6.2 folder. Necessary modification in the code are already done, application is working fine and Jboss is running as a process using below command.
./standalone.sh -c standalone-full.xml -b 0.0.0.0 -bmanagement 0.0.0.0
Below command shows that process is running on port 8080.
netstat -aptn | grep LISTEN
Please help configure Jboss 6.2 as a service and set Auto-start, when OS starts?
Follow the below steps to Configure Jboss6.2 as Service and configure it as Auto restart. The process is same for CentOS 6.x and AWS Linux1 AMI.
Copy files into system directories
a. Copy the modified configuration file to the /etc/jboss-as directory.
mkdir /etc/jboss-as
cp /var/lib/jboss-eap-6.2/bin/init.d/jboss-as.conf /etc/jboss-as/
Uncomment following line
JBOSS_USER=root
and add the following line at the end of this file.
export JBOSS_USER
b. Copy the start-up script to the /etc/init.d directory.
cp /var/lib/jboss-eap-6.2/bin/init.d/jboss-as-standalone.sh /etc/init.d/jboss-62
Do following changes in /etc/init.d/jboss-62 file
i)-Set Java Home JAVA_HOME=/usr/java/jdk1.7.0_60 export JAVA_HOME
ii)-Set JBOSS Home JBOSS_HOME=/var/lib/jboss-eap-6.2 export JBOSS_HOME
iii)-Change Configuration xml file name(you may give what ever configuration file name you are using)
JBOSS_CONFIG=standalone-full.xml
iv)-Add "-b 0.0.0.0 -bmanagement 0.0.0.0" in the following line, so that binding is set for every IP address on this system
daemon --user $JBOSS_USER LAUNCH_JBOSS_IN_BACKGROUND=1
JBOSS_PIDFILE=$JBOSS_PIDFILE $JBOSS_SCRIPT -b 0.0.0.0 -bmanagement
0.0.0.0 -c $JBOSS_CONFIG 2>&1 > $JBOSS_CONSOLE_LOG &
Add the start-up script as a service.
Add the new jboss-as-standalone.sh ( i.e jboss-62 ) service to list of automatically started services, using the chkconfig command.
chkconfig --add jboss-62
Start the service.
service jboss-62 start
Make the service to start automatically when you restart your
server.
chkconfig jboss-62 on
Restart the service
service jboss-62 restart
Now Jboss6.2 configuration as a Service as Auto restart is complete.
Reboot os and check that service is running. Run below command ot verify that service is running on port 8080
netstat -aptn | grep LISTEN | grep 8080
NFS Mount is not working in my RHEL 7 AWS instance.
When I do a
mount -o nfsvers=3 10.10.11.10:/ndvp2 /root/mountme2/
I get the error:
mount.nfs: requested NFS version or transport protocol is not supported
Can anyone point me where I am wrong?
Thanks.
Check the nfs service is started or reboot the nfs service.
sudo systemctl status nfs-kernel-server
In my case this package was not running and the issue was in /etc/exports file where i was having same IP address for two machines.
So i commented one ip address for the machine and restarted nf-kernel-server using
sudo systemctl restart nfs-kernel-server and reload the machine.
It worked.
A precision which might be useful for the dump (like me): systemctl status nfs-server.service and systemctl start nfs-server.service must be executed on the server!
Some additional data
If, like me, you've deleted a VM without shutting it down right you might also need to manually edit the file /etc/exports because NFS is trying to connect to it and fails but doesn't continue with the next, it just dies.
After that you can manually restart as mentioned in other answers.
In my case, a simple reload didn't suffice. I had to perform a full restart:
sudo systemctl status nfs-kernel-server
In my case, it didn't work correctly with version NFS 4.1.
So in Vargantfile in each place where is type: 'nfs' I added coma and nfs_version: 4, nfs_udp: false
Here is more detailing explanation NFS
If you're giving a specific protocol to connect with, also check to make sure your NFS server has that protocol enabled.
I got this error when trying to start up a Vagrant box, and my nfs server was running. It turns out that the command Vagrant uses is:
mount -o vers=3,udp,rw,actimeo=1 192.168.56.1:/dir/on/host /vagrant
Which specifically asks for UDP. My server was running but it was not configured to enable connecting over UDP. After consulting /etc/nfs.conf, I created /etc/nfs.conf.d/10-enable-udp.conf with the following contents to enable udp:
[nfsd]
udp=y
The name of the file doesn't matter, as long as it's in the conf.d directory and ends in .conf. Depending on your distribution it may be configured differently. You can directly edit nfs.conf, but using a conf.d file is more likely to preserve the changes after upgrading your system.
Try to ping IP address of the server "ping " from client "ping , if you get reply then install nfs server on the host. Then edit /etc/exports file don't forget to add port along with IP address
I got the solution: make an entry in nfs server /etc/nfsmount.conf with Defaultvers=3 .
There will # Defaultvers=3 just unhash it and then mount on nfs client.
Issue will be resolved!
I try to run an EJB example using NetBeans IDE and GlassFish Server v3. When I run my client code(The class that have main method), I faced this Error:
Starting GlassFish Server 3.1.2
GlassFish Server 3.1.2 Server cannot start. Port is occupied.
C:\Users\7\Documents\NetBeansProjects\MDbexample\nbproject\build-impl.xml:907: Deployment error: GlassFish Server 3.1.2 Server cannot start. Port is occupied.
So I decided to run GlassFish by using command line:
c:\glassfish3\bin>asadmin start-domain
Now I faced this massage on cmd environment:
There is a process already using the admin port 4848 -- it probably is another instance of a GlassFish server.
Command start-domain failed.
Is there anybody that know How I can solve my problem?
Thanks in advance.
insert line into /etc/hosts say;
<HOSTNAME> <REALIP>
myMachine 10.102.55.45
My server is running on windows server 2008, IIS 7.
My client is Windows server 2003 or Windows XP.
I want to start/stop websites remotely.
I easily managed to do it interactively using IIS 7 manager on my clients machines (cf http://blogs.iis.net/bdela/archive/2007/10/08/remote-administration-managing-iis-7-rco-from-windows-xp-2k3-and-vista.aspx )
But I want to do it in a non interactive-way, the goal is to script this as part of a msbuild script.
I tried the MSBuildExtensionPack but it works only if IIS7 is installed on the client site.
I tried powershell cmdlets, but I have to start dcom on the server (http://learn.iis.net/page.aspx/160/writing-powershell-commandlets-for-iis-70/ ).
What can I do?
If you can upgrade both client and server to PowerShell 2.0 you could use PowerShell remoting along with PowerShell 2.0's WebAdministration module to do this. First you need to enable remoting on the server PowerShell like so (from an elevated prompt):
PS> Set-ExecutionPolicy RemoteSigned
PS> Enable-PSRemoting -Force
Then on the client machine execute the following:
PS> Invoke-Command servername {Import-Module WebAdministration; Stop-WebSite Foo}
Thanks! Powershell 2.0 did the trick. Nevertheless your commands didn't seem to work.
On the server side I ran
PS> winrm quickconfig
and on the client side I ran
PS> Invoke-Command -computername servername -scriptblock {[system.reflection.assembly]::loadfrom("c:\windows\system32\inetsrv\microsoft.web.administration.dll");$server2 = New-object microsoft.web.administration.servermanager;$server2.Sites["Foo"].Stop()}
As described in : http://www.powershellcommunity.org/Default.aspx?tabid=55&EntryID=65