GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing wikitech.wikimedia.org — Help:Toolforge/ToolsDB - Wikitech For more information about various Toolforge database offerings, see Help:Toolforge/Database.
For admin documentation about ToolsDB, see Portal:Toolforge/Admin/ToolsDB. Toolforge tools have access to a shared MariaDB server at The credential user is not your user name. It can be found in your $HOME/replica.my.cnf file. The name of the credential user looks something like 'u1234' for a user and 's51234' for a tool account. You can also find the name of the credential user using a live database connection: SELECT SUBSTRING_INDEX(CURRENT_USER(), '@', 1); If your tool needs more than 25GB of storage, open connection limits that ToolsDB cannot support, or a Postgres runtime, Trove databases may be a better fit. ToolsDB is a shared resource that must impose connection and size limitations in exchange for zero administration requirements. Using Trove removes those limitations, but requires a small amount of administration.
Tools can request the ability to create Trove databases via a Toolforge quota-request task. Privileges on the databaseUsers have all privileges and have access to all grant options on their databases. Database names ending with Public databases in ToolsDB (the ones with a name ending in
_p) can also be accessed from Quarry and Superset.
Note that the table names and approximate sizes of all databases, including non-public ones, are publicly visible in the tool-db-usage tool (example). Steps to create a user databaseTo create a database on
You can then connect to your database using: $ mariadb --defaults-file=$HOME/replica.my.cnf -h tools.db.svc.wikimedia.cloud CREDENTIALUSER__DBNAME Or: $ sql tools MariaDB [(none)]> USE CREDENTIALUSER__DBNAME; ExampleAssuming that your tool account is called "mytool", this is what it would look like: maintainer@tools-bastion-NN:~$ become mytool tools.mytool@tools-bastion-NN:~$ mariadb --defaults-file=$HOME/replica.my.cnf -h tools.db.svc.wikimedia.cloud MariaDB [(none)]> select substring_index(current_user(), '@', 1) as uname; +---------------+ | uname | +---------------+ | u123something | +---------------+ 1 row in set (0.00 sec) MariaDB [(none)]> create database u123something__wiki; Caution: The legacy tools-db service name was deprecated in September 2017 and removed in May 2019. Use tools.db.svc.wikimedia.cloud instead.
Note: Some projects like MariaDB [(none)]> CREATE DATABASE CREDENTIALUSER__DBNAME CHARACTER SET utf8; Read-only replica hostWe maintain two copies of the ToolsDB database, using a MariaDB primary-replica setup. The read-only replica host can be accessed using the same credentials and the following hostname: Using the read-only replica host is recommended if you have to run queries that take a long time to complete, as in this way you will reduce the load on the primary host. Please note that the replica host can sometimes lag behind the primary host, but we are doing our best to keep this lag at a minimum. BackupsWe don't do offline backups of any of the databases in ToolsDB. ToolsDB users can backup their data using mariadb-dump (included in the :# use umask to make the dump private (use unless the database is public) $ toolforge jobs run --command 'umask o-r; ( mariadb-dump --defaults-file=$TOOL_DATA_DIR/replica.my.cnf --host=tools-readonly.db.svc.wikimedia.cloud --single-transaction credentialUser__DBName > $TOOL_DATA_DIR/DBname-$(date -I).sql )' --image mariadb backup Note that we don't recommend storing backups permanently on NFS ( CaveatsThe Toolforge team tries to keep ToolsDB configurations as close to MariaDB defaults as possible. This can lead to surprising behaviors, such as:
If you encounter an issue, feel free to add it above. Communication and supportSupport and administration of the WMCS resources is provided by Wikimedia Foundation staff and Wikimedia movement volunteers. Please reach out with questions and join the conversation: Discuss and receive general support
Stay aware of critical changes and plans
Track work tasks and report bugs
Use a subproject of the #Cloud-Services Phabricator project to track confirmed bug reports and feature requests about the Cloud Services infrastructure itself Read stories and WMCS blog posts
Read posts about Cloud Services on the Wikimedia Technical Blog. (Older posts can be read from the Cloud Services Blog.) |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |