Go back

Setup and installation of 'TiDB with Grafana & Prometheus: Real-Time Data & Analytics' on AWS

This section describes how to launch and connect to ‘TiDB with Grafana & Prometheus: Real-Time Data & Analytics’ VM on Amazon Web Services (AWS).

  1. Open TiDB with Grafana & Prometheus: Real-Time Data & Analytics VM listing on AWS marketplace

/img/aws/tidb/marketplace.png

  1. Click on View purchase options.
  • Login with your credentials and follow the instruction.
  • Subscribe to the product and click on Continue to configuration button.
  • Select a Region where you want to launch the VM(such as US East (N.Virginia))

/img/aws/tidb/region.png

  • Click on Continue to Launch Button.
  • Choose Action: You can launch it through EC2 or from Website.(Let’s choose Launch from website)

/img/aws/tidb/launch.png

  • Optionally change the EC2 instance type. (This defaults to t2.large instance type, 2 vCPUs and 8 GB RAM.)
  • Optionally change the network name and subnetwork names.

/img/aws/minikube/vpc.png

  • Select the Security Group. Be sure that whichever Security Group you specify have ports 22 and 3389 (for RDP) exposed. Or you can create the new SG by clicking on “Create New Based On Seller Settings” button. Provide the name and description and save the SG for this instance.

/img/aws/desktop-linux-ubuntu2404/create-new-sg.png

/img/aws/tidb/SG.png

  • Be sure to download the key-pair which is available by default, or you can create the new key-pair and download it. /img/aws/minikube/key-pair.png

  • Click on Launch..

  • TiDB with Grafana & Prometheus: Real-Time Data & Analytics will begin deploying.

  1. A summary page displays. To see this instance on EC2 Console click on EC2 Console link.

/img/aws/tidb/deployed.png

  1. On the EC2 Console page, instance is up and running. To connect to this instance through putty, copy the IPv4 Public IP Address

/img/aws/tidb/public-ip.png

  1. Open putty, paste the IP address and browse your private key you downloaded while deploying the VM, by going to SSH->Auth->Credentials, click on Open. Enter ec2-user as userid

/img/aws/desktop-linux/putty-01.png

/img/aws/nvidia-aiml/putty-02.png

/img/aws/tidb/ssh-login.png

  1. Once connected, change the password for ec2-user user using below command
sudo passwd ec2-user

/img/aws/tidb/update-ec2-user-passwd.png

  1. Now the password for ec2-user is set, you can connect to the VM’s desktop environment from any local Windows Machine using RDP protocol or Linux Machine using Remmina.

From your local windows machine, goto “start” menu, in the search box type and select “Remote desktop connection”. In the “Remote Desktop connection” wizard, copy the public IP address and click connect

/img/aws/desktop-linux/rdp.png

  1. This will connect you to the VM’s desktop environment. Provide the username (e.g “ec2-user”) and the password set in the above “Reset password” step to authenticate. Click OK

/img/aws/tidb/rdp-login.png

  1. Now you are connected to the out of box TiDB with Grafana & Prometheus: Real-Time Data & Analytics VM’s desktop environment via Windows Machine.

/img/gcp/tidb/rdp-desktop.png

  1. To connect using RDP via Linux machine, first note the external IP of the VM from VM details page, then from your local Linux machine, goto menu, in the search box type and select “Remmina”.

Note: If you don’t have Remmina installed on your Linux machine, first Install Remmina as per your linux distribution.

/img/gcp/common/remmina-search.png

  1. In the “Remmina Remote Desktop Client” wizard, select the RDP option from dropdown and paste the external ip and click enter.

/img/gcp/common/remmina-external-ip.png

  1. This will connect you to the VM’s desktop environment. Provide “ec2-user” as the userid and the password set in above reset password step to authenticate. Click OK

/img/aws/tidb/remmina-rdp-login.png

  1. Now you are connected to out of box TiDB with Grafana & Prometheus: Real-Time Data & Analytics VM’s desktop environment via Linux machine.

/img/gcp/tidb/rdp-desktop.png

  1. Once you are connected to VMs desktop environment, you can access the TiDB User interface, Grafana UI and Prometheus from the Firefox Browser available on this Desktop.

NOTE: The User Inerfaces for TiDB, Grafana and Prometheus are accessible only via Remote Desktop and not on public internet due to security purpose and not to expose the DB on public internet.

  • TiDB dashboard-> http://127.0.0.1:2379/dashboard

  • Grafana UI-> http://127.0.0.1:3000

  • Prometheus-> http://127.0.0.1:9090

  • PD client endpoints-> 127.0.0.1:2379

  1. Double click on Firefox browser, by default it will open TiDB user interface as shown below. Login with root user and blank password. To set the password for TiDB UI, please follow steps 21 onwards in this guide.

/img/gcp/tidb/tidb-login-page.png

/img/gcp/tidb/tidb-dashboard.png

  1. In the Firefox browser, click on new tab and click Grafana bookmark from the bookmark toolbar. Login with below credentials.

Username: admin

Password: admin

It will ask you to enter new password on next screen. Provide the new password here and continue to dashboard.

/img/gcp/tidb/grafana.png

/img/gcp/tidb/grafana-dashboard.png

  1. You can also update the admin password from inside grafana dashboard. Click on user icon from bottom left and select Change password option.

/img/gcp/tidb/admin-user.png

/img/gcp/tidb/update-admin-passwd.png

  1. Similarly open the Prometheus by clicking the Prometheus bookmark from the bookmark toolbar.

/img/gcp/tidb/prometheus.png

  1. To access TiDB via mysql client , run below command from terminal.
mysql --host 127.0.0.1 --port 4000 -u root

/img/gcp/tidb/mysql-client.png

  1. Follow below steps to change root password for tidb dashboard login from mysql client.

a. Run below command in terminal to access TiDB via mysql client and run the ALTER command as shown below.

mysql --host 127.0.0.1 --port 4000 -u root
ALTER USER 'root'@'%' IDENTIFIED BY 'new_password';

Replace new_password with your password.

b. Flush the privileges.

FLUSH PRIVILEGES;

EXIT;

/img/gcp/tidb/update-root-password-via-mysql-01.png

c. Now reconnect to DB using below command. It will prompt for the new password and set test as the DB to use.

mysql --host 127.0.0.1 --port 4000 -u root -p -e "use test;"

/img/gcp/tidb/reconnect-db.png

d. Now use the same password when logging in to TiDB Dashboard available at http://127.0.0.1:2379/dashboard using root userid.

/img/gcp/tidb/tidb-with-new-passwd.png

/img/gcp/tidb/tidb-dashboard-with-new-passwd.png


Go back