หมายเหตุ
การเข้าถึงหน้านี้ต้องได้รับการอนุญาต คุณสามารถลอง ลงชื่อเข้าใช้หรือเปลี่ยนไดเรกทอรีได้
การเข้าถึงหน้านี้ต้องได้รับการอนุญาต คุณสามารถลองเปลี่ยนไดเรกทอรีได้
บทความนี้อธิบายวิธีการเพิ่ม MySQL Database Change Data Capture (CDC) เป็นแหล่งข้อมูลเหตุการณ์ใน Fabric Real-Time hub
ตัวเชื่อมต่อ Azure MySQL Database Change Data Capture (CDC) ช่วยให้คุณสามารถจับภาพสแนปช็อตของข้อมูลปัจจุบันในฐานข้อมูล Azure MySQL ได้ คุณระบุตารางที่จะตรวจสอบและรับการแจ้งเตือนเมื่อมีการเปลี่ยนแปลงระดับแถวต่อมาใดๆ กับตาราง เมื่อการเปลี่ยนแปลงถูกบันทึกไว้ในสตรีม คุณสามารถประมวลผลข้อมูล CDC นี้ในแบบเรียลไทม์ และส่งไปยังปลายทางอื่นภายใน Fabric เพื่อประมวลผลหรือวิเคราะห์เพิ่มเติม
Prerequisites
- เข้าถึงพื้นที่ทํางานในโหมดสิทธิ์การใช้งาน Fabric capacity (หรือ) โหมดสิทธิ์การใช้งานรุ่นทดลองใช้ที่มีสิทธิ์ผู้สนับสนุนหรือสูงกว่า
- สร้างอินสแตนซ์ของ ฐานข้อมูล Azure สําหรับ MySQL – เซิร์ฟเวอร์ที่ยืดหยุ่น
ตั้งค่าฐานข้อมูล MySQL
ตัวเชื่อมต่อฐานข้อมูล Azure MySQL ใช้ตัวเชื่อมต่อ Debezium MySQL เพื่อจับการเปลี่ยนแปลงในฐานข้อมูล MySQL ของคุณ คุณต้องกําหนดผู้ใช้ MySQL ที่มีสิทธิ์บนฐานข้อมูลทั้งหมดที่ตัวเชื่อมต่อตรวจสอบ สําหรับคําแนะนําทีละขั้นตอน ดู ตั้งค่าฐานข้อมูล MySQL (DB)
เปิดใช้งาน binlog
คุณต้องเปิดใช้งานการบันทึกไบนารีสําหรับการจําลอง MySQL แฟ้มบันทึกไบนารีบันทึกการปรับปรุงทรานแซคชันสําหรับเครื่องมือการจําลองแบบเพื่อเผยแพร่การเปลี่ยนแปลง ตัวอย่างเช่น ฐานข้อมูล Azure สําหรับ MySQL
In the Azure portal, navigate to your Azure MySQL database.
On the left navigation menu, select Server parameters.
กําหนดค่าเซิร์ฟเวอร์ MySQL ของคุณด้วยคุณสมบัติต่อไปนี้
- binlog_row_image: Set the value to full.
- binlog_expire_logs_seconds: The number of seconds for automatic binlog file removal. ตั้งค่าเพื่อให้ตรงกับความต้องการของสภาพแวดล้อมของคุณ For example, 86400.
รับเหตุการณ์จาก Azure MySQL Database (CDC)
คุณสามารถรับเหตุการณ์จาก CDC ฐานข้อมูล Azure MySQL ลงในฮับเรียลไทม์ด้วยหนึ่งในวิธีต่อไปนี้:
หน้าแหล่งข้อมูล
Sign in to Microsoft Fabric.
If you see Power BI at the bottom-left of the page, switch to the Fabric workload by selecting Power BI and then by selecting Fabric.
Select Real-Time on the left navigation bar.
On the Real-Time hub page, select + Data sources under Connect to on the left navigation menu.
You can also get to the Data sources page from the Real-Time hub page by selecting the + Add data button in the top-right corner.
On the Data sources page, select Database CDC category at the top, and then select Connect on the MySQL DB (CDC) tile.
ใช้คําแนะนําจากเพิ่ม Azure MySQL Database CDC เป็นส่วนแหล่งที่มา
หน้าแหล่งที่มาของ Microsoft
In Real-Time hub, select Microsoft sources.
In the Source drop-down list, select Azure MySQL DB (CDC).
For Subscription, select an Azure subscription that has the resource group with your Azure MySQL Database account.
For Resource group, select a resource group that has the database.
For Region, select a location where your database is located.
Now, move the mouse over the name of the Azure MySQL DB CDC source that you want to connect to Real-Time hub in the list of databases, and select the Connect button, or select ... (ellipsis), and then select the Connect button.
หากต้องการกําหนดค่าข้อมูลการเชื่อมต่อ ให้ใช้ขั้นตอนจากเพิ่ม Azure MySQL DB CDC เป็นส่วนต้นทาง
เพิ่ม CDC ฐานข้อมูล Azure MySQL เป็นแหล่งข้อมูล
On the Connect page, select New connection.
In the Connection settings section, do these steps:
For Server, enter the URI for your Azure MySQL server.
For Database, enter the name of your database.
In the Connection credentials section, do these steps:
For Connection, select if there's an existing connection to the MySQL database. หากไม่เป็นเช่นนั้น ให้เก็บค่าเริ่มต้นไว้: สร้างการเชื่อมต่อใหม่
For Authentication kind, select Basic. Currently, only Basic authentication is supported.
Enter values for User name and Password.
ระบุว่าคุณต้องการ ใช้การเชื่อมต่อที่เข้ารหัสลับหรือไม่
Select Connect.
Back on the Connect page, do these steps:
- Enter the table name.
- Enter the server ID.
- Enter the port number or keep the default value.
In the Stream details section to the right, do these steps:
Now, select Next at the bottom of the page.
บน ตรวจสอบ + เชื่อมต่อ ให้ตรวจสอบการตั้งค่า และเลือก สร้างแหล่งข้อมูล
On the Connect page, select Go to resource to navigate to the Azure PostgreSQL database. Take a note of the server name on the Overview page. ซึ่งอยู่ในรูปแบบต่อไปนี้:
mysqlserver.mysql.database.azure.com
ดูรายละเอียดสตรีมข้อมูล
บนหน้า ตรวจสอบ + เชื่อมต่อ ถ้าคุณเลือก เปิดเหตุการณ์สตรีม ตัวช่วยสร้างจะเปิดเหตุการณ์ที่สร้างขึ้นให้คุณด้วย Azure MySQL DB CDC ที่เลือกเป็นแหล่งข้อมูล To close the wizard, select Finish or X* in the top-right corner of the page.
คุณควรเห็นสตรีมในส่วนข้อมูลการสตรีมล่าสุดของโฮมเพจฮับReal-Time สําหรับขั้นตอนโดยละเอียด ดูรายละเอียดของสตรีมข้อมูลใน Fabric Real-Time hub
.
Related content
หากต้องการเรียนรู้เกี่ยวกับการใช้สตรีมข้อมูล โปรดดูบทความต่อไปนี้: