How to run queries on live data

From Wikitech
Revision as of 19:32, 23 October 2012 by SPage (Talk | contribs)

Jump to: navigation, search

If you need to query the live data (rather than a dump or toolserver mirror), follow the following steps:

  1. Go to http://noc.wikimedia.org/dbtree/ and look for a slave database server that isn't very busy (low lag, few active threads and slow queries) and has the data you need (See https://noc.wikimedia.org/conf/highlight.php?file=db.php)
  2. ssh to fenari
  3. Connect to the slave database server with the syntax 'sql <DBNAME> -h <HOSTNAME>', for example sql enwiki -h db1001
  4. Run your query

You should avoid running queries on the master databases whenever possible. Otherwise you will bog down performance of the live websites. If you absolutely must run a query on a master database, follow the following instructions:

  1. ssh to fenari
  2. Connect to the master database server with the syntax 'sql <DBNAME>', for example sql enwiki
  3. Run your query
Personal tools
Namespaces

Variants
Actions
Navigation
Ops documentation
Wiki
Toolbox