unable to connect through sync_gateway to remote server - couchbase

I am trying to start sync_gateway from cmd with following command:
sync_gateway -url http://75.76.221.21:8091
I received following error:
20:33:23.014229 WARNING: Error installing Couchbase design doc: Put
http://192.168.2.102:8092/sync_gateway/_design/sync_gateway: dial tcp
192.168.2.102:8092: ConnectEx tcp: A connection attempt failed because the connected party did not properly respond after a period of time,
or established connection failed because connected host has failed to
respond. -- db.installViews() at database.go:29120:33:44.055739
WARNING: Error installing Couchbase design doc: Put
http:/_design/sync_housekeeping: dial tcp 192.168.2.102:8092:
ConnectExtcp: A connection attempt failed because the connected party
did not properly respond after a period of time, or established
connection failed because connected host has failed to respond. --
db.installViews() at database.go:30520:33:44.055739
FATAL: Error opening database: Put
192.168.2.102:8092/omnibazaar/_design/sync_housekeeping: dial tcp 192.168.2.102:8092: ConnectEx tcp: A connection attempt failed because the connected party did not properly respond after a period of time,
or established connection failed because connected host has failed to
respond. -- rest.RunServer() at config.go:415

How did you name your nodes in your Couchbase instance? If you look at the Server Nodes tab, is one of your nodes named "192.168.2.102". I see that from your sync gateway machine, you are trying to reach the Couchbase cluster using the 75.76.221.21 address. Have you checked network connectivity, from your sync gateway machine, try "telnet 192.168.2.102 8092" and see if it connects.
One other thing, it is more common to start sync gateway by redirecting in a configuration file, you can find them in the examples directory. For instance "sync_gateway < examples/config-server.json"

Related

How do I connect to my RDS MySQL instance programmatically?

