Logstash doesn't start. Error: "Could not start TCP server: Address in use" - linux

Logstash doesn't start. It says following:
:message=>"Could not start TCP server: Address in use", :host=>"0.0.0.0", :port=>1514, :level=>:error}The error reported is: \n Address already in use - bind - Address already in use"}
In logstash configuration file, port 1514 is not specified. And when logstash is stopped no service is listening on this port. When I start logstash and although I don't specify this port in configuration file, it starts listening on this port. If I put this port in logstash configuration file and start logstash it gives me the error that the address is in use. I need to use tcp/1514 port, because all my esxi hypervisors are configured to send logs to this port.
Why when I start logstash it starts listening on this port despite I dont have this port in the configuration file?
What can I do to successfully start logstash service using this port in configuration file?

The problem is that there were two configuration files used by logstash.
root#srv-syslog:~# locate central.conf
/etc/logstash/conf.d/central.conf
/etc/logstash/conf.d/central.conf.save
I deleted the second one and now everything is ok.

Related

Spring Boot App deployed on Azure App Service port 8080

I'm trying to deploy a Spring Boot Rest Api (Gradle) to an Azure app service. There is an executable jar in the /home/site/wwwroot folder and a startup command (java -jar /home/site/wwwroot/app.jar). When I execute this script, the spring api starts but throws the following error: "The Tomcat connector configured to listen on port 80 failed to start. The port may already be in use or the connector may be misconfigured."
I can't run the app on another port because the Azure App Service only allows inbound HTTP traffic on port 80 and 443 for SSL. I tried killing the process that is running on port 80 but that kills my ssh terminal.
Is there a solution to 'clear' the proces running on port 80 and actually run my Spring application on it?
"The Tomcat connector configured to listen on port 80 failed to start.The port may already be in use or the connector may be misconfigured."
The error is because another process is running on the same port. To solve this, you have two options.
Try to run the application on a port other than 8080.
Identify and stop the process running on that specific port.
Check this post on how to change the default tomcat port number.
See: how the spring boot configuration works.
Check this blog and SO thread might be helpful. Tomcat Server Error - Port 8080 already in use

Zookeeper admin server Port

Installed zookeeper 3.5.6 bin on windows. Getting error:
Unable to start AdminServer, exiting abnormally
org.apache.zookeeper.server.admin.AdminServer$AdminServerException: Problem starting AdminServer on address 0.0.0.0, port 8080 and command URL /commands
Where do I find the AdminServer configuration properties to fix this. In my conf directory the .cfg does not have anything, and I cant find anything anywhere else either?? The documentation is referring to zookeeper.admin.serverPort properties etc.
By default, Admin Server binds to port 8080, in case port 8080 already in use this exception will be thrown.
Add below property to conf/zoo.cfg file and restart zk server.
admin.serverPort=9876 (other port than 8080)
Or you could disable admin server altogether by
admin.enableServer=false

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.

retrieve IP address of client in logstash

I am new to ELK stack and sending the application log file to logstash server via tcp input method using the below command
cat test.log | nc server port
Please let me know how can i retrieve the ip address of the client machine as field in logstash configuration file.
Did you try adding the host IP when sending the message?

Failed to reach erlang port mapper (server ports open and connecting via Telnet)

I am trying to add a new server to an existing cluster. I am using community version 2.1.1 on both ubuntu servers on windows azure. I tried to add new server via web interface and via command line. But i am getting following error.
***"Failed to reach erlang port mapper. Timeout connecting to "xx.xx.xx.xx" on port "4369". This could be due to an incorrect host/port combination or a firewall in place between the servers.']***
Port 4369 is open on both servers and iam able to connect to 4369 port on other server using telnet
Got the same error when used the following command.
/opt/couchbase/bin/couchbase-cli server-add --cluster=xx.xx.xx.xx:8091 -u user -p password --server-add=yy.yy.yy.yy:8091 --server-add-username=Administrator --server-add-password=password
ERROR: unable to server-add yy.yy.yy.yy:8091 (400) Bad Request
[u'Prepare join failed. Failed to reach erlang port mapper. Timeout connecting to "xx.xx.xx.xx" on port "4369". This could be due to an incorrect host/port combination or a firewall in place between the servers.']
root#xx.xx.xx.xx:/home/azureuser/project# telnet yy.yy.yy.yy 4369
Trying yy.yy.yy.yy...
Connected to yy.yy.yy.yy.
Escape character is '^]'.
^]q
telnet> q
Connection closed.
What will be the issue? Please help me sort this out.
There are a number of ports required to be open between cluster nodes (in addition to 4369) - I'd suggest ensuring all of the ports listed in the Couchbase Installation Guide - Network ports are open and accessible.

Resources