Docker broke my brew? - docker

I worked on my computer (mac os High Sierra 10.13.4) for a Rails application. I had Postgres, Redis and ElasticSearch installed via Homebrew.
I recently started to dockerize the app on a new branch.
When I went back to my main branch, none of the brew services were working:
PG::ConnectionBad - could not connect to server: Connection refused
which I fixed thanks to https://dba.stackexchange.com/questions/75214/postgresql-not-running-on-mac
couldn't connect to redis
which I fixed by running redis-cli
Errno::ECONNREFUSED - Failed to open TCP connection to localhost:9200 (Connection refused - connect(2) for "::1" port 9200)
I tried stopping/starting, desinstalling/reinstalling elasticsearch and even desinstalling/reinstalling Homebrew. I'm considerating doing a clean reinstall of my computer.
I don't understand how working on docker could break services on my computer, I thought it was supposed to fix exactly that kind of problems.
Any help on getting elasticsearch to work would be really appreciated!

This answer is only a speculation. A little more information might help us figure out what’s really going on here.
Are the Docker containers still running?
If yes, do they use the same ports that these services do on your Mac?
If the answer to both the above questions was yes, then you’ve found your problem.
What I mean to say is that if the containers are running and one of them is mapped to the port 9200, which also happens to be the port on which the required services on your Mac listen to by default, then these services cannot run on that port as it is already being used by one of your containers.
Solution: If this is the case, stop the containers and try running your services again

Related

Trouble in Wazuh 4 production cluster (docker) with lostash ouput in elasticsearch

I have the production cluster of Wazuh 4 with open-distro for elasticsearch, kibana and ssl security in docker and I am trying to connect logstash (a docker image of logstash) with elasticsearch and I am getting this:
Attempted to resurrect connection to dead ES instance, but got an error
I have generated ssl certificates for logstash, tried other ways (changed the output of logstash , through filebeat modules) to connect without success.
What is the solution for this problem for Wazuh 4?
Let me help you with this. Our current documentation is valid for distributed architectures where Logstash is installed on the same machine as Elasticsearch, so we should consider adding documentation for the proper configuration of separated Logstash instances.
Ok, now let’s see if we can fix your problem.
After installing Logstash, I assume that you configured it using the distributed configuration file, as seen on this step (Logstash.2.b). Keep in mind that you need to specify the Elasticsearch IP address at the bottom of the file:
output {
elasticsearch {
hosts => ["<PUT_HERE_ELASTICSEARCH_IP>:9200"]
index => "wazuh-alerts-3.x-%{+YYYY.MM.dd}"
document_type => "wazuh"
}
}
After saving the file and restarting the Logstash service, you may be getting this kind of log message on /var/log/logstash/logstash-plain.log:
Attempted to resurrect connection to dead ES instance, but got an error. {:url=>"http://192.168.56.104:9200/", :error_type=>LogStash::Outputs::ElasticSearch::HttpClient::Pool::HostUnreachableError, :error=>"Elasticsearch Unreachable: [http://192.168.56.104:9200/][Manticore::SocketException] Connection refused (Connection refused)"}
I discovered that we need to edit the Elasticsearch configuration file, and modify this setting: network.host. On my test environment, this setting appears commented like this:
#network.host: 192.168.0.1
And I changed it to this:
network.host: 0.0.0.0
(Notice that I removed the # at the beginning of the line). The 0.0.0.0 IP will make Elasticsearch listen on all network interfaces.
After that, I restarted the Elasticsearch service using systemctl restart elasticsearch, and then, I started to see the alerts being indexed on Elasticsearch. Please, try these steps, and let’s see if everything is properly working now.
Let me know if you need more help with this, I’ll be glad to assist you.
Regards,

gitlab docker stop after few seconds because he can't reach postgres anymore

So I'm using Ansible and created the gitlab role a month ago. It worked perfectly. I'm now trying to use it again (it uses the most recent release of gitlab if I understood well) but it stops the docker anytime I start it because of :
PG::ConnectionBad: could not connect to server: Connection refused
Is the server running on host "postgres" (172.18.0.3) and accepting TCP/IP connections on port 5432.
Thing is I added in ufw the rule to allow any proto to this port and it was working a month ago.
Any ideas ?
I found. To anyone having the same issue, i'm gonna set you free x)
The package I install in my dockerfile (postgresql-plpython3-10) upgrade a package named "postgresql" ... and obviously not the same version as I had in my image so it broke everything.
It was working before because the package was by luck the same version as my postgres at this time but not anymore.
Fix : find a way around to disable this upgrade or upgrade your postgres version (minor version are compatible with each other)

How to run Grails application so that other computers on network can access it?

I've developed a Grails application and I want my coworkers to be able to test it. They are on my network so I figure they can access it by using my IP address and the port number (8080). I've tried running it according to the steps laid out here and here to no avail.
I noticed that whenever I run the program, even when I follow those instructions, it says:
Grails application running at http://localhost:8080 in environment: development
Basic networking stuff here.
When something starts on interface 127.0.0.1 port something
Usually that port is then available for all the interfaces on the machine
if you run netstat -plant you will see running ports open on the machine.
Basically what ever ipconfig or ifconfig tells under Linux as your internal interface something like 192.168.1.x
The app is then available on http://192.168.1.x:8080
If you can't access it from other machines on network start by trying to ping {your machine ip}
It sounds like network security stopping local access from 1 machine accessing another.
Or even better still your good old MS firewall try stopping your security stuff on your desktop
It's not clear if you can access the app yourself on your own machine? It should be available at:
http://localhost:8080/appname
Your co-workers should be able to access the app by changing localhost to your computer name:
http://mycomputername:8080/appname

ArangoDB: 'Could not connect to 'tcp://127.0.0.1:8529' 'connect() failed with #10061

Sometimes my ArangoDB is going down with next error:
Error message 'Could not connect to 'tcp://127.0.0.1:8529' 'connect() failed with #10061
I can't understand the reason. It's look like I am turning on my PC and nothing do not work.
Before I fixed this problem with reinstall, but is there any better solution?
OS Windows
ArangoDB 2.8.7
The V8 version used in the pre ArangoDB 3 had occasional troubles in the garbage collection which would make ArangoDB in term go down.
This is fixed with ArangoDB 3.
Please upgrade your installation, and report back whether the problem still persists.
You can use netstat to check whether ArangoDB is listening to its default port 8529:
netstat -a
Active Connections
Proto Lokale Adresse Remoteadresse Status
...
TCP 127.0.0.1:8529 meschenich:0 LISTEN
...
If thats not the case, your client has nothing to connect to.
This could be due to firewall of an antivirus.
In my case it was Avast antivirus that was blocking connecting to that port.
I disabled all the antivirus shields and checked loading arangodb web server
http://127.0.0.1:8529
It connects after few minutes.
Reference : No connection could be made because the target machine actively refused it
I fixed the problem by restarting Windows.

Windows : unable to connect to epmd (port 4369) on sysName: address (cannot connect to host/port)

I have been struggling with starting rabbitmq server on my local (Windows 7) system. It was working for last 1.5 months and then suddenly it started giving me troubles since my last restart of the system.
Error: unable to connect to epmd (port 4369) on sysName: address (cannot connect to host/port)
I added sysName to /etc/hosts file and mapped it with 127.0.0.1.
Opened port 4369 in firewall, but to no use.
Please help!!
You need add your hostname and the ip(not 127.0.0.1) to the /etc/hosts
I could have something to do with files RabbitMQ uses for detecting currently running servers. Try deleting the directory %HOMEPATH%\AppData\Roaming and trying again. But be careful: I'm no RabbitMQ expert, but I guess this may delete important stuff like the database itself, Virtual Hosts, users, etc (but for local development, this saves a lot of headache).

Resources