Closed Bug 1069249 Opened 10 years ago Closed 6 years ago

Docs: Explain how to view the DB inside a Vagrant instance

Categories

(Tree Management :: Treeherder, defect, P3)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: emorley, Assigned: ghickman)

Details

Attachments

(1 file)

Mauro introduced me to:
python manage.py dbshell

We should add that to:
https://treeherder-service.readthedocs.org/en/latest/installation.html

Ideally we'd also list steps to interact with the DB visually (eg MySQL Workbench, Remote MySQL Viewer) - Mauro is this possible currently? Can we open some ports up on the VM and connect to it from the host?
Flags: needinfo?(mdoglio)
Yes, mysql is bound to 0.0.0.0 here https://github.com/mozilla/treeherder-service/blob/master/puppet/files/mysql/my.cnf#L47
so it's accessible from your host machine on local.treeherder.mozilla.org:3306
Flags: needinfo?(mdoglio)
Ah that's great :-)

We can add that to RTD too.
We should also document connecting to the treeherder prod DB for debugging, a la:

22:49	camd	jeads: sorry to bug ya again. whenever I try ``mysql -u th_user" I get:
22:49	camd	ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
22:49	jeads	camd: are you connected to vpn? and are you specifying the correct host name for mysql to connect to?
22:50	camd	ahh crud. that's it... trying...
22:50	jeads	camd: your command should look like this
22:50	jeads	mysql -h treeherder-ro-vip.metrics.scl3.mozilla.com -u th_user -p
22:51	camd	jeads: that was it. thanks!~
Priority: P2 → P3
No longer blocks: 1072681
Component: Treeherder → Treeherder: Docs & Development
Priority: P3 → P4
Some thing to consider that I hadn't thought of, is that if the user already has MySQL running on the host, they'd need to map 3306 in the VM to a different port on the host, using:
https://docs.vagrantup.com/v2/networking/forwarded_ports.html

Though there's an auto_correct feature that we could enable. (Which outputs adjusted port info to the console on vagrant up).
Assignee: nobody → emorley
Priority: P4 → P3
Assignee: emorley → nobody
Assignee: nobody → ghickman
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Component: Treeherder: Docs & Development → TreeHerder
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: