access wt on amazon ec2 with elastic ip [closed] - amazon-ec2

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I source-compiled the latest wt on a micro instance of ec2 with ubuntu running
when I lunch one of the examples:
1:23:15.~/progs/wt-3.2.3-rc1/examples/widgetgallery
>../../build/examples/widgetgallery/widgetgallery.wt --docroot . --http-address localhost --http-port 8080
[2012-Oct-25 01:23:16.898953] 969 - [info] "config: reading Wt config file: /etc/wt/wt_config.xml (location = '../../build/examples/widgetgallery/widgetgallery.wt')"
[2012-Oct-25 01:23:16.901653] 969 - [info] "WServer/wthttp: initializing built-in wthttpd"
[2012-Oct-25 01:23:16.902948] 969 - [info] "wthttp: started server: http://localhost:8080"
I can't access it when i put http://54.243.50.12:8080/ or http://54.243.50.12/ into chrome's address bar. It keeps loading and never finds it.
Associating of the elastic IP worked. I can connect to 54.243.50.12 with putty.
If I try to specify the elastic IP when I start wt, the wt server doesn't start:
1:31:45.~/progs/wt-3.2.3-rc1/examples/widgetgallery
>../../build/examples/widgetgallery/widgetgallery.wt --docroot . --http-address 54.243.50.12 --http-port 8080
[2012-Oct-25 01:31:53.696951] 1056 - [info] "config: reading Wt config file: /etc/wt/wt_config.xml (location = '../../build/examples/widgetgallery/widgetgallery.wt')"
[2012-Oct-25 01:31:53.699035] 1056 - [info] "WServer/wthttp: initializing built-in wthttpd"
[2012-Oct-25 01:31:53.699968] 1056 - [error] "wthttp: Error occurred when binding to 54.243.50.12:8080
bind: Cannot assign requested address"
[2012-Oct-25 01:31:53.700614] 1056 - [info] "WServer/wthttp: fatal: Error (asio): bind: Cannot assign requested address"
1:31:53.~/progs/wt-3.2.3-rc1/examples/widgetgallery
>
Without an elastic IP, it was the same story.
the 8080 port is open:
>netstat -an | grep "LISTEN "
tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:5432 0.0.0.0:* LISTEN
tcp6 0 0 :::22 :::* LISTEN
I did all that is in http://redmine.webtoolkit.eu/boards/2/topics/4484#message-4516 but it didn't help.

I needed to open a port in Security Group > Inbound

Related

(FreeSWITCH) [ERR] mod_event_socket.c:2992 Socket Error! Could not listen on 127.0.0.1:8021

I'm getting following error in freeswitch.log file while connecting microphone in BigBlueButton 2.4.9 meeting.
[ERR] mod_event_socket.c:2992 Socket Error! Could not listen on 127.0.0.1:8021
I'm not able to connect audio in the meeting. When I attempt to connect with a microphone it goes to Audio Test then says Establishing audio connection... it never passes this point. I tried letting it wait, and it just doesn't connect.
I have set the following in event_socket.conf.xml.
<param name="listen-ip" value="127.0.0.1"/>
Below is the configurations for FreeSWITCH in default.yml file:
freeswitch:
ip: <internal_IPv4>
sip_ip: <extarnal_IPv4>
port: 5066
esl_ip: 127.0.0.1
esl_port: 8021
handleExternalConnections: false
The output of netstat -ant | grep 5060 is as per below:
tcp 0 0 <internal_IPv4>:5060 0.0.0.0:* LISTEN
The output of netstat -vatupn | grep 8021 is as per below:
tcp 0 0 127.0.0.1:8021 0.0.0.0:* LISTEN -

Log4j2 socket appender inside a docker container throw connection refused

I have a springboot app running on docker container. In my app there is a log4j.xml file with socket appender.
<Socket name="Socket" host="172.17.0.1" port="5100">
<JsonLayout compact="true" eventEol="true" />
</Socket>
In my host server (Ubuntu server) its listing port 5100 by logstash. Out put of "netstat -tulpn" command in host is as below.
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:8280 0.0.0.0:* LISTEN -
tcp 0 0 127.0.0.1:5100 0.0.0.0:* LISTEN -
tcp 0 0 127.0.0.1:5001 0.0.0.0:* LISTEN -
But when the springboot server up its getting connection refused error.
2021-07-30 05:20:47,646 main ERROR TcpSocketManager (TCP:172.17.0.1:5100) caught exception and will continue: java.net.ConnectException: Connection refused (Connection refused)
at java.base/java.net.PlainSocketImpl.socketConnect(Native Method)
I tried with "host.docker.internal" also and its not working. Can anyone let me know what is the problem with this please?
As you can see from your netstat output, Logstash is listening on 127.0.0.1:5100 only. That means it cannot be accessed from within Docker. You have to make it listen on 172.17.0.1:5100 or 0.0.0.0:5100.

Elasticsearch: How to know HTTP port number used when default 9200 is already in use

In the Elasticsearch documentation is specified the following regarding to the http.port configuration:
http.port
Port to bind to for incoming HTTP requests. Accepts a single value or a range. If a range is specified, the node will bind to the first available port in the range.
Defaults to 9200-9300.
Let's say that Elasticsearch automatically selects the port 9202 because the 9200 is already in use. How does a Java client application know which port was selected and has to be used to create a RestHighLevelClient object? Is there a way to query a another service that could provide the port number information?
Thanks in advance.
Update
After the first answer I've tried to reproduce the steps in a Windows machine (production environment) by executing the following:
> tasklist | findstr "elasticsearch"
elasticsearch-service-x64 2232 Services 0 537,764 K
> netstat -aon | find /i "2232"
TCP 0.0.0.0:9200 0.0.0.0:0 LISTENING 2232
TCP 0.0.0.0:9300 0.0.0.0:0 LISTENING 2232
TCP 127.0.0.1:9200 0.0.0.0:0 LISTENING 2232
TCP 127.0.0.1:9300 0.0.0.0:0 LISTENING 2232
TCP 127.0.0.1:49201 127.0.0.1:49202 ESTABLISHED 2232
TCP 127.0.0.1:49202 127.0.0.1:49201 ESTABLISHED 2232
TCP 127.0.0.1:49203 127.0.0.1:49204 ESTABLISHED 2232
TCP 127.0.0.1:49204 127.0.0.1:49203 ESTABLISHED 2232
TCP 127.0.0.1:49205 127.0.0.1:49206 ESTABLISHED 2232
TCP 127.0.0.1:49206 127.0.0.1:49205 ESTABLISHED 2232
...
TCP 127.0.0.1:49275 127.0.0.1:49276 ESTABLISHED 2232
TCP 127.0.0.1:49276 127.0.0.1:49275 ESTABLISHED 2232
TCP [::1]:9200 [::]:0 LISTENING 2232
TCP [::1]:9300 [::]:0 LISTENING 2232
The result shows several lines where the 9200 port (http.port) is used:
TCP 0.0.0.0:9200 0.0.0.0:0 LISTENING 2232
TCP 127.0.0.1:9200 0.0.0.0:0 LISTENING 2232
TCP [::1]:9200 [::]:0 LISTENING 2232
If I had to parse that result to get the port number, which of those IP addresses should I look for? or simply does not matter?
RestHighLevelClient is thread-safe and it's instantiated by the application at startup time or when the first request is executed. How is it being done "under the hood" maybe you can check in RestClientBuilder.java here.
Not sure about the question, but if you are not sure which port ES is using you can check it
[root#myserver ~]# service elasticsearch status
elasticsearch (pid 5384) is running...
## netstat on pid
[root#myserver~]# netstat -plunt | grep 5384
tcp 0 0 ::ffff:10.100.14.146:9300 :::* LISTEN 5384/java
tcp 0 0 ::ffff:10.100.14.19:9200 :::* LISTEN 5384/java
tcp 0 0 ::ffff:127.0.0.1:9200 :::* LISTEN 5384/java

Cloudera: Installation failed. Failed to receive heartbeat on CDH 5.14 cluster installation on singleNode from agents

I am trying to install cloudera CDH 5.14.0. and facing below error during Cluster Installation.
Installation failed. Failed to receive heartbeat from agent.
Ensure that the host's hostname is configured properly.
Ensure that port 7182 is accessible on the Cloudera Manager Server (check firewall rules).
Ensure that ports 9000 and 9001 are not in use on the host being added.
Check agent logs in /var/log/cloudera-scm-agent/ on the host being added. (Some of the logs can be found in the installation details).
If Use TLS Encryption for Agents is enabled in Cloudera Manager (Administration -> Settings -> Security), ensure that /etc/cloudera-scm-agent/config.ini has use_tls=1 on the host being added. Restart the corresponding agent and click the Retry link here.
Detail Log:
>>[28/Jan/2018 10:30:44 +0000] 12771 MainThread agent INFO Neither verify_cert_file nor verify_cert_dir are configured. Not performing validation of server certificates in HTTPS communication. These options can be configured in this agent's config.ini file to enable certificate validation.
>>[28/Jan/2018 10:30:44 +0000] 12771 MainThread agent INFO Agent Logging Level: INFO
>>[28/Jan/2018 10:30:44 +0000] 12771 MainThread agent INFO No command line vars
>>[28/Jan/2018 10:30:44 +0000] 12771 MainThread agent INFO Found database jar: /usr/share/java/mysql-connector-java.jar
>>[28/Jan/2018 10:30:44 +0000] 12771 MainThread agent INFO Missing database jar: /usr/share/java/oracle-connector-java.jar (normal, if you're not using this database type)
>>[28/Jan/2018 10:30:44 +0000] 12771 MainThread agent INFO Found database jar: /usr/share/cmf/lib/postgresql-9.0-801.jdbc4.jar
>>[28/Jan/2018 10:30:44 +0000] 12771 MainThread agent INFO Agent starting as pid 12771 user root(0) group root(0).
END (0)
end of agent logs.
scm agent restarted
Local ubuntu host details:
chaithu#chaithu:~$ hostname
chaithu
chaithu#chaithu:~$ hostname -f
chaithu
chaithu#chaithu:~$ cat /etc/hosts
127.0.0.1 localhost
127.0.1.1 chaithu
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
chaithu#chaithu:~$ sudo netstat -tulpn
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:7180 0.0.0.0:* LISTEN 1353/java
tcp 0 0 0.0.0.0:7182 0.0.0.0:* LISTEN 1353/java
tcp 0 0 0.0.0.0:4433 0.0.0.0:* LISTEN 12930/python2.7
tcp 0 0 127.0.1.1:53 0.0.0.0:* LISTEN 1162/dnsmasq
tcp 0 0 127.0.0.1:7190 0.0.0.0:* LISTEN 12930/python2.7
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1031/sshd
tcp 0 0 0.0.0.0:7191 0.0.0.0:* LISTEN 12930/python2.7
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 5112/cupsd
tcp 0 0 127.0.0.1:5432 0.0.0.0:* LISTEN 1077/postgres
tcp 0 0 127.0.0.1:19001 0.0.0.0:* LISTEN 1632/python
tcp 0 0 127.0.1.1:9000 0.0.0.0:* LISTEN 12771/python2.7
tcp 0 0 0.0.0.0:7432 0.0.0.0:* LISTEN 1434/postgres
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 1045/mysqld
tcp6 0 0 :::80 :::* LISTEN 1441/apache2
tcp6 0 0 :::4434 :::* LISTEN 12930/python2.7
tcp6 0 0 :::22 :::* LISTEN 1031/sshd
tcp6 0 0 :::7191 :::* LISTEN 12930/python2.7
tcp6 0 0 ::1:631 :::* LISTEN 5112/cupsd
tcp6 0 0 :::7432 :::* LISTEN 1434/postgres
udp 0 0 0.0.0.0:57656 0.0.0.0:* 902/avahi-daemon: r
udp 0 0 0.0.0.0:631 0.0.0.0:* 5113/cups-browsed
udp 0 0 0.0.0.0:5353 0.0.0.0:* 2703/chrome
udp 0 0 0.0.0.0:5353 0.0.0.0:* 902/avahi-daemon: r
udp 0 0 0.0.0.0:39330 0.0.0.0:* 1162/dnsmasq
udp 0 0 0.0.0.0:7191 0.0.0.0:* 12930/python2.7
udp 0 0 127.0.1.1:53 0.0.0.0:* 1162/dnsmasq
udp 0 0 0.0.0.0:68 0.0.0.0:* 1117/dhclient
udp6 0 0 :::5353 :::* 2703/chrome
udp6 0 0 :::5353 :::* 902/avahi-daemon: r
udp6 0 0 :::46382 :::* 902/avahi-daemon: r
udp6 0 0 :::7191 :::* 12930/python2.7
I am trying to install CDH only on single node local machine. Do let me know if any more info required.

JBoss - ExportException: Port already in use: 1098

I'm getting the following error when I try to start JBoss
10:10:43,298 INFO [WebService] Using RMI server codebase: http://127.0.0.1:8083/
10:10:43,938 ERROR [AbstractKernelController] Error installing to Start: name=jboss:service=Naming state=Create mode=Manual requiredState=Installed
java.rmi.server.ExportException: Port already in use: 1098; nested exception is:
java.net.BindException: Address already in use: JVM_Bind
at sun.rmi.transport.tcp.TCPTransport.listen(TCPTransport.java:249)
at sun.rmi.transport.tcp.TCPTransport.exportObject(TCPTransport.java:184)
at sun.rmi.transport.tcp.TCPEndpoint.exportObject(TCPEndpoint.java:382)
at sun.rmi.transport.LiveRef.exportObject(LiveRef.java:116)
at sun.rmi.server.UnicastServerRef.exportObject(UnicastServerRef.java:180)
at java.rmi.server.UnicastRemoteObject.exportObject(UnicastRemoteObject.java:293)
at java.rmi.server.UnicastRemoteObject.exportObject(UnicastRemoteObject.java:256)
However When I try to see what ports are being listened to. I don't see that port!
H:\>netstat -a -n -o
Active Connections
Proto Local Address Foreign Address State PID
TCP 0.0.0.0:135 0.0.0.0:0 LISTENING 824
TCP 0.0.0.0:445 0.0.0.0:0 LISTENING 4
TCP 0.0.0.0:1521 0.0.0.0:0 LISTENING 2036
TCP 0.0.0.0:3389 0.0.0.0:0 LISTENING 752
TCP 0.0.0.0:7717 0.0.0.0:0 LISTENING 2944
TCP 0.0.0.0:8081 0.0.0.0:0 LISTENING 1564
TCP 0.0.0.0:31038 0.0.0.0:0 LISTENING 1436
TCP 127.0.0.1:1038 0.0.0.0:0 LISTENING 2036
TCP 127.0.0.1:1052 0.0.0.0:0 LISTENING 2620
TCP 127.0.0.1:5998 127.0.0.1:5999 ESTABLISHED 4036
TCP 127.0.0.1:5999 127.0.0.1:5998 ESTABLISHED 4036
TCP 127.0.0.1:6000 127.0.0.1:6001 ESTABLISHED 4036
TCP 127.0.0.1:6001 127.0.0.1:6000 ESTABLISHED 4036
TCP 142.174.27.74:139 0.0.0.0:0 LISTENING 4
TCP 142.174.27.74:13148 142.174.12.84:445 ESTABLISHED 4
TCP 142.174.27.74:13253 142.174.134.33:8080 ESTABLISHED 4036
TCP 142.174.27.74:13255 142.174.134.33:8080 ESTABLISHED 4036
TCP 142.174.27.74:13258 142.174.134.33:8080 ESTABLISHED 4036
TCP 142.174.27.74:13259 142.174.134.33:8080 ESTABLISHED 4036
TCP 142.174.27.74:13260 142.174.134.33:8080 ESTABLISHED 4036
TCP 142.174.27.74:13261 142.174.134.33:8080 ESTABLISHED 4036
TCP 142.174.27.74:13262 142.174.134.33:8080 ESTABLISHED 4036
TCP 142.174.27.74:13263 142.174.134.33:8080 ESTABLISHED 4036
UDP 0.0.0.0:445 *:* 4
UDP 0.0.0.0:8081 *:* 1564
UDP 0.0.0.0:8082 *:* 1564
UDP 0.0.0.0:19508 *:* 1244
UDP 127.0.0.1:123 *:* 948
UDP 127.0.0.1:1025 *:* 580
UDP 127.0.0.1:1046 *:* 524
UDP 127.0.0.1:1056 *:* 784
UDP 127.0.0.1:1213 *:* 2888
UDP 127.0.0.1:1257 *:* 2404
UDP 127.0.0.1:2172 *:* 3736
UDP 127.0.0.1:2310 *:* 2188
UDP 142.174.27.74:123 *:* 948
UDP 142.174.27.74:137 *:* 4
UDP 142.174.27.74:138 *:* 4
H:\>
any ideas?
Thanks,
Tam
Try TCPView (TCPView v3.05). I get this "port already in use" quite a lot, and TCPView always usually catches the culprit.
Go to jboss-service.xml under conf folder and change the port for RMI from 1098 to 8099 8099
Restart the server .
We ran into this problem some time ago as well, not just with JBoss, but also MySQL.
I wrote about it in more detail here:
Windows TCP Port Conflicts above 1024
What it comes down to is that Windows uses the port range between 1000 and 5000 for so called "ephemeral" ports. This means that it assigns ports from this range for processes that request a random port.
On Windows 2000/2003 Server installations as well as on Windows XP Pro you can reserve port ranges (even if they only cover a single port) for your applications. Effectively they are not reserved for anything specific, but just excluded from the dynamic allocation. To do so, create or edit the following registry value (type REG_MULTI_SZ/Multi-String Value):
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\ReservedPorts
In this value specify port ranges in the format xxxx-yyyy with xxxx and yyyy being the lowest and highest port of the range to be reserved. To reserve a single port, just use the same values for both (e. g. 1099).
I guess that port is still in use. You can find that using:
netstat -ao
and
netstat -b
If you can't use that port, find another port and change it in the following XML file:
conf/bindings-beans/META-INF/bindings-jboss-beans.xml
The JBoss 5 has a new ServiceBindingManager which uses bean injection to assign ports at runtime. Changing the port here may do the trick for you.
You can also use a different ports configuration and override the ports by a factor.
Based on the ports mentioned in the file referenced by Sam, and the registry key referenced by Daniel Schneller, the following should do the trick for JBoss EAP 5:
1090-1090 1098-1102 1161-1162 3528-3528 4444-4448 4457-4457 4712-4714 5445-5446 8080-8083 8443-8443
Translated in a .reg file:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters]
"ReservedPorts"=hex(7):31,00,30,00,39,00,30,00,2d,00,31,00,30,00,39,00,30,00,\
20,00,31,00,30,00,39,00,38,00,2d,00,31,00,31,00,30,00,32,00,20,00,31,00,31,\
00,36,00,31,00,2d,00,31,00,31,00,36,00,32,00,20,00,33,00,35,00,32,00,38,00,\
2d,00,33,00,35,00,32,00,38,00,20,00,34,00,34,00,34,00,34,00,2d,00,34,00,34,\
00,34,00,38,00,20,00,34,00,34,00,35,00,37,00,2d,00,34,00,34,00,35,00,37,00,\
20,00,34,00,37,00,31,00,32,00,2d,00,34,00,37,00,31,00,34,00,20,00,35,00,34,\
00,34,00,35,00,2d,00,35,00,34,00,34,00,36,00,20,00,38,00,30,00,38,00,30,00,\
2d,00,38,00,30,00,38,00,33,00,20,00,38,00,34,00,34,00,33,00,2d,00,38,00,34,\
00,34,00,33,00,00,00,00,00
The root cause is that JBOSS was not peoperly shut down.
If you are using Windows,
go to task manager and kill the JBOSS processes.
Reserve the port 1098-1099 in registry.
Restart the oracle service if running, then start the JBOss.
This error is also thrown by Jboss if your default IP address changes due to some problem
means
121...89 to 121...90 Just check it and replace it with a newer IP address. It will work.

Resources