Consul: An existing connection was forcibly closed by the remote host - consul

when i begin to join the agent to the Consul cluster,it shows the error message..

Related

Cannot create PoolableConnectionFactory (Communications link failure) - Jmeter

I'm trying to test database but it is giving me Cannot create PoolableConnectionFactory (Communications link failure) error.
Response message:java.sql.SQLException: Cannot create PoolableConnectionFactory (Communications link failure)
Jdbc connection configuration:
database url:
jdbc:mysql://codebytenepal.com.np:3306/database_cbn
In order to test whether I'm doing anything wrong or not, I created test db in db4free.net and it worked perfectly.
database url in jdbc connection:
jdbc:mysql://db4free.net:3306/shrestha
This works but the above doesn't. What might be the reason?
Thanks in advance
The host you're trying to reach doesn't have port 3306 open as it evidenced by Nmap report
root#af33db8ee27e:/# nmap codebytenepal.com.np
Starting Nmap 7.60 ( https://nmap.org ) at 2020-10-13 15:53 UTC
Nmap scan report for codebytenepal.com.np (192.3.201.45)
Host is up (0.0016s latency).
Not shown: 965 filtered ports
PORT STATE SERVICE
21/tcp open ftp
22/tcp closed ssh
25/tcp open smtp
26/tcp open rsftp
53/tcp open domain
80/tcp open http
110/tcp open pop3
143/tcp open imap
443/tcp open https
587/tcp open submission
993/tcp open imaps
995/tcp open pop3s
8080/tcp closed http-proxy
8443/tcp closed https-alt
8888/tcp open sun-answerbook
49152/tcp closed unknown
49153/tcp closed unknown
49154/tcp closed unknown
49156/tcp closed unknown
49157/tcp closed unknown
49159/tcp closed unknown
49160/tcp closed unknown
49165/tcp closed unknown
49175/tcp closed unknown
49400/tcp closed compaqdiag
50000/tcp closed ibm-db2
51103/tcp closed unknown
52822/tcp closed unknown
54045/tcp closed unknown
54328/tcp closed unknown
55056/tcp closed unknown
55600/tcp closed unknown
56737/tcp closed unknown
62078/tcp closed iphone-sync
65129/tcp closed unknown
For the other host port 3306 is open:
root#af33db8ee27e:/# nmap -F db4free.net
Starting Nmap 7.60 ( https://nmap.org ) at 2020-10-13 15:58 UTC
Nmap scan report for db4free.net (85.10.205.173)
Host is up (0.016s latency).
Not shown: 96 filtered ports
PORT STATE SERVICE
22/tcp open ssh
80/tcp open http
443/tcp open https
3306/tcp open mysql
Nmap done: 1 IP address (1 host up) scanned in 16.49 seconds
So it's absolutely expected that you cannot establish to the connection to codebytenepal.com.np:3306 as it is not open to the world.
If you absolutely need to test it you need to:
Bind the database server to listen on 192.3.201.45 address
Open port 3306 in your firewall
however be aware that it opens a big security hole in your deployment so revert the changes after you're done with your testing
More information: MySQL Database and JMeter - How to Test Your Connection

postgres: client could not connect to server

For clarification, please note that I have found several similar questions on stackoverflow, but I could not fix my issue.
psql: could not connect to server: Connection refused” Error when connecting to remote database
psql: How to Allow Remote Access to PostgreSQL database
I am trying to connect to a postgres DB installed in a remote server.
To create a connection from the client I am using QGIS plugin (Add PostGIS Layer):
The error that occurs is:
could not connect to server: Connection refused (0x0000274D/10061) is the server running on host "localhost" (::1) and accepting TCP/IP connection on port 5432
Additionally I added the host's IP Adress in the Host field, but then another error message occurs:
could not connect to server: Connection timed out (0x0000274C/10060) Is the server running on host "hosts_ip_adress" and accepting TCP/IP connections on port 5432?
My settings are:
Postgres installed version is 10.0 with PostGIS extension
Host operating System: Windows 7
Client operating System: Windows 7
I edited pg_hba.conf to:
host all all 0.0.0.0/0 md5
and changes listen parameter in 'postgresql.conf' to:
listen_addresses = '*'
both files are located in C:\Program Files\PostgreSQL\10\data
restartet pgAdmin4
My devices are in the same network. Each one is connected via LAN cable.
I suppose that a firewall is preventing the connection?

can't connect to postgres on windows10

I am setting up project on my windows PC and I have a problem with postgres.
Project is set on docker.
when I run docker-compose up I receive error
: *** Failed to connect to database dev; trying to create database
/usr/local/bundle/gems/sequel-4.48.0/lib/sequel/adapters/postgres.rb:224:in `initialize': PG::ConnectionBad: could not connect to server: Connection refused (Sequel::DatabaseConnectionError)
Is the server running on host "localhost" (127.0.0.1) and accepting TCP/IP connections on port 5432?
could not connect to server: Cannot assign requested address
Is the server running on host "localhost" (::1) and accepting TCP/IP connections on port 5432?
I don't know what to do. I have already installed microsoft easy-fix for TCP-IP, shut down windows firewall, changed all connection in pg_hba.conf to trust. Nothing helps. I don't have any antivirus software installed.
nmap report:
Nmap scan report for localhost (127.0.0.1)
Host is up (0.0027s latency).
Other addresses for localhost (not scanned): ::1
Not shown: 995 closed ports
PORT STATE SERVICE
135/tcp open msrpc
445/tcp open microsoft-ds
2068/tcp open avocentkvm
2179/tcp open vmrdp
5432/tcp open postgresql
edit:
I run psql -h localhost and received
psql: CATASTROPHIC: role "Kamil" does not exist
Kamil is my PC name.
edit2:
is it possible that docker doesn't have access to postgres on localhost?
problem solved
I had to set environment var to DB_HOST=docker.for.win.localhost

HC can not connect to DC for EAP7.1

I installed eap7.1 by unzip the zip file on RHEL73, but failed to start host control to connect with domain controller, here is detail:
domain controller runs on node1:
/opt/jboss-eap-7.1/bin/domain.sh --host-config=host-master.xml -Djboss.bind.address.management=192.168.56.11
Log:
[Host Controller] 10:53:53,258 INFO [org.jboss.as.remoting] (MSC service thread 1-4) WFLYRMT0001: Listening on 192.168.56.81:9999
Start host controller on node2:
/opt/jboss-eap-7.1/bin/domain.sh --host-config=host-slave.xml -Djboss.bind.address.management=192.168.56.127 -Djboss.domain.master.address=192.168.56.11
I added remotehost1 by using add-user.sh on node1.
I added the authentication info in host-slave.xml on node2:
<server-identities>
<secret value="cmVkaGF0MUA="/>
</server-identities>
...
<domain-controller>
<remote security-realm="ManagementRealm" username="remotehost1">
host-controller failed startup with the following error:
10:57:17,068 WARN [org.jboss.as.host.controller] (Controller Boot Thread) WFLYHC0001: Could not connect to remote domain controller remote://192.168.56.81:9999: java.net.ConnectException: WFLYPRT0023: Could not connect to remote://192.168.56.81:9999. The connection timed out
...
ERROR [org.jboss.as.host.controller] (Controller Boot Thread) WFLYHC0002: Could not connect to master. Error was: java.lang.IllegalStateException: WFLYHC0120: Tried all domain controller discovery option(s) but unable to connect.
netstat -an|grep 9999 show it's listening on 192.168.56.11(node1 public interface)
I stopped iptables, firewalled and selinux, I used nc -v 192.168.56.11 9999 and verified the address is accessable from node2, what could be the reason for this?
Best regards
Lan
The issue has been fixed.
The test is based on 2 guest VMs runing on window10 as host, windows 10 was restarted and I didn't notice that the firewall on windows was opened after restart, the VM uses host-only adapter to communication with each other, after disable firewall on windows, the communication works.

Nomad client mode ask for consul. Can I ignore this?

Nomad client mode ask for consul.
Can I ignore this or I might deploy consul ?
Is it necessary?
nomad-client_1 |
2017/02/12 08:26:01.008267 [ERR]
client.consul: error reaping services in consul: Get http://127.0.0.1:8500/v1/agent/services: dial tcp 127.0.0.1:8500: getsockopt: connection refused
Consul is not required. From the docs (https://www.nomadproject.io/docs/agent/configuration/consul.html):
"To put it another way: if you have a Consul agent running on the same host as the Nomad agent with the default configuration, Nomad will automatically connect and configure with Consul."

Resources