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).
- Open TiDB with Grafana & Prometheus: Real-Time Data & Analytics VM listing on AWS marketplace
- 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))
- Click on Continue to Launch Button.
- Choose Action: You can launch it through EC2 or from Website.(Let’s choose Launch from website)
- 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.
- 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.
-
Be sure to download the key-pair which is available by default, or you can create the new key-pair and download it.
-
Click on Launch..
-
TiDB with Grafana & Prometheus: Real-Time Data & Analytics will begin deploying.
- A summary page displays. To see this instance on EC2 Console click on EC2 Console link.
- On the EC2 Console page, instance is up and running. To connect to this instance through putty, copy the IPv4 Public IP Address
- 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
- Once connected, change the password for ec2-user user using below command
- 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
- 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
- Now you are connected to the out of box TiDB with Grafana & Prometheus: Real-Time Data & Analytics VM’s desktop environment via Windows Machine.
- 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.
- In the “Remmina Remote Desktop Client” wizard, select the RDP option from dropdown and paste the external ip and click enter.
- 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
- Now you are connected to out of box TiDB with Grafana & Prometheus: Real-Time Data & Analytics VM’s desktop environment via Linux machine.
- 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
- 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 20 onwards in this guide.
- 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.
- You can also update the admin password from inside grafana dashboard. Click on user icon from bottom left and select Change password option.
- Similarly open the Prometheus by clicking the Prometheus bookmark from the bookmark toolbar.
- To access TiDB via mysql client , run below command from terminal. This will prompt to enter root mysql password, hit enter if you did not set any password or provide root password if you set the root password.
mysql --host 127.0.0.1 --port 4000 -u root -p
- 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. Hit enter if you did not set any password previously. Then run the ALTER command as shown below.
mysql --host 127.0.0.1 --port 4000 -u root -p
ALTER USER 'root'@'%' IDENTIFIED BY 'new_password';
Replace new_password with your password.
b. Flush the privileges.
FLUSH PRIVILEGES;
EXIT;
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;"
d. Now use the same password when logging in to TiDB Dashboard available at http://127.0.0.1:2379/dashboard using root userid.