I'm having php-5.4 scaled app with mysql-5.5. Since it's scaled app mysql is placed on separate gear than app instances.
Since around 03/08/2015 I'm unable to connect to mysql gear, nor my application. I've been trying the following:
Restart all apps and deps with ctl_all.
$ rhc ssh --gears -a loot ctl_all restart
Unable to connect to gear 556c74555973caffa300022c#556c74555973caffa300022c-honourforever.rhcloud.com
(...)
SSH connection to mysql gear.
$ ssh -vvv 556c74555973caffa300022c#556c74555973caffa300022c-honourforever.rhcloud.com
OpenSSH_6.6.1, OpenSSL 1.0.1m 19 Mar 2015
debug2: ssh_connect: needpriv 0
debug1: Connecting to 556c74555973caffa300022c-honourforever.rhcloud.com [54.166.94.12] port 22.
debug1: connect to address 54.166.94.12 port 22: Attempt to connect timed out without establishing a connection
ssh: connect to host 556c74555973caffa300022c-honourforever.rhcloud.com port 22: Bad file number
Check gear storage used percentage.
$ rhc show-app loot --gear quota
Unable to connect to gear
556c74555973caffa300022c#556c74555973caffa300022c-honourforever.rhcloud.com
Gear Cartridges Used Limit
------------------------ ------------------- ----- -----
556b44544382ec7b32000050 haproxy-1.4 php-5.4 92 MB 1 GB
556c74555973caffa300022c mysql-5.5 error 1 GB
Therefore I have no means at the moment to connect to mysql or gear it's sitting on.
Unfortunately this is not a programming problem and cannot be fixed from user side. To fix this problem it is needed to contact OpenShift support.
Related
I have a web app running on Lightsail instances stacked with LAMP (PHP 7/MariaDB 10 service). When I want to connect the instances to a Lightsail database instead of localhost, it works sporadically. The front end reads "cannot connect to MySQL database" and in the database server log I read : [MY-010055] [Server] IP address 'xxx.xxx.xxx.xxx' could not be resolved: Name or service not known" where the IP is the private IP address of my instance.
My instances and database are in the same region. Even though it is not necessary I have tried enabling VPC peering and opening the db to the public.
I can connect to the database using the command line tool: mysql -u uuuu -p -h hhhhh (ie: it is not a problem with entering the wrong credentials)
The web app seems to work with the dedicated Lightsail db server when I am the only one using it and until I open it to more traffic, then I get the connection error.
I have increased the number of max_connections from 65 to 500 using the aws CLI (localhost is 150). My current traffic is 2000 visitors per day.
aws lightsail update-relational-database-parameters --relational-database-name Database-1 --parameters "parameterName=max_connections,parameterValue=500,applyMethod=immediate"
Localhost is Mariadb 10, dedicated database server is MySQL 8
SSL is handled by Cloudflare. There's no SSL on my instance.
I don't want to keep using localhost dbs, I want to centralize my data in a dedicated database.
Does anyone know how to handle this problem?
I want to debug the CUDA code on the remote server, My equipment is as follows:
Pc: Ubuntu 16.04,CUDA 8.0.61,nvcc v8.0.61,Geforce MX150 and integrated graphics
Server: Ubuntu 14.04,CUDA 8.0.61,nvcc v8.0.61,Tesla P100-PCIE*2
I have installed the Nsight Eclipse Edition 7.5 on my pc, What I want is to use the remote debug function that I can use the Visual debug window on my PC and remote gdbserver,But I have encountered some problems.
When I configure remote debugging to try to connect to a remote server,the Connection timed out return from the connection.
I don't know if it's related to the port. When I log in to the server, it looks like this:
SSH -P 50034 username#xxx.xxx.xxx.xxx
When setting up the connection, I noticed that port 2345 seems to be used, so I don't know if there is a conflict.The setting page is like this:
So far,I have tried the following:
Reinstall the Nsight Eclipse Edition,and debug sample code on the server in the command line which runs correctly.
Some forums mention that port 2345 should be opened,AFAIK,You can use this port as long as the port is not occupied when requested,but,I am not sure about it.
Considering that the server has certain restrictions on the visitor's IP address,so I tried to change the network several times but failed in the end.
Any ideas?
This problem was finally solved and I got a sigh of relief.
Since my server is in a cluster, ports are mapped. For example, the command when connecting to the server the port id should be attached with (i.e.ssh -p 50034 uesrname#xxx.xxx.xxx.xxx), so when the nsight eclipse edition's port 2345 (default) accesses the server, it does not recognize the port, then the time out delay is given, so I mapped the port 2345 to the server's port 2345, The map roughly as shown below:
-A PREROUTING -d xxx.xxx.xxx.xxx -p tcp -m tcp --dport 2345 -j DNAT --to-destination xxx.xxx.xxx.xxx:2345
The first xxx.xxx.xxx.xxx is the server's IP adress while the last one is the real adress of ur server in the cluster such as 11.11.11.24,which is Owing to the different conditions.
I am trying to have a container running in Bluemix. I have cf version 6.15, and I want to deploy a docker file I have a connection failed. Any experience around to help me with this? I appreciate in advance.
The commands I am running from windows are the following:
c:\build>cf login -u myusername -o myusername -s myspace
All authentication at this point is ok.
c:\build>cf ic login
And I have this error:
Client certificates are being retrieved from IBM Containers...
FAILED
Put https://containers-api.ng.bluemix.net:8443/v3/tlskey/refresh: dial tcp
198.23.117.148:8443: 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.
In particular, I am trying to do the following coding which I followed step by step.
Also, this is a Windows 7 and I have no docker for windows installed (not sure it is needed). Many thanks!
My app was stuck on connecting to Database gear for almost few day now.
I have tried almost 2 days to search, but it seem no luck.
Could anyone help!
What I have tried:
ssh in to main gear (application gear) is ok, but fail when trying manually connect to mysql.
$mysql
ERROR 2003 (HY000): Can't connect to MySQL server on '559e8e625973cad7d10001b5-jobboardkh.rhcloud.com' (111)
telnet
$telnet 559e8e625973cad7d10001b5-jobboardkh.rhcloud.com 48986
Trying 54.159.182.108...
telnet: connect to address 54.159.182.108: Connection refused
port-forward on my local and I tried to connect as it worked before, but now it's not work
ssh to mysql gear also not able to connect
If you can't ssh into the gear then the gear probably isn't running. Try restarting the MySQL gear via:
rhc cartridge restart -a {appName} -c mysql-5.1
I have waited to get the support from Openshift for several days, but at last I decided to remove out that database gear and recreated it. So all my data was lost.
resolution for preventing database gear is down and data will lost, is to have a daily backup schedule for database and store it in the main gear.
The Setup
I am currently using the Premium Wordpress Hosting provided by MediaTemple. I have a very large data-set to import and I was hoping to get direct access to the database via an SSH tunnel.
--------------- ------------------- ------------
| My Machine | ---- SSH TUNNEL -----| Hosting Server | -- -- ? -- -- | Database |
--------------- ------------------- ------------
What Works
If I ssh into the Hosting Server and from the shell on the Hosting Provider, connect to mysql like this, I am able to get into MySQL.
mysql -uuser -ppassword -h123.456.789.1 -P3308
What Does Not Work
However, if I try to connect to MySQL using the -L flag with SSH to create a tunnel, I am unable to connect to the server.
ssh me#hostingserver.net -L 7002:123.456.789.1:3308
From a shell on My Machine:
mysql -uuser -ppassword -h127.0.0.1 -P7002
I get the following error:
ERROR 2013 (HY000): Lost connection to MySQL server at 'reading initial communication packet', system error: 0
From reading other answers (StackOverflow , StackOverflow), I have reasoned that the issue stems from the IP address with which MySQL client tries to bind. I think that the ip address attach to the request to connect, when executed on my machine, is not on the white-list of the Database Server.
Is there anyway to get direct access to the MySQL Database from My Machine. From a system administration perspective, I obiviously have enough access to connect to the MySQL database from the shell but I cannot run the client on My Machine. I have a very large dataset that I would like to transfer from My Machine to Database. I would also like to be able access the database and exicute SQL whenever I need to. This and the large dataset kind of eliminates the possibility of just using a the source command from the MySQL Client on Hosting Server. What is the best workaround to give me something close to the ability to run SQL on the Database from My Machine?
I encountered roughly the same issue. That is, I simply could not connect to the MySQL server, even though I had successfully tunneled to the remote host.
TLDR: it was an iptables issue involving the loopback interface
In my situation, mysqld was running on the same VPS as sshd. However, the MySQL instance was bound only to 127.0.0.1 and listening on the default port. As you did, I confirmed that I could connect to the mysqld instance on the remote machine using the credentials used locally.
Here is the tunnel:
ssh -v -N -L 33306:127.0.0.1:3306 sshuser#sshanddbvps.org
Here is the connection string to the mysqld instance using the mysql client:
mysql -umysqluser -h127.0.0.1 -P 33306 -p
Even though ssh indicated that the connection was successful...
debug1: Connection to port 33306 forwarding to 127.0.0.1 port 3306 requested.
...the mysql client connection would error out after accepting the correct password with the message you mentioned:
ERROR 2013 (HY000): Lost connection to MySQL server at 'reading initial communication packet'...
To check that data was flowing across the loopback interface, I logged into the remote server and ran three commands in three separate shells:
while true; do echo -e "HTTP/1.1 200 OK\n\n $(date)" | nc -l 127.0.0.1 1234; done
tcpdump -i lo src 127.0.0.1 -or dst 127.0.0.1
nc 127.0.0.1 1234
After running the third, output from the second command appeared:
13:59:14.474552 IP localhost.36146 > localhost.1234: Flags [S], seq 1149798272, win 43690, options [mss 65495,sackOK,TS val 48523264 ecr 0,nop,wscale 7], length 0
But nothing indicating that packets were flowing in the reverse direction.
Inserting a rule in the INPUT chain of the firewall that allowed traffic from the default loopback address solved the issue:
iptables -I INPUT 4 -i lo -s 127.0.0.1 -j ACCEPT