Page MenuHomePhabricator

Create the recommendation api DB in Beta
Closed, ResolvedPublic

Description

For testing purposes, Research would like to store the model predictions used in the recommendation API in a MySQL database to be accessed from the Beta labs.

QPS: 50
Size: 5GB
DB Name: recommendationapi
User: recommendationapi
Accessed from server (s): ?
See T205294: Request to create database and account for recommendation API, T203039: Storage of data for recommendation API, and T205452: Setup access from service to mysql for more info.

Event Timeline

mobrovac created this task.

I don't think we have a backup system in place for deployment-prep DBs?

passwords at deployment-db03:/root/T207795-secrets for the moment, will sort out stuff later

Krenair closed this task as Resolved.EditedOct 24 2018, 8:01 AM

set passwords::recommendationapi::mysql recommendationapi_pass and recommendationapiservice_pass in puppet. DB master is deployment-db03 and slave is deployment-db04

Thanks, @Krenair. Can you also share any documentation on how to connect to the database?

Hi @bmansurov, sure, it's the standard unencrypted MySQL to port 3306 on the above hosts.
It's not as restricted as prod, if you know the password you can connect from anywhere on the labs instances network:

krenair@deployment-deploy01:~$ mysql -u recommendationapi -p -h deployment-db03 recommendationapi
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 1202089
Server version: 10.0.34-MariaDB MariaDB Server

Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [recommendationapi]> show tables;
Empty set (0.00 sec)

Thanks, @Krenair. This is very helpful. Where's the password stored? How can I get it? For the tools database it's stored at $HOME/replica.my.cnf, but this is presumably different?

Where's the password stored?

Well MySQL has the hash of course, but I've put the plain text in deployment-puppetmaster03:/var/lib/git/labs/private/modules/passwords/manifests/init.pp (and also happened to leave a copy in deployment-db03:/root/T207795-secrets while I was working - that may disappear). You shouldn't need to directly interact with the password yourself, as I imagine puppet will just deploy it into the configuration for your service.

How can I get it?

You are a member of the project so should be able to SSH in and use sudo to become root:

# groups bmansurov | grep project-deployment-prep -c
1

For the tools database it's stored at $HOME/replica.my.cnf, but this is presumably different?

Yeah entirely different, this has no relation to tools other than that they both run inside Cloud VPS.

You shouldn't need to directly interact with the password yourself, as I imagine puppet will just deploy it into the configuration for your service.

I want to import some data manually for the service to work.

Thanks again, @Krenair! I was able to get the password.

You shouldn't need to directly interact with the password yourself, as I imagine puppet will just deploy it into the configuration for your service.

I want to import some data manually for the service to work.

Okay, that's probably a good use case for directly using it :)
Just be careful not to show/store anything private to/on it as it's on a labs system.

Just be careful not to show/store anything private to/on it as it's on a labs system.

OK!