Slow JDBC connection when using MySQL in Boot2Docker - docker

I am trying to use Boot2Docker (on Windows) with a standard MySQL image to use this as development database server. On my local machine i can succesfully connect to the MySQL server running inside the container, but when i try to execute some JDBC calls from my host machine it is very slow! It takes 20 to 30 seconds to return from a call.
I forwarded port 3306 to the docker-vm and checked some network settings but i am still unable to identifiy what is causing slow network / jdbc connection.
Any hints on how to solve this?

I solved a similar problem by setting the java.security.egd to a the value file://dev/urandom. My problem was caused by the blocking of the /dev/random device in docker.

Related

Accessing remote redis server with Grafana

I'm trying to access my redis database via Grafana Cloud on my laptop. The database is a redis container working as a cache on a different device (pi). Accessing the Redis database via Python script on my remote device is no problem but trying to connect to it via Grafana (using Redis Datasource Plugin) doesn't work as intended and throws a connection error. Poorly the documentation leaves me kinda clueless whats the specific cause (any missing plugin dependencies?) so I'm thankful for every hint.
To be able to access Redis Server from Grafana Cloud it should be exposed to the Internet as Jan mentioned.
If you run Grafana in Docker container it should be started in the host network mode (https://docs.docker.com/network/host/) to be able to access it from other devices.
If something is lacking or not clear in the Redis plugins documentation, please open an issue and we will update it: https://github.com/RedisGrafana/RedisGrafana/issues

Unable to connect to AWS RDS instance from docker container

On my Windows 10 host machine I am able to connect to a private SQL Server RDS instance running in AWS. However, a Docker container running locally on the same machine is unable to connect with the same connection string.
From the Docker container I am able to telnet to the server on 1433 successfully. However, when I connect from code, it seems to be unable to create a connection. No exception is thrown, but this code hangs:
using (var conn = new SqlConnection(connectionString)){
// Do something
}
I am able to successfully connect to SQL Server when it is running on a EC2 instance. It appears to be specific to RDS.
Fails with both the name and IP address.
This was caused by a bug in SQLClient as described on GitHub. There were two fixes that worked:
Downgrade the project from Net Core 3.1 to 2.2
Update Docker file to use aspnet:3.1-bionic instead of aspnet:3.1-buster-slim and sdk:3.1-bionic instead of sdk:3.1-buster

Neo4j websocket connection timeout on Google Compute Engine

I'm currently running Neo4j on Google Cloud with in a Compute Engine VM running Ubuntu. The 7474 port works as expected, however I'm receiving the following message when trying to connect to server:
WebSocket connection to 'ws://<ip>:7687/' failed: Error in connection establishment: net::ERR_CONNECTION_TIMED_OUT
I checked the conf/neo4j.conf for dbms.connector.bolt.address=0.0.0.0:7687 and it's not commented out.
I checked the firewall, and there is a rule for port 7687, so what else could cause this?
Thanks in advance for the help
Update:
I was able to use the cypher-shell from the VM's command line, which connects to bolt://localhost:7687
It turns out the issue was with neither GCP nor neo4j. The company where I work for has a firewall blocking the port, and that's why I wasn't able to connect to the database using the browser. Dataflow in Compute Engine had no problem connecting to neo4j.

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

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