I am trying to establishing a connection to jdbc:mysql://mysqldb:3306/zomato but it is not working.
I tried 2 differents approach:
at first, I did not want to use Strigo so I was not limited to the 8 hours. So I run my engines in containers within my local machine. The engines are running fine on the Control Hub and I can create and run some pipelines. However, I would like to use the connection cited in one of the lab with mysqldb and zomato. I am not sure how to “install” the zomato db and reviews table locally? I have a container running mysql but from there i dont know what to.
If i try to create the connection using my local engine, i get then the below error.
JDBC_00 - Cannot connect to specified database: com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
I could see a post with the same error message but it does not give the solution on how to get the zomato db and reviews table installed locally?
then I tried to create my engines in Strigo, even if it s not what I would like as an environment. When I then create a connection using the Strigo engine i get the below error message
Please note that i uploaded the mysql jar file as external source for all my engines.
Can you please help?
thank you
Page 1 / 1
@Melanie
The same issue has been raised before and it has been resolved with the correct configuration.
Kindly refer the discussion in the below link and do the necessary setup correctly to fix your issues
Thanks & Regards
Bikram_
@Melanie
The same issue has been raised before and it has been resolved with the correct configuration.
Kindly refer the discussion in the below link and do the necessary setup correctly to fix your issues
Thanks & Regards
Bikram_
Hi Bikram
It is not at all the same error msg so does not solve my issue,
Also as mentioned in my previous message, I could see a post with the same error message but it does not give the solution on how to get the zomato db and reviews table installed locally?
Hello Melanie,
I created the following instructions to install the ‘zomato’ and all the other databases:
onto a new mysql container I create on my MAC M1.
Install mysqldb as a container locally on my pc:
% docker pull arm64v8/mysql
create a mysql account for root/StreamTra1ningSets! in the mysqldb container on my pc:
% docker run --name mysqldb -e MYSQL_ROOT_PASSWORD=StreamTra1ningSets! -d arm64v8/mysql:latest
Copy this file to inside mysqldb container on my pc
% docker cp alldatabases.sql mysqldb:/
Enter the mysqldb container on my pc:
% docker exec -it mysqldb bash
Import database tables into mysql on my pc:
bash# mysql -u root -p -f < alldatabases.sql
-f is used to force the ignorance of :
ERROR 3554 (HY000) at line 609: Access to system table 'mysql.innodb_index_stats' is rejected.
ERROR 3554 (HY000) at line 612: Access to system table 'mysql.innodb_index_stats' is rejected.
ERROR 3554 (HY000) at line 629: Access to system table 'mysql.innodb_index_stats' is rejected.
ERROR 1062 (23000) at line 631: Duplicate entry 'classicmodels-customers-PRIMARY-n_diff_pfx01' for key 'innodb_index_stats.PRIMARY'
ERROR 3554 (HY000) at line 639: Access to system table 'mysql.innodb_table_stats' is rejected.
ERROR 3554 (HY000) at line 642: Access to system table 'mysql.innodb_table_stats' is rejected.
ERROR 3554 (HY000) at line 657: Access to system table 'mysql.innodb_table_stats' is rejected.
ERROR 1062 (23000) at line 659: Duplicate entry 'classicmodels-customers' for key 'innodb_table_stats.PRIMARY'
But all gets imported ok.
Show the database tables now on your pc as in the screenshot at the start of my response.
You will have to add this new container to your container network on your pc:
Check the container networks you have. Mine is called ‘cluster’
% docker network ls
NETWORK ID NAME DRIVER SCOPE
4aba97c1969a bridge bridge local
9c81c7316f3f cluster bridge local
2e6126853c16 docker-kafka-setup_default bridge local
b90a17b0800e host host local
48212a84bfa3 none null local
Add your new container to the network:
% docker network connect cluster mysqldb
Check the contents of ‘cluster’ with:
% docker network inspect cluster
Hope this helps. Let me know what steps may not work for you.
Russ.
@Russ Webb Thank you for your message, it is very detailed and i would never have known how to do all of it
I am currently blocked at step 6 : scp ubuntu@<public ip - get from ‘machine info’ on strigo env - cog icon>:/tmp/alldatabases.sql .
Indeed I run the cmd with the public ip of my strigo env and I get the below error msg:
scp ubuntu@54.71.34.231:/tmp/alldatabases.sql . The authenticity of host '54.71.34.231 (54.71.34.231)' can't be established. ECDSA key fingerprint is SHA256:DA5oGdh5kfOtDURWzjP0ziFrtKWpdZ25NFHcugTPD3s. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '54.71.34.231' (ECDSA) to the list of known hosts. scp: /tmp/alldatabases.sql: No such file or directory
Below is what i have in the /tmp folder of Strigo, so no sql file there.
I also searched for a filename containing database but does not think the alldatabase.sql file is there
Did the academy change the path of the sql file? Did you run the above steps recently in your environment?
Thank you!
ok, first thing:
check in your strigo mysqldb container in /tmp to see if the alldatabases.sql file is there.
If not, redo step 3
Then redo step 4.
Then outside your container on strigo (‘exit’ the container), check to see if the file is in your /tmp folder on strigo.
This is what step 4 did. Sounds like you need to get step 3 and 4 to work to make sure /tmp/alldatabases.sql exists in your main strigo environment.
Let me know how you get on.
@Russ Webb
there is nothing in the tmp folder on Strigo (My mistake i was doing the steps initally locally on my pc)
I redid step 3 and 4 on Strigo and now i can see the sql file in /tmp :)
So now i resumed from step 5 onwards. Even with the ssh key added, i get a permission denied.
locally i did
Then I copy the whole content of my local file /home/melm/.ssh/id_rsa.pub and copy it into strigo. You can see it highlighted in red
Finally i run on my pc the below cmd which is denied due to permissions :(
are you issuing the scp from your home directory (such that you have permissions to put files in there)? or from just /home. ?
ensure you can create a file in the folder you’re issuing the scp command by typing:
touch myFile
to see if you get a permissions problem.
send me the output of:
ls -ld .
@Russ Webb we are def getting there haha. I gave permissions to my folder and indeed that was the issue.
I believe now we have a more problematic issue, the zomato db does not seem to exist … so i wont be able to do the labs for the certifications. See below all the dbs included . It looks very differently to yours any idea how i can get the zomato db?
if you are “Melanie Monnereau” then you are currently registered for a legacy strigo environment (i.e. 3.x).
Which is where these databases are found.
You need to be on the 4.x strigo env. for the zomato db etc.
I have registered you on a 4.x environment.
@Russ Webb thanks, how do i get onto the 4.x environment? I connected again to Strigo but i can see the sql file is still containing the 3.x databases. ty
This should add two containers, your sdc and your mysqldb to the cluster called ‘melanie’.
@Russ Webb my 2 sdc containers and my sqldb container was all in the network bridge so I thought it would be the same than creating another network.
But I did it anyway as you mentioned, now they are all 3 in another network and my SQL connection works! I don’t understand what is different between the bridge network and the melanie network since when I inpected the brigde one, i could see the 3 of them. But in any case, now it finally works yeahhh!!
Thank you very much for all your help and responsiveness!
Differences between user-defined bridges and the default bridge
User-defined bridges provide automatic DNS resolution between containers.
Containers on the default bridge network can only access each other by IP addresses, unless you use the --link option, which is considered legacy. On a user-defined bridge network, containers can resolve each other by name or alias.
so I reckon I’d have to use the ip address 172.18.0.2 rather than mysqldb (in your JDBC connection) although I’ve not tried that.
Hi;
I tried all the steps above to get the databases inside the mysqldb container from Strigo environment to a container in my machine. Here, is the result I got at the end
As, you can see the Zomato database that I need is not present. In order to understand what is wrong, after doing the steps 3 and 4 I checked the size of alldatabases.sql and it looks like it is empty in the strigo environment. I also tried to get into the mysqldb container in the Strigo environment, but I got access denied. I am in the 4x environment. Can you help me find out the problem?
Hi Atousa,
Sounds like you need to redo from step 3 onwards in the procedure.
Check the size of the /tmp/alldatabases.sql directly after step 3.
ls -altr /tmp/alldatabases.sql
Let me know the output of what exactly happens as you redo it.
Russ.
Hi Russ,
I am not sure why it was showing me an empty file even in the Strigo environment before, but now everything is good. I redid everything, and successfully transferred all the databases into my local container.