{"id":545,"date":"2021-08-04T00:00:00","date_gmt":"2021-08-04T00:00:00","guid":{"rendered":"https:\/\/en.pingcap.com\/blog\/how-to-deploy-tidb-on-google-cloud-platform-part-2\/"},"modified":"2025-03-04T06:54:20","modified_gmt":"2025-03-04T14:54:20","slug":"how-to-deploy-tidb-on-google-cloud-platform-part-2","status":"publish","type":"post","link":"https:\/\/www.pingcap.com\/ko\/blog\/how-to-deploy-tidb-on-google-cloud-platform-part-2\/","title":{"rendered":"How to Deploy TiDB on Google Cloud Platform\u2014Part 2"},"content":{"rendered":"<h2><span class=\"ez-toc-section\" id=\"Overview\"><\/span>Overview<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Welcome to the second of a two-part blog series on getting a simple TiDB cluster up and running on Google Cloud Platform. The goal is to let you quickly set up TiDB and become familiar with its benefits. In <a href=\"https:\/\/pingcap.com\/blog\/how-to-deploy-tidb-on-google-cloud-platform-part-1\">Part 1<\/a>, we created a GCP instance. Here in Part 2, we will install, configure, and run TiDB on that instance.<\/p>\n<p>By the end of this article, your architecture may look similar to the following:<\/p>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-25519\" src=\"https:\/\/static.pingcap.com\/files\/2021\/08\/04065213\/tidb-gcp-reference-architecture.png\" alt=\"tidb-gcp-reference-architecture\" width=\"1306\" height=\"702\" srcset=\"https:\/\/static.pingcap.com\/files\/2021\/08\/04065213\/tidb-gcp-reference-architecture.png 1306w, https:\/\/static.pingcap.com\/files\/2021\/08\/04065213\/tidb-gcp-reference-architecture-300x161.png 300w, https:\/\/static.pingcap.com\/files\/2021\/08\/04065213\/tidb-gcp-reference-architecture-1024x550.png 1024w, https:\/\/static.pingcap.com\/files\/2021\/08\/04065213\/tidb-gcp-reference-architecture-768x413.png 768w\" sizes=\"auto, (max-width: 1306px) 100vw, 1306px\" \/>\n<div class=\"caption-center\">A TiDB\/GCP reference architecture<\/div>\n<p>In <a href=\"https:\/\/pingcap.com\/blog\/how-to-deploy-tidb-on-google-cloud-platform-part-1\">Part 1<\/a>, we focused on the Prerequisite Operations of setting up and configuring GCP in order to run TiDB. (See the image below.) Now, we will actually set up and run TiDB.<\/p>\n<img loading=\"lazy\" decoding=\"async\" width=\"1537\" height=\"520\" class=\"wp-image-546\" src=\"https:\/\/en.pingcap.com\/wp-content\/uploads\/2021\/08\/run-tidb-on-google-cloud-platform-instance.png\" alt=\"Run TiDB on a Google Cloud Platform instance\" srcset=\"https:\/\/static.pingcap.com\/files\/2021\/08\/run-tidb-on-google-cloud-platform-instance.png 1537w, https:\/\/static.pingcap.com\/files\/2021\/08\/run-tidb-on-google-cloud-platform-instance-300x101.png 300w, https:\/\/static.pingcap.com\/files\/2021\/08\/run-tidb-on-google-cloud-platform-instance-1024x346.png 1024w, https:\/\/static.pingcap.com\/files\/2021\/08\/run-tidb-on-google-cloud-platform-instance-768x260.png 768w, https:\/\/static.pingcap.com\/files\/2021\/08\/run-tidb-on-google-cloud-platform-instance-1440x487.png 1440w\" sizes=\"auto, (max-width: 1537px) 100vw, 1537px\" \/>\n<div class=\"caption-center\">Run TiDB on a Google Cloud Platform instance<\/div>\n<h2><span class=\"ez-toc-section\" id=\"Before_you_begin\"><\/span>Before you begin<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>In <a href=\"https:\/\/pingcap.com\/blog\/how-to-deploy-tidb-on-google-cloud-platform-part-1\">Part 1<\/a> we had set up the following:<\/p>\n<ul>\n<li>GCP instance<\/li>\n<li>gcloud associated with a User Account<\/li>\n<li>Private keys<\/li>\n<li>Open ports for TiDB<\/li>\n<li>Local computer with MacOS or Linux operating system<\/li>\n<\/ul>\n<p>If you have not yet set these up, or are having any issues, please refer to Part 1. Also, your local computer will need to be a MacOS or Linux operating system. First, let&#8217;s check that things are set up correctly.<\/p>\n<h3>SSH into GCP Instance<\/h3>\n<p>If you haven&#8217;t securely logged into your GCP instance, do so now:<\/p>\n<pre><code>gcloud compute ssh --zone \"us-west1-a\" \"tidb-vm\"\n<\/code><\/pre>\n<p>Notice that the server we SSH into has a prompt that references the tidb-vm instance.<\/p>\n<img loading=\"lazy\" decoding=\"async\" width=\"1619\" height=\"828\" class=\"wp-image-547\" src=\"https:\/\/en.pingcap.com\/wp-content\/uploads\/2021\/08\/prompt-tidb-vm-instance.jpg\" alt=\"tidb-vm instance\" srcset=\"https:\/\/static.pingcap.com\/files\/2021\/08\/prompt-tidb-vm-instance.jpg 1619w, https:\/\/static.pingcap.com\/files\/2021\/08\/prompt-tidb-vm-instance-300x153.jpg 300w, https:\/\/static.pingcap.com\/files\/2021\/08\/prompt-tidb-vm-instance-1024x524.jpg 1024w, https:\/\/static.pingcap.com\/files\/2021\/08\/prompt-tidb-vm-instance-768x393.jpg 768w, https:\/\/static.pingcap.com\/files\/2021\/08\/prompt-tidb-vm-instance-1536x786.jpg 1536w, https:\/\/static.pingcap.com\/files\/2021\/08\/prompt-tidb-vm-instance-1440x736.jpg 1440w\" sizes=\"auto, (max-width: 1619px) 100vw, 1619px\" \/>\n<h3>gcloud account<\/h3>\n<p>Let&#8217;s check the account that gcloud is associated with:<\/p>\n<img loading=\"lazy\" decoding=\"async\" width=\"1422\" height=\"268\" class=\"wp-image-548\" src=\"https:\/\/en.pingcap.com\/wp-content\/uploads\/2021\/08\/check-account.png\" alt=\"Check the account\" srcset=\"https:\/\/static.pingcap.com\/files\/2021\/08\/check-account.png 1422w, https:\/\/static.pingcap.com\/files\/2021\/08\/check-account-300x57.png 300w, https:\/\/static.pingcap.com\/files\/2021\/08\/check-account-1024x193.png 1024w, https:\/\/static.pingcap.com\/files\/2021\/08\/check-account-768x145.png 768w\" sizes=\"auto, (max-width: 1422px) 100vw, 1422px\" \/>\n<img loading=\"lazy\" decoding=\"async\" width=\"1464\" height=\"510\" class=\"wp-image-549\" src=\"https:\/\/en.pingcap.com\/wp-content\/uploads\/2021\/08\/registered-email-address.png\" alt=\"Registered email address\" srcset=\"https:\/\/static.pingcap.com\/files\/2021\/08\/registered-email-address.png 1464w, https:\/\/static.pingcap.com\/files\/2021\/08\/registered-email-address-300x105.png 300w, https:\/\/static.pingcap.com\/files\/2021\/08\/registered-email-address-1024x357.png 1024w, https:\/\/static.pingcap.com\/files\/2021\/08\/registered-email-address-768x268.png 768w, https:\/\/static.pingcap.com\/files\/2021\/08\/registered-email-address-1440x502.png 1440w\" sizes=\"auto, (max-width: 1464px) 100vw, 1464px\" \/>\n<p>Once you see your registered email address, that confirms that you are running under the correct user account.<\/p>\n<h3>SSH keys<\/h3>\n<p>Let&#8217;s check which SSH keys we have available:<\/p>\n<pre><code>ls -al .ssh\/\n<\/code><\/pre>\n<img loading=\"lazy\" decoding=\"async\" width=\"1499\" height=\"311\" class=\"wp-image-550\" src=\"https:\/\/en.pingcap.com\/wp-content\/uploads\/2021\/08\/check-ssh-keys.png\" alt=\"Check SSH keys\" srcset=\"https:\/\/static.pingcap.com\/files\/2021\/08\/check-ssh-keys.png 1499w, https:\/\/static.pingcap.com\/files\/2021\/08\/check-ssh-keys-300x62.png 300w, https:\/\/static.pingcap.com\/files\/2021\/08\/check-ssh-keys-1024x212.png 1024w, https:\/\/static.pingcap.com\/files\/2021\/08\/check-ssh-keys-768x159.png 768w, https:\/\/static.pingcap.com\/files\/2021\/08\/check-ssh-keys-1440x299.png 1440w\" sizes=\"auto, (max-width: 1499px) 100vw, 1499px\" \/>\n<p>The primary file we are interested in is the <code>google_compute_engine<\/code>, which is the private key that TiUP will use for SSH.<\/p>\n<h3>TiDB ports<\/h3>\n<p>We should have a firewall rule that grants our local computer access to TiDB components (TiDB Dashboard, Grafana, Prometheus, and the SQL interface). Let&#8217;s check the rules with the following command:<\/p>\n<pre><code>gcloud compute firewall-rules list\n<\/code><\/pre>\n<img loading=\"lazy\" decoding=\"async\" width=\"1419\" height=\"249\" class=\"wp-image-539\" src=\"https:\/\/en.pingcap.com\/wp-content\/uploads\/2021\/08\/firewall-rule.png\" alt=\"Firewall rule\" srcset=\"https:\/\/static.pingcap.com\/files\/2021\/08\/firewall-rule.png 1419w, https:\/\/static.pingcap.com\/files\/2021\/08\/firewall-rule-300x53.png 300w, https:\/\/static.pingcap.com\/files\/2021\/08\/firewall-rule-1024x180.png 1024w, https:\/\/static.pingcap.com\/files\/2021\/08\/firewall-rule-768x135.png 768w\" sizes=\"auto, (max-width: 1419px) 100vw, 1419px\" \/>\n<p>In Part 1, we had created the firewall rule <code>access-from-home<\/code>. GCP automatically created the other firewall rules. This should provide us a comfort level that the GCP instance is set up correctly to run TiDB.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Install_TiUP\"><\/span>Install TiUP<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>TiUP is a package manager that makes it easier to manage different cluster components in the TiDB ecosystem.<\/p>\n<img loading=\"lazy\" decoding=\"async\" width=\"1392\" height=\"657\" class=\"wp-image-551\" src=\"https:\/\/en.pingcap.com\/wp-content\/uploads\/2021\/08\/install-tiup.png\" alt=\"Install TiUP\" srcset=\"https:\/\/static.pingcap.com\/files\/2021\/08\/install-tiup.png 1392w, https:\/\/static.pingcap.com\/files\/2021\/08\/install-tiup-300x142.png 300w, https:\/\/static.pingcap.com\/files\/2021\/08\/install-tiup-1024x483.png 1024w, https:\/\/static.pingcap.com\/files\/2021\/08\/install-tiup-768x362.png 768w\" sizes=\"auto, (max-width: 1392px) 100vw, 1392px\" \/>\n<div class=\"caption-center\">Install TiUP<\/div>\n<p>TiUP references:<\/p>\n<ul>\n<li><a href=\"https:\/\/docs.pingcap.com\/tidb\/stable\/tiup-overview\">TiUP Overview<\/a><\/li>\n<li><a href=\"https:\/\/docs.pingcap.com\/tidb\/stable\/production-deployment-using-tiup#deploy-tiup-offline\">Deploy a TiDB Cluster Offline Using TiUP<\/a><\/li>\n<li><a href=\"https:\/\/docs.pingcap.com\/tidb\/stable\/production-deployment-using-tiup\">Deploy a TiDB Cluster Using TiUP<\/a><\/li>\n<li><a href=\"https:\/\/docs.pingcap.com\/tidb\/stable\/quick-start-with-tidb\">Quick Start Guide for the TiDB Database Platform<\/a><\/li>\n<\/ul>\n<p>We don&#8217;t want to accidentally install TiUP and TiDB on our local computer, so let&#8217;s confirm that we are on the GCP instance. In the image below, notice that the command prompt prefix includes <strong>tidb-vm<\/strong>. This lets us know that we are on the GCP instance.<\/p>\n<p>Next, let&#8217;s install TiUP:<\/p>\n<pre><code>curl --proto '=https' --tlsv1.2 -sSf https:\/\/tiup-mirrors.pingcap.com\/install.sh | sh\n<\/code><\/pre>\n<img loading=\"lazy\" decoding=\"async\" width=\"1399\" height=\"410\" class=\"wp-image-552\" src=\"https:\/\/en.pingcap.com\/wp-content\/uploads\/2021\/08\/tiup-installed-path.jpg\" alt=\"TiUP installed path\" srcset=\"https:\/\/static.pingcap.com\/files\/2021\/08\/tiup-installed-path.jpg 1399w, https:\/\/static.pingcap.com\/files\/2021\/08\/tiup-installed-path-300x88.jpg 300w, https:\/\/static.pingcap.com\/files\/2021\/08\/tiup-installed-path-1024x300.jpg 1024w, https:\/\/static.pingcap.com\/files\/2021\/08\/tiup-installed-path-768x225.jpg 768w\" sizes=\"auto, (max-width: 1399px) 100vw, 1399px\" \/>\n<p>Notice that the <code>.bashrc<\/code> file was updated to include the path to the TiUP working directory that was created in our home directory under <code>.tiup\/<\/code>.<\/p>\n<p>Since the path has been updated in the <code>.bashrc<\/code>, we need to reload it by running the following command, which will not display any output:<\/p>\n<pre><code>source .bashrc\n<\/code><\/pre>\n<img loading=\"lazy\" decoding=\"async\" width=\"1421\" height=\"58\" class=\"wp-image-553\" src=\"https:\/\/en.pingcap.com\/wp-content\/uploads\/2021\/08\/reload-path.png\" alt=\"Reload the path\" srcset=\"https:\/\/static.pingcap.com\/files\/2021\/08\/reload-path.png 1421w, https:\/\/static.pingcap.com\/files\/2021\/08\/reload-path-300x12.png 300w, https:\/\/static.pingcap.com\/files\/2021\/08\/reload-path-1024x42.png 1024w, https:\/\/static.pingcap.com\/files\/2021\/08\/reload-path-768x31.png 768w\" sizes=\"auto, (max-width: 1421px) 100vw, 1421px\" \/>\n<p>As a sanity check, let&#8217;s make sure that TiUP is installed:<\/p>\n<pre><code>tiup -v\n<\/code><\/pre>\n<pre><code>tiup cluster list\n<\/code><\/pre>\n<img loading=\"lazy\" decoding=\"async\" width=\"1354\" height=\"344\" class=\"wp-image-554\" src=\"https:\/\/en.pingcap.com\/wp-content\/uploads\/2021\/08\/make-sure-tiup-installed.png\" alt=\"Make sure that TiUP is installed\" srcset=\"https:\/\/static.pingcap.com\/files\/2021\/08\/make-sure-tiup-installed.png 1354w, https:\/\/static.pingcap.com\/files\/2021\/08\/make-sure-tiup-installed-300x76.png 300w, https:\/\/static.pingcap.com\/files\/2021\/08\/make-sure-tiup-installed-1024x260.png 1024w, https:\/\/static.pingcap.com\/files\/2021\/08\/make-sure-tiup-installed-768x195.png 768w\" sizes=\"auto, (max-width: 1354px) 100vw, 1354px\" \/>\n<p>Notice the output for the <strong>tiup cluster list<\/strong> command. Here we can see that TiUP has been installed, and there are currently no TiDB clusters running. Your version of TiUP will probably be different.<\/p>\n<p><strong>Create a TiDB topology configuration file<\/strong><\/p>\n<img loading=\"lazy\" decoding=\"async\" width=\"1390\" height=\"566\" class=\"wp-image-555\" src=\"https:\/\/en.pingcap.com\/wp-content\/uploads\/2021\/08\/create-tiup-topology.png\" alt=\"Create a TiUP topology file\" srcset=\"https:\/\/static.pingcap.com\/files\/2021\/08\/create-tiup-topology.png 1390w, https:\/\/static.pingcap.com\/files\/2021\/08\/create-tiup-topology-300x122.png 300w, https:\/\/static.pingcap.com\/files\/2021\/08\/create-tiup-topology-1024x417.png 1024w, https:\/\/static.pingcap.com\/files\/2021\/08\/create-tiup-topology-768x313.png 768w\" sizes=\"auto, (max-width: 1390px) 100vw, 1390px\" \/>\n<div class=\"caption-center\">Create a TiUP topology file<\/div>\n<p>We use TiUP to deploy and scale the TiDB ecosystem. A topology file is a configuration file that identifies the components that will be deployed and on which server they will be deployed.<\/p>\n<p>Let&#8217;s create the topology.yaml file. This topology file is fairly simple and tells TiUP to do the following:<\/p>\n<ul>\n<li>Create a new Linux user called tidb.<\/li>\n<li>Manage the cluster over SSH Port 22.<\/li>\n<li>Deploy TiDB components to the directory <code>\/home\/tidb\/tidb-deploy<\/code>.<\/li>\n<li>Store data in the directory <code>\/home\/tidb\/tidb-data<\/code>.<\/li>\n<li>Install and run the following components all on the server with IP 127.0.0.1 (localhost):\n<ul>\n<li>Placement Driver (PD)<\/li>\n<li>TiDB<\/li>\n<li>TiKV<\/li>\n<li>Monitoring Server<\/li>\n<li>Grafana Server<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<pre><code>vim topology.yaml\n<\/code><\/pre>\n<p>Copy and paste the following into the topology.yaml file:<\/p>\n<pre><code>global:\n  user: \"tidb\"\n  ssh_port: 22\n  deploy_dir: \"\/home\/tidb\/tidb-deploy\"\n  data_dir: \"\/home\/tidb\/tidb-data\"\nserver_configs: {}\npd_servers:\n  - host: 127.0.0.1\ntidb_servers:\n  - host: 127.0.0.1\ntikv_servers:\n  - host: 127.0.0.1\nmonitoring_servers:\n  - host: 127.0.0.1\ngrafana_servers:\n  - host: 127.0.0.1\nalertmanager_servers:\n  - host: 127.0.0.1\n<\/code><\/pre>\n<p>Note that all the IP addresses are 127.0.0.1 (localhost). We are installing one instance of each component on the same computer (localhost). We do this on purpose to create an environment to test the different components.<\/p>\n<p>To deploy a TiDB cluster, we use the TiUP command <code>tiup cluster<\/code>. Below is a check argument that does dry run to validate the topology.yaml file and determine whether ssh access is sufficient.<\/p>\n<p>In <a href=\"https:\/\/pingcap.com\/blog\/how-to-deploy-tidb-on-google-cloud-platform-part-1\">Part 1<\/a>, we created the Google private key for SSH. We will use this private key in the command below with the parameter <code>--identity_file<\/code>.<\/p>\n<p>We include a reference the topology.yaml file:<\/p>\n<pre><code>tiup cluster check --identity_file ~\/.ssh\/google_compute_engine topology.yaml\n<\/code><\/pre>\n<p>Since we are doing a quick test, don&#8217;t worry about the output of Pass, Fail, and Warn status.<\/p>\n<p>You want to see output similar to the following:<\/p>\n<img loading=\"lazy\" decoding=\"async\" width=\"1288\" height=\"861\" class=\"wp-image-556\" src=\"https:\/\/en.pingcap.com\/wp-content\/uploads\/2021\/08\/google-compute-engine-topology.jpg\" alt=\"google_compute_engine topology\" srcset=\"https:\/\/static.pingcap.com\/files\/2021\/08\/google-compute-engine-topology.jpg 1288w, https:\/\/static.pingcap.com\/files\/2021\/08\/google-compute-engine-topology-300x201.jpg 300w, https:\/\/static.pingcap.com\/files\/2021\/08\/google-compute-engine-topology-1024x685.jpg 1024w, https:\/\/static.pingcap.com\/files\/2021\/08\/google-compute-engine-topology-768x513.jpg 768w\" sizes=\"auto, (max-width: 1288px) 100vw, 1288px\" \/>\n<p>If things didn&#8217;t work correctly, you may see certain error messages, as in the results below. Notice that on the command line I misspelled the private key name. TiUP couldn&#8217;t find it and raised an error. If you do see this error, please reference <a href=\"https:\/\/pingcap.com\/blog\/how-to-deploy-tidb-on-google-cloud-platform-part-1#create-ssh-keys-for-tiup\">creating SSH Keys in Part 1<\/a>.<\/p>\n<img loading=\"lazy\" decoding=\"async\" width=\"1419\" height=\"345\" class=\"wp-image-557\" src=\"https:\/\/en.pingcap.com\/wp-content\/uploads\/2021\/08\/tiup-error.png\" alt=\"TiUP raised an error\" srcset=\"https:\/\/static.pingcap.com\/files\/2021\/08\/tiup-error.png 1419w, https:\/\/static.pingcap.com\/files\/2021\/08\/tiup-error-300x73.png 300w, https:\/\/static.pingcap.com\/files\/2021\/08\/tiup-error-1024x249.png 1024w, https:\/\/static.pingcap.com\/files\/2021\/08\/tiup-error-768x187.png 768w\" sizes=\"auto, (max-width: 1419px) 100vw, 1419px\" \/>\n<h2><span class=\"ez-toc-section\" id=\"Deploy_TiDB_using_TiUP\"><\/span>Deploy TiDB using TiUP<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>In the previous section we did a dry run. Now, let&#8217;s use TiUP to deploy TiDB.<\/p>\n<img loading=\"lazy\" decoding=\"async\" width=\"1416\" height=\"660\" class=\"wp-image-558\" src=\"https:\/\/en.pingcap.com\/wp-content\/uploads\/2021\/08\/deploy-tidb-using-tiup.png\" alt=\"Deploy TiDB\" srcset=\"https:\/\/static.pingcap.com\/files\/2021\/08\/deploy-tidb-using-tiup.png 1416w, https:\/\/static.pingcap.com\/files\/2021\/08\/deploy-tidb-using-tiup-300x140.png 300w, https:\/\/static.pingcap.com\/files\/2021\/08\/deploy-tidb-using-tiup-1024x477.png 1024w, https:\/\/static.pingcap.com\/files\/2021\/08\/deploy-tidb-using-tiup-768x358.png 768w\" sizes=\"auto, (max-width: 1416px) 100vw, 1416px\" \/>\n<div class=\"caption-center\">Deploy TiDB<\/div>\n<p>For a deployment, we need to add a few additional parameters. The main parameters are identified below:<\/p>\n<pre><code>tiup cluster deploy tidb-test v5.0.1 -i ~\/.ssh\/google_compute_engine topology.yaml\n<\/code><\/pre>\n<p>Here&#8217;s a breakdown of the command:<\/p>\n<img loading=\"lazy\" decoding=\"async\" width=\"1421\" height=\"212\" class=\"wp-image-559\" src=\"https:\/\/en.pingcap.com\/wp-content\/uploads\/2021\/08\/command-breakdown.png\" alt=\"Breakdown of the command\" srcset=\"https:\/\/static.pingcap.com\/files\/2021\/08\/command-breakdown.png 1421w, https:\/\/static.pingcap.com\/files\/2021\/08\/command-breakdown-300x45.png 300w, https:\/\/static.pingcap.com\/files\/2021\/08\/command-breakdown-1024x153.png 1024w, https:\/\/static.pingcap.com\/files\/2021\/08\/command-breakdown-768x115.png 768w\" sizes=\"auto, (max-width: 1421px) 100vw, 1421px\" \/>\n<p>You&#8217;ll see a prompt &#8220;Do you want to continue? [y\/N]&#8221;. Type <code>y<\/code> to continue.<\/p>\n<img loading=\"lazy\" decoding=\"async\" width=\"1072\" height=\"880\" class=\"wp-image-560\" src=\"https:\/\/en.pingcap.com\/wp-content\/uploads\/2021\/08\/prompt-continue.jpg\" alt=\"Prompt &amp;quot;Do you want to continue? [y\/N]&amp;quot;\" srcset=\"https:\/\/static.pingcap.com\/files\/2021\/08\/prompt-continue.jpg 1072w, https:\/\/static.pingcap.com\/files\/2021\/08\/prompt-continue-300x246.jpg 300w, https:\/\/static.pingcap.com\/files\/2021\/08\/prompt-continue-1024x841.jpg 1024w, https:\/\/static.pingcap.com\/files\/2021\/08\/prompt-continue-768x630.jpg 768w\" sizes=\"auto, (max-width: 1072px) 100vw, 1072px\" \/>\n<p>We successfully deployed a TiDB cluster, but have not yet started the cluster.<\/p>\n<p>Let&#8217;s do a sanity check and confirm which cluster is being managed by TiUP:<\/p>\n<pre><code>tiup cluster list\n<\/code><\/pre>\n<p>The output should include the cluster name, path, and private key.<\/p>\n<p>We should see only the one cluster that we deployed.<\/p>\n<p>Let&#8217;s see the details of the tidb-test cluster:<\/p>\n<pre><code>tiup cluster display tidb-test\n<\/code><\/pre>\n<img loading=\"lazy\" decoding=\"async\" width=\"1405\" height=\"284\" class=\"wp-image-561\" src=\"https:\/\/en.pingcap.com\/wp-content\/uploads\/2021\/08\/tidb-test-details.png\" alt=\"Details of the tidb-test cluster\" srcset=\"https:\/\/static.pingcap.com\/files\/2021\/08\/tidb-test-details.png 1405w, https:\/\/static.pingcap.com\/files\/2021\/08\/tidb-test-details-300x61.png 300w, https:\/\/static.pingcap.com\/files\/2021\/08\/tidb-test-details-1024x207.png 1024w, https:\/\/static.pingcap.com\/files\/2021\/08\/tidb-test-details-768x155.png 768w\" sizes=\"auto, (max-width: 1405px) 100vw, 1405px\" \/>\n<p>We haven&#8217;t started TiDB and its components, so it is offline with the statuses of inactive, down, and N\/A. Before we start TiDB, I like to see which service ports are open on the GCP instance. These ports are assigned to processes that run on the GCP instance, and are different from the GCP firewall rules that we had created. After we start TiDB, we will run this command again and see which ports are associated with the different TiDB processes.<\/p>\n<p>By default, Google GCP instances have assigned these ports to these processes:<\/p>\n<pre><code>sudo netstat -tulpn | grep LISTEN\n<\/code><\/pre>\n<img loading=\"lazy\" decoding=\"async\" width=\"1415\" height=\"132\" class=\"wp-image-562\" src=\"https:\/\/en.pingcap.com\/wp-content\/uploads\/2021\/08\/ports-assigned-to-processes.png\" alt=\"Ports assigned to processes\" srcset=\"https:\/\/static.pingcap.com\/files\/2021\/08\/ports-assigned-to-processes.png 1415w, https:\/\/static.pingcap.com\/files\/2021\/08\/ports-assigned-to-processes-300x28.png 300w, https:\/\/static.pingcap.com\/files\/2021\/08\/ports-assigned-to-processes-1024x96.png 1024w, https:\/\/static.pingcap.com\/files\/2021\/08\/ports-assigned-to-processes-768x72.png 768w\" sizes=\"auto, (max-width: 1415px) 100vw, 1415px\" \/>\n<h2><span class=\"ez-toc-section\" id=\"Start_TiDB_and_components\"><\/span>Start TiDB and components<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<img loading=\"lazy\" decoding=\"async\" width=\"1524\" height=\"732\" class=\"wp-image-563\" src=\"https:\/\/en.pingcap.com\/wp-content\/uploads\/2021\/08\/start-tidb.png\" alt=\"Start TiDB\" srcset=\"https:\/\/static.pingcap.com\/files\/2021\/08\/start-tidb.png 1524w, https:\/\/static.pingcap.com\/files\/2021\/08\/start-tidb-300x144.png 300w, https:\/\/static.pingcap.com\/files\/2021\/08\/start-tidb-1024x492.png 1024w, https:\/\/static.pingcap.com\/files\/2021\/08\/start-tidb-768x369.png 768w, https:\/\/static.pingcap.com\/files\/2021\/08\/start-tidb-1440x692.png 1440w\" sizes=\"auto, (max-width: 1524px) 100vw, 1524px\" \/>\n<div class=\"caption-center\">Start TiDB<\/div>\n<p>Let&#8217;s start the TiDB ecosystem using <code>tiup cluster<\/code>:<\/p>\n<pre><code>tiup cluster start tidb-test\n<\/code><\/pre>\n<img loading=\"lazy\" decoding=\"async\" width=\"1068\" height=\"794\" class=\"wp-image-564\" src=\"https:\/\/en.pingcap.com\/wp-content\/uploads\/2021\/08\/start-tidb-ecosystem.jpg\" alt=\"Start the TiDB ecosystem\" srcset=\"https:\/\/static.pingcap.com\/files\/2021\/08\/start-tidb-ecosystem.jpg 1068w, https:\/\/static.pingcap.com\/files\/2021\/08\/start-tidb-ecosystem-300x223.jpg 300w, https:\/\/static.pingcap.com\/files\/2021\/08\/start-tidb-ecosystem-1024x761.jpg 1024w, https:\/\/static.pingcap.com\/files\/2021\/08\/start-tidb-ecosystem-768x571.jpg 768w\" sizes=\"auto, (max-width: 1068px) 100vw, 1068px\" \/>\n<p>There&#8217;s a lot going on here, but the key is that there are no errors being shown.<\/p>\n<p>As a sanity check, let&#8217;s see the details of the tidb-test cluster using the display parameter:<\/p>\n<pre><code>tiup cluster display tidb-test\n<\/code><\/pre>\n<img loading=\"lazy\" decoding=\"async\" width=\"1412\" height=\"300\" class=\"wp-image-565\" src=\"https:\/\/en.pingcap.com\/wp-content\/uploads\/2021\/08\/display-parameter.png\" alt=\"Details of the tidb-test cluster\" srcset=\"https:\/\/static.pingcap.com\/files\/2021\/08\/display-parameter.png 1412w, https:\/\/static.pingcap.com\/files\/2021\/08\/display-parameter-300x64.png 300w, https:\/\/static.pingcap.com\/files\/2021\/08\/display-parameter-1024x218.png 1024w, https:\/\/static.pingcap.com\/files\/2021\/08\/display-parameter-768x163.png 768w\" sizes=\"auto, (max-width: 1412px) 100vw, 1412px\" \/>\n<p>As we can see, all the components are up and running.<\/p>\n<p>Let&#8217;s see which ports and services are available:<\/p>\n<pre><code>sudo netstat -tulpn | grep LISTEN\n<\/code><\/pre>\n<img loading=\"lazy\" decoding=\"async\" width=\"1828\" height=\"752\" class=\"wp-image-566\" src=\"https:\/\/en.pingcap.com\/wp-content\/uploads\/2021\/08\/available-ports-and-services.jpg\" alt=\"Available ports and services\" srcset=\"https:\/\/static.pingcap.com\/files\/2021\/08\/available-ports-and-services.jpg 1828w, https:\/\/static.pingcap.com\/files\/2021\/08\/available-ports-and-services-300x123.jpg 300w, https:\/\/static.pingcap.com\/files\/2021\/08\/available-ports-and-services-1024x421.jpg 1024w, https:\/\/static.pingcap.com\/files\/2021\/08\/available-ports-and-services-768x316.jpg 768w, https:\/\/static.pingcap.com\/files\/2021\/08\/available-ports-and-services-1536x632.jpg 1536w, https:\/\/static.pingcap.com\/files\/2021\/08\/available-ports-and-services-1440x592.jpg 1440w\" sizes=\"auto, (max-width: 1828px) 100vw, 1828px\" \/>\n<p>There are many processes running that have TCP ports associated with them. In the image above, I&#8217;ve highlighted the ports that we opened with the GCP firewall rule.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Lets_connect\"><\/span>Let&#8217;s connect<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>In this section we will access the following components from a browser on our local computer:<\/p>\n<ul>\n<li>TiDB Dashboard<\/li>\n<li>Grafana<\/li>\n<li>Prometheus<\/li>\n<li>SQL client<\/li>\n<\/ul>\n<p>Also, we will use a local SQL client to access TiDB and run a few SQL commands. To access the TiDB components that are running on our GCP instance from our local computer, we will need the external IP address of our GCP instance:<\/p>\n<pre><code>gcloud compute instances list\n<\/code><\/pre>\n<img loading=\"lazy\" decoding=\"async\" width=\"1695\" height=\"123\" class=\"wp-image-520\" src=\"https:\/\/en.pingcap.com\/wp-content\/uploads\/2021\/08\/gcloud-compute-instances-list.png\" alt=\"gcloud compute instances list\" srcset=\"https:\/\/static.pingcap.com\/files\/2021\/08\/gcloud-compute-instances-list.png 1695w, https:\/\/static.pingcap.com\/files\/2021\/08\/gcloud-compute-instances-list-300x22.png 300w, https:\/\/static.pingcap.com\/files\/2021\/08\/gcloud-compute-instances-list-1024x74.png 1024w, https:\/\/static.pingcap.com\/files\/2021\/08\/gcloud-compute-instances-list-768x56.png 768w, https:\/\/static.pingcap.com\/files\/2021\/08\/gcloud-compute-instances-list-1536x111.png 1536w, https:\/\/static.pingcap.com\/files\/2021\/08\/gcloud-compute-instances-list-1440x104.png 1440w\" sizes=\"auto, (max-width: 1695px) 100vw, 1695px\" \/>\n<p>Here we can see that the GCP instance&#8217;s external IP address is 34.83.139.90. (Your IP address will be different.) We will use this IP address from our browser on our local computer.<\/p>\n<h3>TiDB Dashboard<\/h3>\n<p>In a browser on your local computer, provide the URL that starts with your GCP instance IP address, port number 2379, and, at the end, add <code>\/dashboard<\/code>. My URL is <a href=\"http:\/\/34.83.139.90:2379\/dashboard\">http:\/\/34.83.139.90:2379\/dashboard<\/a>. The IP address for your GCP instance will be different.<\/p>\n<p>You shouldn&#8217;t need to login, so go ahead and click the &#8220;Sign In&#8221; button:<\/p>\n<img loading=\"lazy\" decoding=\"async\" width=\"1693\" height=\"791\" class=\"wp-image-567\" src=\"https:\/\/en.pingcap.com\/wp-content\/uploads\/2021\/08\/tidb-dashboard-sign-in.jpg\" alt=\"TiDB Dashboard sign-in\" srcset=\"https:\/\/static.pingcap.com\/files\/2021\/08\/tidb-dashboard-sign-in.jpg 1693w, https:\/\/static.pingcap.com\/files\/2021\/08\/tidb-dashboard-sign-in-300x140.jpg 300w, https:\/\/static.pingcap.com\/files\/2021\/08\/tidb-dashboard-sign-in-1024x478.jpg 1024w, https:\/\/static.pingcap.com\/files\/2021\/08\/tidb-dashboard-sign-in-768x359.jpg 768w, https:\/\/static.pingcap.com\/files\/2021\/08\/tidb-dashboard-sign-in-1536x718.jpg 1536w, https:\/\/static.pingcap.com\/files\/2021\/08\/tidb-dashboard-sign-in-1440x673.jpg 1440w\" sizes=\"auto, (max-width: 1693px) 100vw, 1693px\" \/>\n<div class=\"caption-center\">TiDB Dashboard sign-in<\/div>\n<p>Here&#8217;s the TiDB Dashboard. To learn more about the dashboard, see our <a href=\"https:\/\/docs.pingcap.com\/tidb\/stable\/tidb-monitoring-framework\">online documentation<\/a>.<\/p>\n<img loading=\"lazy\" decoding=\"async\" width=\"1385\" height=\"711\" class=\"wp-image-568\" src=\"https:\/\/en.pingcap.com\/wp-content\/uploads\/2021\/08\/tidb-dashboard-gcp.png\" alt=\"TiDB Dashboard\" srcset=\"https:\/\/static.pingcap.com\/files\/2021\/08\/tidb-dashboard-gcp.png 1385w, https:\/\/static.pingcap.com\/files\/2021\/08\/tidb-dashboard-gcp-300x154.png 300w, https:\/\/static.pingcap.com\/files\/2021\/08\/tidb-dashboard-gcp-1024x526.png 1024w, https:\/\/static.pingcap.com\/files\/2021\/08\/tidb-dashboard-gcp-768x394.png 768w\" sizes=\"auto, (max-width: 1385px) 100vw, 1385px\" \/>\n<div class=\"caption-center\">TiDB Dashboard<\/div>\n<h3>Grafana<\/h3>\n<p>To access Grafana, create a URL and use your GCP instance&#8217;s public IP address with port 3000. My URL is <a href=\"http:\/\/34.83.139.90:3000\/\">http:\/\/34.83.139.90:3000\/<\/a>. Your IP address will be different.<\/p>\n<p>Login to Grafana using <code>admin<\/code> for both the username and password.<\/p>\n<img loading=\"lazy\" decoding=\"async\" width=\"1578\" height=\"782\" class=\"wp-image-569\" src=\"https:\/\/en.pingcap.com\/wp-content\/uploads\/2021\/08\/grafana-log-in.png\" alt=\"Grafana log-in\" srcset=\"https:\/\/static.pingcap.com\/files\/2021\/08\/grafana-log-in.png 1578w, https:\/\/static.pingcap.com\/files\/2021\/08\/grafana-log-in-300x149.png 300w, https:\/\/static.pingcap.com\/files\/2021\/08\/grafana-log-in-1024x507.png 1024w, https:\/\/static.pingcap.com\/files\/2021\/08\/grafana-log-in-768x381.png 768w, https:\/\/static.pingcap.com\/files\/2021\/08\/grafana-log-in-1536x761.png 1536w, https:\/\/static.pingcap.com\/files\/2021\/08\/grafana-log-in-1440x714.png 1440w\" sizes=\"auto, (max-width: 1578px) 100vw, 1578px\" \/>\n<div class=\"caption-center\">Grafana log-in<\/div>\n<p>You may be prompted to change your password. I selected &#8220;Skip&#8221; since this is a temporary system that only I have access to with my local computer.<\/p>\n<img loading=\"lazy\" decoding=\"async\" width=\"1625\" height=\"710\" class=\"wp-image-570\" src=\"https:\/\/en.pingcap.com\/wp-content\/uploads\/2021\/08\/grafana-change-password.png\" alt=\"Grafana Change Password\" srcset=\"https:\/\/static.pingcap.com\/files\/2021\/08\/grafana-change-password.png 1625w, https:\/\/static.pingcap.com\/files\/2021\/08\/grafana-change-password-300x131.png 300w, https:\/\/static.pingcap.com\/files\/2021\/08\/grafana-change-password-1024x447.png 1024w, https:\/\/static.pingcap.com\/files\/2021\/08\/grafana-change-password-768x336.png 768w, https:\/\/static.pingcap.com\/files\/2021\/08\/grafana-change-password-1536x671.png 1536w, https:\/\/static.pingcap.com\/files\/2021\/08\/grafana-change-password-1440x629.png 1440w\" sizes=\"auto, (max-width: 1625px) 100vw, 1625px\" \/>\n<div class=\"caption-center\">Grafana Change Password<\/div>\n<p>The initial Grafana Dashboard should look something like this:<\/p>\n<img loading=\"lazy\" decoding=\"async\" width=\"1588\" height=\"856\" class=\"wp-image-571\" src=\"https:\/\/en.pingcap.com\/wp-content\/uploads\/2021\/08\/initial-grafana-dashboard.png\" alt=\"Initial Grafana Dashboard\" srcset=\"https:\/\/static.pingcap.com\/files\/2021\/08\/initial-grafana-dashboard.png 1588w, https:\/\/static.pingcap.com\/files\/2021\/08\/initial-grafana-dashboard-300x162.png 300w, https:\/\/static.pingcap.com\/files\/2021\/08\/initial-grafana-dashboard-1024x552.png 1024w, https:\/\/static.pingcap.com\/files\/2021\/08\/initial-grafana-dashboard-768x414.png 768w, https:\/\/static.pingcap.com\/files\/2021\/08\/initial-grafana-dashboard-1536x828.png 1536w, https:\/\/static.pingcap.com\/files\/2021\/08\/initial-grafana-dashboard-1440x776.png 1440w\" sizes=\"auto, (max-width: 1588px) 100vw, 1588px\" \/>\n<div class=\"caption-center\">Grafana Dashboard<\/div>\n<h3>Prometheus<\/h3>\n<p>To access Prometheus, create a URL and use your GCP instance&#8217;s public IP address with port 9090. For me, the URL will be <a href=\"http:\/\/34.83.139.90:9090\">http:\/\/34.83.139.90:9090<\/a>. Your IP address will be different.<\/p>\n<p>You should not need a user ID or password.<\/p>\n<img loading=\"lazy\" decoding=\"async\" width=\"1582\" height=\"744\" class=\"wp-image-572\" src=\"https:\/\/en.pingcap.com\/wp-content\/uploads\/2021\/08\/prometheus-dashboard.png\" alt=\"Prometheus Dashboard\" srcset=\"https:\/\/static.pingcap.com\/files\/2021\/08\/prometheus-dashboard.png 1582w, https:\/\/static.pingcap.com\/files\/2021\/08\/prometheus-dashboard-300x141.png 300w, https:\/\/static.pingcap.com\/files\/2021\/08\/prometheus-dashboard-1024x482.png 1024w, https:\/\/static.pingcap.com\/files\/2021\/08\/prometheus-dashboard-768x361.png 768w, https:\/\/static.pingcap.com\/files\/2021\/08\/prometheus-dashboard-1536x722.png 1536w, https:\/\/static.pingcap.com\/files\/2021\/08\/prometheus-dashboard-1440x677.png 1440w\" sizes=\"auto, (max-width: 1582px) 100vw, 1582px\" \/>\n<div class=\"caption-center\">Prometheus Dashboard<\/div>\n<h3>MySQL Client<\/h3>\n<p>In <a href=\"https:\/\/pingcap.com\/blog\/how-to-deploy-tidb-on-google-cloud-platform-part-1\">Part 1<\/a>, we installed a MySQL Client on the GCP Instance. Now, let&#8217;s use the MySQL Client to connect to TiDB.<\/p>\n<p>TiDB SQL interface default port is 4000.<\/p>\n<p>From our GCP instance, run the following command. This command will start a MySQL Client and connect to 127.0.0.1 (localhost) on port 4000 with the username <code>root<\/code>:<\/p>\n<pre><code>mysql -h 127.0.0.1 -P 4000 -u root\n<\/code><\/pre>\n<img loading=\"lazy\" decoding=\"async\" width=\"1764\" height=\"598\" class=\"wp-image-573\" src=\"https:\/\/en.pingcap.com\/wp-content\/uploads\/2021\/08\/start-mysql-client.jpg\" alt=\"Start a MySQL Client\" srcset=\"https:\/\/static.pingcap.com\/files\/2021\/08\/start-mysql-client.jpg 1764w, https:\/\/static.pingcap.com\/files\/2021\/08\/start-mysql-client-300x102.jpg 300w, https:\/\/static.pingcap.com\/files\/2021\/08\/start-mysql-client-1024x347.jpg 1024w, https:\/\/static.pingcap.com\/files\/2021\/08\/start-mysql-client-768x260.jpg 768w, https:\/\/static.pingcap.com\/files\/2021\/08\/start-mysql-client-1536x521.jpg 1536w, https:\/\/static.pingcap.com\/files\/2021\/08\/start-mysql-client-1440x488.jpg 1440w\" sizes=\"auto, (max-width: 1764px) 100vw, 1764px\" \/>\n<p>Now we should have a <code>mysql&gt;<\/code> prompt. Let&#8217;s run a few commands:<\/p>\n<pre><code>SELECT VERSION();\n<\/code><\/pre>\n<pre><code>SHOW DATABASES;\n<\/code><\/pre>\n<pre><code>exit\n<\/code><\/pre>\n<img loading=\"lazy\" decoding=\"async\" width=\"1494\" height=\"733\" class=\"wp-image-574\" src=\"https:\/\/en.pingcap.com\/wp-content\/uploads\/2021\/08\/run-commands.png\" alt=\"Run a few commands\" srcset=\"https:\/\/static.pingcap.com\/files\/2021\/08\/run-commands.png 1494w, https:\/\/static.pingcap.com\/files\/2021\/08\/run-commands-300x147.png 300w, https:\/\/static.pingcap.com\/files\/2021\/08\/run-commands-1024x502.png 1024w, https:\/\/static.pingcap.com\/files\/2021\/08\/run-commands-768x377.png 768w, https:\/\/static.pingcap.com\/files\/2021\/08\/run-commands-1440x707.png 1440w\" sizes=\"auto, (max-width: 1494px) 100vw, 1494px\" \/>\n<p>If you already have a MySQL Client or other tool, you can use it to access TiDB over port 4000. Just remember to use the GCP instance public IP address.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Wrap_up\"><\/span>Wrap up<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><strong>Congratulations! You have gotten a simple TiDB cluster up and running.<\/strong> Now, you can access monitoring tools that include TiDB Dashboard, Grafana, and Prometheus.<\/p>\n<p>You now have a foundation to learn more about TiDB and try things out.<\/p>\n<p>If you are done with the GCP instance, you can tear it down by following the steps below.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Tear_down\"><\/span>Tear down<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>The easiest way to tear down this environment is by deleting the GCP instance.<\/p>\n<p>From our local computer, let&#8217;s get a list of GCP instances. We will then destroy (delete) the tidb-vm instance and then confirm the instance has been deleted.<\/p>\n<p>From your local computer, run the following gcloud commands.<\/p>\n<p>The delete command may take a few minutes to complete.<\/p>\n<pre><code>gcloud compute instances list\n<\/code><\/pre>\n<pre><code>gcloud compute instances delete tidb-vm\n<\/code><\/pre>\n<pre><code>gcloud compute instances list\n<\/code><\/pre>\n<img loading=\"lazy\" decoding=\"async\" width=\"1598\" height=\"588\" class=\"wp-image-575\" src=\"https:\/\/en.pingcap.com\/wp-content\/uploads\/2021\/08\/delete-tidb-vm-instance.jpg\" alt=\"Delete the tidb-vm instance\" srcset=\"https:\/\/static.pingcap.com\/files\/2021\/08\/delete-tidb-vm-instance.jpg 1598w, https:\/\/static.pingcap.com\/files\/2021\/08\/delete-tidb-vm-instance-300x110.jpg 300w, https:\/\/static.pingcap.com\/files\/2021\/08\/delete-tidb-vm-instance-1024x377.jpg 1024w, https:\/\/static.pingcap.com\/files\/2021\/08\/delete-tidb-vm-instance-768x283.jpg 768w, https:\/\/static.pingcap.com\/files\/2021\/08\/delete-tidb-vm-instance-1536x565.jpg 1536w, https:\/\/static.pingcap.com\/files\/2021\/08\/delete-tidb-vm-instance-1440x530.jpg 1440w\" sizes=\"auto, (max-width: 1598px) 100vw, 1598px\" \/>\n<p>Let&#8217;s remove the firewall rule that we created. In the commands below, we first get a list of firewall rules. Then, we delete the firewall rule access-from-home, and then validate that the rule was deleted.<\/p>\n<pre><code>gcloud compute firewall-rules list\n<\/code><\/pre>\n<pre><code>gcloud compute firewall-rules delete access-from-home\n<\/code><\/pre>\n<pre><code>gcloud compute firewall-rules list\n<\/code><\/pre>\n<img loading=\"lazy\" decoding=\"async\" width=\"1640\" height=\"779\" class=\"wp-image-576\" src=\"https:\/\/en.pingcap.com\/wp-content\/uploads\/2021\/08\/remove-firewall-rule.jpg\" alt=\"Remove the firewall rule\" srcset=\"https:\/\/static.pingcap.com\/files\/2021\/08\/remove-firewall-rule.jpg 1640w, https:\/\/static.pingcap.com\/files\/2021\/08\/remove-firewall-rule-300x143.jpg 300w, https:\/\/static.pingcap.com\/files\/2021\/08\/remove-firewall-rule-1024x486.jpg 1024w, https:\/\/static.pingcap.com\/files\/2021\/08\/remove-firewall-rule-768x365.jpg 768w, https:\/\/static.pingcap.com\/files\/2021\/08\/remove-firewall-rule-1536x730.jpg 1536w, https:\/\/static.pingcap.com\/files\/2021\/08\/remove-firewall-rule-1440x684.jpg 1440w\" sizes=\"auto, (max-width: 1640px) 100vw, 1640px\" \/>\n<p>Your GCP environment should be cleaned up and back to its original state.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This post shows how to install, configure, and run TiDB on a Google Cloud Platform instance.<\/p>","protected":false},"author":63,"featured_media":544,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"ub_ctt_via":"","footnotes":""},"categories":[13],"tags":[15,29],"class_list":["post-545","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-product","tag-cloud","tag-tutorial"],"acf":[],"featured_image_src":"https:\/\/static.pingcap.com\/files\/2021\/08\/deploy-tidb-on-google-cloud-platform-1-scaled.jpg","author_info":{"display_name":"Mike Barlow","author_link":"https:\/\/www.pingcap.com\/ko\/blog\/author\/mike-barlow\/"},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Deploy TiDB on Google Cloud Platform\u2014Part 2 | TiDB<\/title>\n<meta name=\"description\" content=\"Learn about the benefits of TiDB and the TiDB Cloud solutions from PingCAP. Read our latest post &quot;How to Deploy TiDB on Google Cloud Platform\u2014Part 2&quot; here.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.pingcap.com\/ko\/blog\/how-to-deploy-tidb-on-google-cloud-platform-part-2\/\" \/>\n<meta property=\"og:locale\" content=\"ko_KR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Deploy TiDB on Google Cloud Platform\u2014Part 2 | TiDB\" \/>\n<meta property=\"og:description\" content=\"Learn about the benefits of TiDB and the TiDB Cloud solutions from PingCAP. Read our latest post &quot;How to Deploy TiDB on Google Cloud Platform\u2014Part 2&quot; here.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.pingcap.com\/ko\/blog\/how-to-deploy-tidb-on-google-cloud-platform-part-2\/\" \/>\n<meta property=\"og:site_name\" content=\"TiDB\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/facebook.com\/pingcap2015\" \/>\n<meta property=\"article:published_time\" content=\"2021-08-04T00:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-03-04T14:54:20+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/static.pingcap.com\/files\/2021\/08\/deploy-tidb-on-google-cloud-platform-1-scaled.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"2560\" \/>\n\t<meta property=\"og:image:height\" content=\"853\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Mike Barlow\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@PingCAP\" \/>\n<meta name=\"twitter:site\" content=\"@PingCAP\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Mike Barlow\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9\ubd84\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.pingcap.com\/blog\/how-to-deploy-tidb-on-google-cloud-platform-part-2\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.pingcap.com\/blog\/how-to-deploy-tidb-on-google-cloud-platform-part-2\/\"},\"author\":{\"name\":\"Mike Barlow\",\"@id\":\"https:\/\/www.pingcap.com\/#\/schema\/person\/aa2626fdb759293c472ca551624c7ddc\"},\"headline\":\"How to Deploy TiDB on Google Cloud Platform\u2014Part 2\",\"datePublished\":\"2021-08-04T00:00:00+00:00\",\"dateModified\":\"2025-03-04T14:54:20+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.pingcap.com\/blog\/how-to-deploy-tidb-on-google-cloud-platform-part-2\/\"},\"wordCount\":1729,\"publisher\":{\"@id\":\"https:\/\/www.pingcap.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.pingcap.com\/blog\/how-to-deploy-tidb-on-google-cloud-platform-part-2\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/static.pingcap.com\/files\/2021\/08\/deploy-tidb-on-google-cloud-platform-1-scaled.jpg\",\"keywords\":[\"Cloud\",\"Tutorial\"],\"articleSection\":[\"Product\"],\"inLanguage\":\"ko-KR\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.pingcap.com\/blog\/how-to-deploy-tidb-on-google-cloud-platform-part-2\/\",\"url\":\"https:\/\/www.pingcap.com\/blog\/how-to-deploy-tidb-on-google-cloud-platform-part-2\/\",\"name\":\"How to Deploy TiDB on Google Cloud Platform\u2014Part 2 | TiDB\",\"isPartOf\":{\"@id\":\"https:\/\/www.pingcap.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.pingcap.com\/blog\/how-to-deploy-tidb-on-google-cloud-platform-part-2\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.pingcap.com\/blog\/how-to-deploy-tidb-on-google-cloud-platform-part-2\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/static.pingcap.com\/files\/2021\/08\/deploy-tidb-on-google-cloud-platform-1-scaled.jpg\",\"datePublished\":\"2021-08-04T00:00:00+00:00\",\"dateModified\":\"2025-03-04T14:54:20+00:00\",\"description\":\"Learn about the benefits of TiDB and the TiDB Cloud solutions from PingCAP. Read our latest post \\\"How to Deploy TiDB on Google Cloud Platform\u2014Part 2\\\" here.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.pingcap.com\/blog\/how-to-deploy-tidb-on-google-cloud-platform-part-2\/#breadcrumb\"},\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.pingcap.com\/blog\/how-to-deploy-tidb-on-google-cloud-platform-part-2\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\/\/www.pingcap.com\/blog\/how-to-deploy-tidb-on-google-cloud-platform-part-2\/#primaryimage\",\"url\":\"https:\/\/static.pingcap.com\/files\/2021\/08\/deploy-tidb-on-google-cloud-platform-1-scaled.jpg\",\"contentUrl\":\"https:\/\/static.pingcap.com\/files\/2021\/08\/deploy-tidb-on-google-cloud-platform-1-scaled.jpg\",\"width\":2560,\"height\":853,\"caption\":\"deploy-tidb-on-google-cloud-platform-1\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.pingcap.com\/blog\/how-to-deploy-tidb-on-google-cloud-platform-part-2\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.pingcap.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Deploy TiDB on Google Cloud Platform\u2014Part 2\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.pingcap.com\/#website\",\"url\":\"https:\/\/www.pingcap.com\/\",\"name\":\"TiDB\",\"description\":\"TiDB | SQL at Scale\",\"publisher\":{\"@id\":\"https:\/\/www.pingcap.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.pingcap.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ko-KR\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.pingcap.com\/#organization\",\"name\":\"PingCAP\",\"url\":\"https:\/\/www.pingcap.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\/\/www.pingcap.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/static.pingcap.com\/files\/2021\/11\/pingcap-logo.png\",\"contentUrl\":\"https:\/\/static.pingcap.com\/files\/2021\/11\/pingcap-logo.png\",\"width\":811,\"height\":232,\"caption\":\"PingCAP\"},\"image\":{\"@id\":\"https:\/\/www.pingcap.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/facebook.com\/pingcap2015\",\"https:\/\/x.com\/PingCAP\",\"https:\/\/linkedin.com\/company\/pingcap\",\"https:\/\/youtube.com\/channel\/UCuq4puT32DzHKT5rU1IZpIA\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.pingcap.com\/#\/schema\/person\/aa2626fdb759293c472ca551624c7ddc\",\"name\":\"Mike Barlow\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\/\/www.pingcap.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/static.pingcap.com\/files\/2022\/10\/17234942\/avatar.jpg\",\"contentUrl\":\"https:\/\/static.pingcap.com\/files\/2022\/10\/17234942\/avatar.jpg\",\"caption\":\"Mike Barlow\"},\"url\":\"https:\/\/www.pingcap.com\/ko\/blog\/author\/mike-barlow\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Deploy TiDB on Google Cloud Platform\u2014Part 2 | TiDB","description":"Learn about the benefits of TiDB and the TiDB Cloud solutions from PingCAP. Read our latest post \"How to Deploy TiDB on Google Cloud Platform\u2014Part 2\" here.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.pingcap.com\/ko\/blog\/how-to-deploy-tidb-on-google-cloud-platform-part-2\/","og_locale":"ko_KR","og_type":"article","og_title":"How to Deploy TiDB on Google Cloud Platform\u2014Part 2 | TiDB","og_description":"Learn about the benefits of TiDB and the TiDB Cloud solutions from PingCAP. Read our latest post \"How to Deploy TiDB on Google Cloud Platform\u2014Part 2\" here.","og_url":"https:\/\/www.pingcap.com\/ko\/blog\/how-to-deploy-tidb-on-google-cloud-platform-part-2\/","og_site_name":"TiDB","article_publisher":"https:\/\/facebook.com\/pingcap2015","article_published_time":"2021-08-04T00:00:00+00:00","article_modified_time":"2025-03-04T14:54:20+00:00","og_image":[{"width":2560,"height":853,"url":"https:\/\/static.pingcap.com\/files\/2021\/08\/deploy-tidb-on-google-cloud-platform-1-scaled.jpg","type":"image\/jpeg"}],"author":"Mike Barlow","twitter_card":"summary_large_image","twitter_creator":"@PingCAP","twitter_site":"@PingCAP","twitter_misc":{"Written by":"Mike Barlow","Est. reading time":"9\ubd84"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.pingcap.com\/blog\/how-to-deploy-tidb-on-google-cloud-platform-part-2\/#article","isPartOf":{"@id":"https:\/\/www.pingcap.com\/blog\/how-to-deploy-tidb-on-google-cloud-platform-part-2\/"},"author":{"name":"Mike Barlow","@id":"https:\/\/www.pingcap.com\/#\/schema\/person\/aa2626fdb759293c472ca551624c7ddc"},"headline":"How to Deploy TiDB on Google Cloud Platform\u2014Part 2","datePublished":"2021-08-04T00:00:00+00:00","dateModified":"2025-03-04T14:54:20+00:00","mainEntityOfPage":{"@id":"https:\/\/www.pingcap.com\/blog\/how-to-deploy-tidb-on-google-cloud-platform-part-2\/"},"wordCount":1729,"publisher":{"@id":"https:\/\/www.pingcap.com\/#organization"},"image":{"@id":"https:\/\/www.pingcap.com\/blog\/how-to-deploy-tidb-on-google-cloud-platform-part-2\/#primaryimage"},"thumbnailUrl":"https:\/\/static.pingcap.com\/files\/2021\/08\/deploy-tidb-on-google-cloud-platform-1-scaled.jpg","keywords":["Cloud","Tutorial"],"articleSection":["Product"],"inLanguage":"ko-KR"},{"@type":"WebPage","@id":"https:\/\/www.pingcap.com\/blog\/how-to-deploy-tidb-on-google-cloud-platform-part-2\/","url":"https:\/\/www.pingcap.com\/blog\/how-to-deploy-tidb-on-google-cloud-platform-part-2\/","name":"How to Deploy TiDB on Google Cloud Platform\u2014Part 2 | TiDB","isPartOf":{"@id":"https:\/\/www.pingcap.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.pingcap.com\/blog\/how-to-deploy-tidb-on-google-cloud-platform-part-2\/#primaryimage"},"image":{"@id":"https:\/\/www.pingcap.com\/blog\/how-to-deploy-tidb-on-google-cloud-platform-part-2\/#primaryimage"},"thumbnailUrl":"https:\/\/static.pingcap.com\/files\/2021\/08\/deploy-tidb-on-google-cloud-platform-1-scaled.jpg","datePublished":"2021-08-04T00:00:00+00:00","dateModified":"2025-03-04T14:54:20+00:00","description":"Learn about the benefits of TiDB and the TiDB Cloud solutions from PingCAP. Read our latest post \"How to Deploy TiDB on Google Cloud Platform\u2014Part 2\" here.","breadcrumb":{"@id":"https:\/\/www.pingcap.com\/blog\/how-to-deploy-tidb-on-google-cloud-platform-part-2\/#breadcrumb"},"inLanguage":"ko-KR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.pingcap.com\/blog\/how-to-deploy-tidb-on-google-cloud-platform-part-2\/"]}]},{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/www.pingcap.com\/blog\/how-to-deploy-tidb-on-google-cloud-platform-part-2\/#primaryimage","url":"https:\/\/static.pingcap.com\/files\/2021\/08\/deploy-tidb-on-google-cloud-platform-1-scaled.jpg","contentUrl":"https:\/\/static.pingcap.com\/files\/2021\/08\/deploy-tidb-on-google-cloud-platform-1-scaled.jpg","width":2560,"height":853,"caption":"deploy-tidb-on-google-cloud-platform-1"},{"@type":"BreadcrumbList","@id":"https:\/\/www.pingcap.com\/blog\/how-to-deploy-tidb-on-google-cloud-platform-part-2\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.pingcap.com\/"},{"@type":"ListItem","position":2,"name":"How to Deploy TiDB on Google Cloud Platform\u2014Part 2"}]},{"@type":"WebSite","@id":"https:\/\/www.pingcap.com\/#website","url":"https:\/\/www.pingcap.com\/","name":"\ud2f0DB","description":"TiDB | SQL at Scale","publisher":{"@id":"https:\/\/www.pingcap.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.pingcap.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ko-KR"},{"@type":"Organization","@id":"https:\/\/www.pingcap.com\/#organization","name":"PingCAP","url":"https:\/\/www.pingcap.com\/","logo":{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/www.pingcap.com\/#\/schema\/logo\/image\/","url":"https:\/\/static.pingcap.com\/files\/2021\/11\/pingcap-logo.png","contentUrl":"https:\/\/static.pingcap.com\/files\/2021\/11\/pingcap-logo.png","width":811,"height":232,"caption":"PingCAP"},"image":{"@id":"https:\/\/www.pingcap.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/facebook.com\/pingcap2015","https:\/\/x.com\/PingCAP","https:\/\/linkedin.com\/company\/pingcap","https:\/\/youtube.com\/channel\/UCuq4puT32DzHKT5rU1IZpIA"]},{"@type":"Person","@id":"https:\/\/www.pingcap.com\/#\/schema\/person\/aa2626fdb759293c472ca551624c7ddc","name":"Mike Barlow","image":{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/www.pingcap.com\/#\/schema\/person\/image\/","url":"https:\/\/static.pingcap.com\/files\/2022\/10\/17234942\/avatar.jpg","contentUrl":"https:\/\/static.pingcap.com\/files\/2022\/10\/17234942\/avatar.jpg","caption":"Mike Barlow"},"url":"https:\/\/www.pingcap.com\/ko\/blog\/author\/mike-barlow\/"}]}},"grav_blocks":false,"card_markup":"<a class=\"card-resource bg-white\" href=\"https:\/\/www.pingcap.com\/ko\/blog\/how-to-deploy-tidb-on-google-cloud-platform-part-2\/\"><div class=\"card-resource__image-container\"><img class=\"card-resource__image\" alt=\"deploy-tidb-on-google-cloud-platform-1\" src=\"https:\/\/static.pingcap.com\/files\/2021\/08\/deploy-tidb-on-google-cloud-platform-1-scaled.jpg\" loading=\"lazy\" width=2560 height=853 \/><\/div><div class=\"card-resource__content-container\"><div class=\"card-resource__content-head\"><div class=\"card-resource__category\">Product<\/div><\/div><h5 class=\"card-resource__title\">How to Deploy TiDB on Google Cloud Platform\u2014Part 2<\/h5><\/div><\/a>","_links":{"self":[{"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/posts\/545","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/users\/63"}],"replies":[{"embeddable":true,"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/comments?post=545"}],"version-history":[{"count":3,"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/posts\/545\/revisions"}],"predecessor-version":[{"id":25522,"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/posts\/545\/revisions\/25522"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/media\/544"}],"wp:attachment":[{"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/media?parent=545"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/categories?post=545"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/tags?post=545"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}