BigCouch error: "couldn't connect to host" when joinning a node - couchdb

I try to setup 2 nodes with BigCouch. I set FQDN on /etc/hostname on 2 machines (example: may2.test.com). I also edited /opt/bigcouch/etc/vm.args:
-name bigcouch#may2.test.com
-setcookie monster (as default)
Then I try:
curl localhost:5984 ->
{"couchdb":"Welcome","version":"1.1.1","bigcouch":"0.4.2"}
curl localhost:5986 -> {"couchdb":"Welcome","version":"1.1.1"}
curl may2.test.com:5984 ->
{"couchdb":"Welcome","version":"1.1.1","bigcouch":"0.4.2"}
curl may2.test.com:5986 -> curl: (7) couldn't connect to host
Anyone can give me some ideas to fix it & make BigCouch work perfectly? Thank you alot

I aslo fixed this error:
Remove CouchDB. BigCouch ‘s enough.
because I install BigCouch on localhost, my query must like:
curl -X PUT http://localhost:5986/nodes/bigcouch#slave3.test.com -d {}

In your configuration file /opt/bigcouch/etc/default.ini
in the section [httpd] set bind_address = 0.0.0.0 and then sudo sv restart bigcouch

Related

curl always connects to a specific ip:port pair

I'm running into this scenario on one of our linux boxes.
$ curl 10.200.20.66:8087/ping
curl: (7) Failed to connect to 219.135.102.36 port 8118: Connection timed out
$ curl 114.114.114.114:80/x
curl: (7) Failed to connect to 219.135.102.36 port 8118: Connection timed out
As you can see, curl has always been trying to connect 219.135.102.36:8118.
I've tried using nc and telnet and both of them give correct results.
Finally I've turned to strace curl 10.200.20.66:8087/ping and here's output.
Can anybody help explain why this happened?
To be sure what is happening, turn on verbosity with -v switch:
$ http_proxy=1.2.3.4:8080 curl -v http://google.com
* About to connect() to proxy 1.2.3.4 port 8080 (#0)
* Trying 1.2.3.4...
* Connection timed out
* couldn't connect to host
* Closing connection #0
curl: (7) couldn't connect to host
In your case, I'd guess that Curl tries to use proxy. If that is the case, you should check the following:
http_proxy environment variable:
Check:
env | grep -i proxy
Curl configuration file ~/.curlrc (unlikely, it doesn't show in strace)
Proxy can be proxided on command line (-x or --proxy), so check if curl isn't aliased in your shell
Curl should be used with website, http,https,ftp.
example curl "http://www.google.com"
it provides the output in html format
Kindly check and try in correct format

curl: (7) Failed to connect to port 80, and 443 - on one domain

This question shows research effort; it is useful and clear
I have checked the cURL not working properly
When I run the command curl -I https://www.example.com/sitemap.xml
curl: (7) Failed to connect
Failed to connect on all port
this error only on one domain, all other domain working fine, curl: (7) Failed to connect to port 80, and 443
Thanks...
First Check your /etc/hosts file entries, may be the URL which You're requesting, is pointing to your localhost.
If the URL is not listed in your /etc/hosts file, then try to execute following command to understand the flow of Curl Execution for the particular URL:
curl --ipv4 -v "https://example.com/";
After many search, I found that Hosts settings not correct
Then I check nano /etc/hosts
The Domain point to wrong IP in hosts file
I change the wrong IP and its working Fine
This is new error Related to curl: (7) Failed to connect
curl: (7) Failed to connect
The above error message means that your web-server (at least the one specified with curl) is not running at all — no web-server is running on the specified port and the specified (or implied) port. (So, XML doesn't have anything to do with that.)
you can download the key with browser
then open terminal in downloads
then type sudo apt-key add <key_name>.asc
Mine is Red Hat Enterprise(RHEL) Virtual Machine and I was getting something like the following.
Error "curl: (7) Failed to connect to localhost port 80: Connection refused"
I stopped the firewall by running the following commands and it started working.
sudo systemctl stop firewalld
sudo systemctl disable firewalld
If the curl is to the outside world, like:
curl www.google.com
I have to restart my cntlm service:
systemctl restart cntlm
If it's within my network:
curl inside.server.local
Then a docker network is overlapping something with my CNTLM proxy, and I just remove all docker networks to fix it - you can also just remove the last network you just created, but I'm lazy.
docker network rm $(docker network ls -q)
And then I can work again.

wget a local HTTPS site? Can I set the IP wget should use to connect to the site?

wget is trying to connect at 127.0.0.1 but it doesn't work. Is it possible to set the IP address wget should connect to without changing my /etc/hosts
Changing the /etc/hosts creates all sorts of other problems.
I'm running Debian 8 and I get:
ERROR: The certificate of ‘example.com’ is not trusted.
I suppose a way to accept unsigned certificates would also do.
Thanks very much!
Try --no-check-certificate option with wget.

Curl : connection refused

I got the following error while running curl:
curl: (7) Failed to connect to 127.0.0.1 port 8080: Connection
refused.
It seems that it is easy to debug, but, I didnt find how to solve it.
The adress 127.0.0.1 is mentioned in the file etc/hosts.
I am using curl version 7.47 on Ubuntu system.
Anyone has an idea about it ?
Thank you.
Make sure you have a service started and listening on the port.
netstat -ln | grep 8080
and
sudo netstat -tulpn
Try curl -v http://localhost:8080/ instead of 127.0.0.1
Listen to the port in one session and then open another session to test it with l$ curl -v http://localhost:8080/
It should work. That's how I worked although in l
Termux
You have to start the server first, before using curl. On 8/10 occasions that error message arises from not starting the server initially.
127.0.0.1 restricts access on every interface on port 8000 except development computer. change it to 0.0.0.0:8000 this will allow connection from curl.

Localhost, [::1], and mapped hosts in etc/hosts work, but 127.0.0.1 does not

The great mystery. I have an Express/Node (v4.2.2) JS app running on OS X El Capitan. The app is running on port 4444. If I run the app, I'm able to get the proper response back with the following commands:
curl localhost:4444 -> Works
curl [::1]:4444 -> Works
curl api.q.com:4444 -> Works
However, I have a problem with:
curl 127.0.0.1:4444 -> Doesn't Work; Responds with curl: (52) Empty reply from server
127.0.0.1:4444 fails in all browsers as well. Even more astonishing, api.q.com:4444 works in all browsers EXCEPT for Chrome.
My /etc/hosts file:
127.0.0.1 localhost web.q.com api.q.com qrm.q.com fhr.q.com
::1 localhost
fe80::1%lo0 localhost
I've tried resetting my /etc/hosts file back to the default and flushed my DNS cache. I have a feeling it might be the app, but I'm not sure what the cause could be. Any suggestions?
Turns out, it had something to do with a Linux VM I set up in Virtual Box. My /etc/hosts file was the same on that VM (maybe that was the issue?).
I disabled the VM and everything worked again. I have no idea what the cause was, but I'm going to close this question. If anyone else has this issue, I can only suggest look at any VMs you may have running locally. Thanks again!

Resources