Problem
I launched a MySQL RDS instance and was able to successfully connect to it using MySQL Workbench. However, I am still not able to connect to it from my local workstation using the following URI:
'mysql+pymysql://user:password#db_identifier.XXXXXXXXXX.us-east-1.rds.amazonaws.com:3306/db_name'
or the same URI without the port:
'mysql+pymysql://user:password#db_identifier.XXXXXXXXXX.us-east-1.rds.amazonaws.com/db_name'
The error that I receive when I specify this as my database URI and execute a db.create_all() command is:
sqlalchemy.exc.OperationalError:
(pymysql.err.OperationalError)
(2003, "Can't connect to MySQL server on 'db_identifier.XXXXXXXXXX.us-east-1.rds.amazonaws.com'
([WinError 10060] A connection attempt failed because the connected party did not
properly respond after a period of time, or established connection failed because
connected host has failed to respond)")
Question
What can I do to connect using pymysql? And why would it connect with MySQL Workbench and not through this URI?
Context
I am following the tutorial here. This uses SQLAlchemy to execute the SQL statements in Python.
The RDS instance (and its associated subnet/VPC) have the following:
a security group open on port 3306
NACL rules that allow incoming and outgoing traffic
Public Accessibility set to "Yes"
Check my answer on this post, it could be something about the "Public accesibility" option in your rds "Connectivity and Security" section as described here;
https://stackoverflow.com/a/63514997/2934184

MXRecord error when running diagnostics on hMailServer

I have downloaded and installed hmailserver. I want to run it on my local machine and want to send email using a local web application which is also running on my local machine. My web application couldn't send email (got error - couldn't connect to mydomain:25) and thus I thought to first run hmailserver's diagnostic tool to test things.
But when I run diagnostics on it, I see the error:
Test: Collect server details
hMailServer version: hMailServer 5.6.7-B2425
Database type: MSSQL Compact
Test: Test IPv6
IPv6 support is available in operating system.
Test: Test outbound port
SMTP relayer not in use. Attempting mail.hmailserver.com:25...
Trying to connect to host mail.hmailserver.com...
Trying to connect to TCP/IP address 5.189.183.138 on port 25.
Received: 220 mail.hmailserver.com ESMTP.
Connected successfully.
Test: Test backup directory
ERROR: Backup directory has not been specified.
Test: Test MX records
Trying to resolve MX records for mydomain.com...
ERROR: MX records for domain mydomain.com could not be resolved
Test: Test local connect
Connecting to TCP/IP address in MX records for local domain domain mydomain.com...
ERROR: MX records for local domain mydomain.com could not be resolved
Test: Test message file locations
Relative message paths are stored in the database for all messages.
Test: Test IP range configuration
No problems were found in the IP range configuration.
To be honest, I don't know what MX Record is and how to set it up. Things I have done so far are:
Installed hmailserver (obviously!)
Added a domain (mydomain.com)
Added an account in mydomain.com (signup#mydomain.com)
In settings->Protocols ->SMTP, I added localhost in Delivery of email ->Localhostname section
In c:\Windows\System32\Drivers\etc\hosts file, I added entry 127.0.0.1 mydomain.com #for play application
When I run netstat -a, I see that hmailserver is listening on port 25 (I tested it using net stop hmailserver and net start hmailserver)
Proto Local Address Foreign Address State
TCP 0.0.0.0:25 DESKTOP-6PLQOLJ:0 LISTENING[/list]
Have I made a mistake?
This Error Message is shown if your Windows Operating system DNS-Resolver Service points to an DNS-Server which doesn't know anything or cannot forward the Query to the DNS-Server in charge for the specified Domain and its MX-Record.
In short terms: Without having your DNS-Domain correctly configured, hMailServer (or any other SMTP-Server) can't work.

`ipfs swarm connect:` connect failure: dial attempt failed: context deadline exceeded

I am using IPFS version 0.4.4.
My goal is to connect two peers in order to prevent IPFS peer to halt on reading an IPFS-hash from the shared peer. In order to achieve it, I am using ipfs swarm connect to connect peer-A to peer-B, where peer-B can access ipfs-file on peer-A.
My question is related to:
ipfs swarm connect /ip4/x.x.x.x/tcp/4003/ipfs/QmXXXXXXXXXXXXXXXXXXX
When I try to connect my laptop to another IPFS-peer, I face with following error:
connect failure: dial attempt failed: context deadline exceeded.
But when I try on an Amazon AWS where all the ports are open, it works, hence swarm connect ended as success.
[Q] In order to make ipfs swarm connect work should API and Gateway port should be open? or should I do something else?
For example should: port 5001 and 8080 be open no matter what?
.ipfs/config file:
"API": "/ip4/127.0.0.1/tcp/5001",
"Gateway": "/ip4/127.0.0.1/tcp/8080",
I believe you don't have to open API and Gateway ports to be able to connect to your peer. Instead, just try checking your connectivity from the outside:
telnet x.x.x.x yyyy
#Trying x.x.x.x...
#Connected to x.x.x.x.
#Escape character is '^]'.
#/multistream/1.0.0
You can see the port in Addresses section of IPFS config, in my case it's 4001:
"Addresses": {
"Swarm": [
"/ip4/0.0.0.0/tcp/4001",
"/ip6/::/tcp/4001"
],
but since the host is behind NAT, the actual IP where it can be accessed can't be detected by IPFS daemon, so I had to put it to Announce section, like
"Announce": ["/ip4/z.z.z.z/tcp/4001"],
After finding the right IP and port, I was able to connect:
ipfs swarm connect /ip4/z.z.z.z/tcp/4001/ipfs/QmXXX_my_peer_id_XXX
#connect QmXXX_my_peer_id_XXX success

mysql farm with haproxy

I want to configure a DB farm in a single node with containers. My idea is to access in each of these DB with a subdomain, for example mysql1.example.com:3306, mysql2.example.com:3306, mysql3.example.com:3306.
I'm trying to implement this model with HAProxy, it seems that the first time that I connect to one database through the HAProxy it works. When I reconnect I get:
ERROR 2013 (HY000): Lost connection to MySQL server at 'reading initial communication packet', system error: 0
The template I use in HAproxy is:
global
maxconn 256
debug
defaults
timeout connect 5000ms
timeout client 50000ms
timeout server 50000ms
listen www
bind *:3306
mode tcp
acl host_mysql hdr(host) -i mysql1.example.com
server mysql_db_1 172.31.20.75:3307
acl host_mysql hdr(host) -i mysql2.example.com
server mysql_db_2 172.31.20.75:3308
acl host_mysql hdr(host) -i mysql3.example.com
server mysql_db_3 172.31.20.75:3309
I auto-respond. It's not possible to create this implemetation due to Mysql uses TCP protocol, so it not include the URL in the header. For this reason HAproxy can't redirect to the correct server.
I'm thinking to implement this environment using virtual IP's assigned to each database. Another implementation would be running all databases in the same server and different ports.

connect asp.net to mysql on linux error of connection

i can't hosting to connect to mysql database on linux i have this error message :
Unable to connect to any of the specified MySQL hosts
i need your help thx; this is my code
I suspect this message came from an exception thrown by your con.Open() call. The message means your attempt to Open() the connection failed because Connector/Net (the .net driver for mySQL) couldn't find the server you asked for. (Never mind the pluralization in "any of the specified MySQL hosts" ; that is for a loadbalancing / failover feature you're probably not using.)
If it took a few seconds for con.Open() to throw the exception, that means there was a timeout. That means the host at x.x.x.x did not respond at all, probably because it's not there or behind a firewall. If you're trying to connect from your home or office to a MySQL server at a hosting service, you may need to go into the hosting service's control panel and whitelist your own machine's IP address.
If Open() threw its exception quickly, it means the host is there, but it is not running a MySQL server.
Pro tip: Always wrap your Open() calls in their own try{}catch(){} clauses; failed database connection attempts are not an unexpected occurrence. Here is an explanation.