The controller is not available at localhost JBOSS.7.1.1.FINAL - linux

When i run the jboss-cli.sh,
I get this message.
[root bin]# sh jboss-cli.sh
You are disconnected at the moment. Type 'connect' to connect to the server or 'help' for the list of supported commands.
[disconnected /] connect localhost
The controller is not available at localhost:9999
[disconnected /] connect
The controller is not available at localhost:9999
[disconnected /] connect localhost:9999
The controller is not available at localhost:9999
[disconnected /]
Also i have another installation of jboss5 GA. I hope that is not interfering.
Although that is totally shut down for now.
Native management interface is :9999 in standalone.sh
Please throw light on this issue.
#
EDITED
#
When i stop my service with "service jboss stop"
i get this message
[root# bin]# *** JBossAS process (7302) received KILL signal ***
grep: /var/run/jboss-as/jboss-as-standalone.pid: No such file or directory
I Dont know how to check whether server is listening on the port 9999 or not.
Few more details
[root bin]# netstat -anp |grep 9999
tcp 0 0 127.0.0.1:9999 0.0.0.0:* LISTEN 7931/java
[root bin]# netstat -anp |grep 8080
tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN 7931/java
JBoss processs id and the server id acquiring these ports is same.

This question has two issues ,
First, i have provided debuging parameter in the startup script.
If you see 8787 that means you have somewhere provided debuging argument.
Second and the most important one controller not available #localhost or #IPADDRESS .
Please check if you have used port offset, as it increments all the ports by the number with with you have set port offset.
Suppose port offset is 2
Then try to access connect localhost:10001 Port i.e 9999+2
On my production server sometimes it does not works with localhost , but works with IP address.
Then try to access connect IPADDRESS:9999
OR
Then try to access connect 127.0.0.1:9999
Please check in the firewall weather the port 9999 or what ever with port offset, if the port is not open in the firewall it gives error,
I asked this question 6 months back and the above checks has solved
the problem always.

This is probaby because you have changed your binding configuration and jboss does not bind to 127.0.0.1.
In case your jboss instance is not binding to 127.0.0.1, you may use --controller option as follows:
./jboss-cli.sh --controller=YOUR_IP:9999

Use netstat -anp |grep 9999 to find out if port 9999 is in use and by which process id. You could also check the host.xml used by the controller to configure the proper native port.
In the host xml, you should find the default port:
<native-interface security-realm="ManagementRealm">
<socket interface="management" port="${jboss.management.native.port:9999}"/>
./jboss-cli.sh --controller=localhost:9999 --connect

You open the debug-port with jboss-cli.sh. Either you activated in jboss-cli.sh:
# Sample JPDA settings for remote socket debugging
# JAVA_OPTS="$JAVA_OPTS -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n"
or you set JAVA_OPTS with such an option in you environment. See
echo $JAVA_OPTS
I guess you did this for two jboss-processes, and you get a port-conflict. See
netstat -nap | grep 8787

I recently faced this issue and the root cause that I found was completely different than it is listed above. It is because for some other project I shifted to JDK 1.8 from 1.7. Boom! and error started coming up...I took hell lot of time figuring out why it is coming up before finally realizing I changed my JDK version.
It might be because JBOSS 7 doesn't work with 1.8 of which I have limited knowledge but yes this might prove useful for some cases.

Related

django not accessible from another computer

followed instructions here to create my first django web sever. Haven't done any major customization yet, except.
Setup settings.py:
ALLOWED_HOSTS = ['192.168.1.111', 'localhost', '127.0.0.1']
Started django from cmd prompt
python manage.py runserver 0.0.0.0:8080
All the three url link works on this local machine where django is installed:
http://127.0.0.1:8080/, http://localhost:8080/, http://192.168.1.111:8080/
I then went onto Windows Firewall settings to include 8080 as an inbound rule:
My problem is http://192.168.1.111:8080/ does throw an exception when accessed from another computer (in the same network, IP being 192.168.1.77). Error is "Site cannot be reached, took too long to respond".
I am not able to figure out what am I doing wrong. I am certain its a firewall issue. Turned off windows firewall on 192.168.1.111 and it worked from 192.168.1.77. Question still remains - How do I make it work with firewall on on 192.168.1.111.
My python version is 3.9 and django version is 3.2. FYI - I moved to 8080 just for kicks. I had same issue with 8000.
Two things worth noticing:
(1) 192.168.1.111:8080 does throw a "Not secure connection" warning on the primary machine (where django is installed)
(2) netstat seems OK too:
C:\Windows\system32>netstat -ab
Active Connections
.
.
[postgres.exe]
TCP 0.0.0.0:7680 DEVSERVER:0 LISTENING
Can not obtain ownership information
TCP 0.0.0.0:8080 DEVSERVER:0 LISTENING
[python3.9.exe]
TCP 0.0.0.0:49664 DEVSERVER:0 LISTENING
.
.
Can not obtain ownership information
TCP 192.168.1.111:8080 DEVSERVER:50515 ESTABLISHED
[python3.9.exe]
TCP 192.168.1.111:49800 52.226.139.121:https ESTABLISHED
[SearchApp.exe]
TCP 192.168.1.111:50502 52.182.141.63:https TIME_WAIT
TCP 192.168.1.111:50515 DEVSERVER:8080 ESTABLISHED
.
.
C:\Windows\system32>
192.168.1.111:8080 just doesn't seem to work from any computer within the network. Tried from 192.168.1.77 (windows/chrome) and 192.168.1.75(windows/firefox)
OK.. so it was a firewall issue. Apparently, there was another outbound rule with python.exe that was override=True and blocking Public or Private UDP or TCP. I don't even remember. I just deleted all TCP rule relating to python and just kept one (noted in my question above). Its working now

Apache does not start at boot up because of socket binding error but starts manually

Apache server is giving an error at boot up (or when I try to start the service with systemctl manually)
make_sock: could not bind to address [::]:7301 # virtual host port
But it starts nicely with following command:
httpd -k start
3 things come to mind:
That port, 7301 is already in use by another process, try a netstat -apn | grep 7301 to see if that's the case and if so change the apache port or kill that process.
You have 2 conflicting Listen directives in your apache conf file. For ex. Listen *:7301 and Listen 1.2.3.4:7301 would cause that error, pleasr remove one of them
You have configured apache to use an interface which is not active or does not have IPv6 enabled
Edit:
You have selinux active on your host and it's preventing apache from using a non default port as port 80.

Glassfish There is a process already using the admin port 4848

asadmin start-domain domain1
But it shows this error.
There is a process already using the admin port 4848 -- it probably is another instance of a GlassFish server.
I have searched and found that it could be the hostname or that the port is used by an other application or server and actually it is used by TCP.
I have no problem with the hostname so I've tried this solution by changing port.
asadmin set server.http-service.http-listener.http-listener-1.port=10080
but it shows this error
remote failure: No configuration found for server.http-service.http-listener.http-listener-1
Command set failed.
I can't understand why.
Assuming you are running glassifhs under linux
1 - Check if glassfish is already runnig.
ps -ef |grep java
kill any process java relative to glassfish
2 - Check if the port 4848 is in use
netstat -nao |grep 4848
3 - Change the default port
Edit the file {glassfish_home}/config/asadminenv.conf
AS_ADMIN_PORT=4848
I just kill all glassfish processes
pkill -f glassfish
I hit the same error.
This was useful - i.e. check you can ping $(hostname). Looks like glassfish checks hostname against IP, possibly during bind process.
My issue was my hostname/ip address in /etc/hosts was not aligned correctly, meaning I could not ping $(hostname). Once aligned and pinged, glassfish started ok.
I just hit this issue today. Be sure to delete the $PATH/TO/domain1/config/pid and $PATH/TO/domain1/config/pid.prev files as well, if the process isn't running but is being reported as still running.

how to debug spark GUI if its not working

My SPARK GUI is not working though I can see my 4040 port is listening whenever I start any spark-submit job.
netstat -an | grep 4040
tcp6 0 0 127.0.0.1:4040 :::* LISTEN
when I give address of my spark master server in my browser , it gives "This site can’t be reached".
I am not sure why it is not responding despite of listening on designated port. I also tried to see in /var/log/spark/ but non of log files gets updated after hitting web URL.
any pointer/suggestion will be highly appreciated.
finally I found an answer. I changed configuration in /etc/hosts
from
127.0.0.1 localhost
to
my machine ip localhost
Now I can see my Spark GUI. Though it is still not giving relevant data but thats another problem to solve now.

netstat commands to run on unix server, what commands should I use for my use-case and why?

Sorry in advance for such a noob question, but I'm certainly a noob.
My question is what does it mean to LISTEN or ACCEPT on a port as it relates to my example?
EXAMPLE:
I have a tomcat server, and It will use port 8080. I want to make sure that port is available for me to use.
What commands should I perform on my unix server and why?
what information would a command like this give me: netstat -an | grep LISTEN
If a port shows up as LISTEN in netstat, it means the port is in use by a server process, so you can't use it. Here is an example:
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN
which shows that port 631 is in use.
Ignore the UNIX type sockets at the end - they are irrelevant.
For checking port 8080 is in use or not, you can simply use the command netstat -an|grep 8080. If you get an output in below format, that means 8080 is already in use and you need to assign a new port for the tomcat.
# netstat -an
tcp 0 0 127.0.0.1:8080 0.0.0.0:* LISTEN
Netstat command displays various network related information such as network connections, routing tables, interface statistics, masquerade connections, multicast memberships etc,
a option with netstat will give you both listening and non listening ports
n option when you don’t want the name of the host, port or user to be displayed, use netstat -n option. This will display in numbers, instead of resolving the host name, port name, user name. This also speeds up the output, as netstat is not performing any look-up.
For more understand the use of netstat command here are its options:
-a : All ports
-t : Ports TCP
-u : Ports UDP
-l : Listening ports
-n : IP address without domain name resolution
-p : Name of the program and it associated PID
So:
-To display all port (TCP & UDP), PId with the associated name of the program :
$ netstat -paunt
-To display all Listening ports (TCP), PId with the associated name of the program : (and we can also filter with the grep command)
$ sudo netstat -plnt | grep ':80'
I hope it will be helpful :)
You can also use telnet to check if the port is open and listening e.g,
Zeeshan$ telnet google.com 80
Trying 173.194.35.5...
Connected to google.com.
Escape character is '^]'.
I am telnetting google.com on port 80. If you see the third line in the output, you will notice it says it is connected with the Google's web server. The same way you have a JAVA application server called Tomcat and it is listening on port 8080. In fact it is asking clients to connect to it on port 8080 so it can give away the JAVA services to client. When I will use from a client side telnet localhost 8080 I will be connected the same way I have connected with Google's web server on port 80. Provided that Tomcat is running and listening on port 8080. If port 8080 is not free and occupied by some other application you can simply change the port 8080 to another free port. Telnet should give you the following status:
accepted (connected), refused, and timeout
connection refused - nothing is running on that port
accepted - some application is running on the port
timeout - a firewall is blocking access
So now there are two possible ways to check. From the same machine you are running Tomcat server:
telnet localhost 8080
Of if you want to check it from some other machine or outside of the network:
telnet 192.168.1.1 8080
I hope that helps.
use can also run the below command, it will list the Port and corresponding PID, if any process is using those ports
netstat -tulpn

Resources