In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
Data Lake Analytics how to read and write PolarDB data, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain for you in detail, people with this need can come to learn, I hope you can gain something.
Data Lake Analytics, as a hub for cloud data processing, has recently added support for PolarDB. PolarDB is a next-generation relational distributed cloud native database developed by Aliyun, which is 100% compatible with MySQL, with a storage capacity of up to 100T and a performance improvement of up to 6 times that of MySQL. This tutorial takes you to play with DLA's PolarDB support.
Create a database
The syntax for creating an underlying PolarDB-mapped appearance in DLA is as follows:
CREATE SCHEMA porlardb_test WITH DBPROPERTIES (CATALOG = 'mysql', LOCATION =' jdbc:mysql://pc-bp1dlebalabala.rwlb.rds.aliyuncs.com:3306/dla_test', USER = 'dla_test_1', PASSWORD =' the-fake-password', VPC_ID = 'vpc-2zeij924vxd303kwifake', INSTANCE_ID =' rm-2zer0vg58mfo5fake')
Unlike ordinary table creation, there are two more attributes: VPC_ID and INSTANCE_ID. VPC_ID is the ID of the VPC where your PolarDB is located.
These two additional information is needed to build the table because the user's database is inside the user's own VPC. By default, DLA cannot access the resources in the user's VPC. In order to enable the DLA to access the user's PolarDB data, we need to use Aliyun's VPC reverse access technology.
Permission statement: when you build the library in the above way, you will be deemed to agree that we use VPC reverse access technology to read and write your PolarDB.
In addition, you need to add the 100.104.0.0swap 16 IP address field to your PolarDB whitelist, which is the IP sector accessed by our VPC in reverse, as shown below:
Cdn.com/7749f8bb0c3ef32d6d191a218f556c66c9ad8d0f.png ">
At the same time, careful readers may notice that our CATALOG here is written in mysql, not polardb, because PolarDB is 100% compatible with MySQL, so we can access it directly under the MySQL protocol.
Create a tabl
After the database is built, we can create tables. We will first create the following person table in your PolarDB for testing:
Create table person (id int, name varchar (1023), age int)
And insert the test data into it:
Insert into person values (1, 'james', 10), (2,' bond', 20), (3, 'jack', 30), (4,' lucy', 40)
Then you can create the corresponding mapping table in the DLA database:
Create external table person (id int, name varchar (1023), age int)
In this way, we can query the data in the DLA database by connecting to the DLA database through the MySQL client:
Mysql > select * from person +-+ | id | name | age | 1 | james | 10 | 2 | bond | 20 | 3 | jack | 30 | 4 | lucy | 40 | +-+ 4 rows in set (0.35 sec) is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.