Aggregate เดียว คลัสเตอร์ MySQL สองขนาด
MySQL InnoDB Cluster และ control plane ที่
บท
สิ่งที่คอมไพเลอร์เขียน และสิ่งที่ไม่เขียน
การInnoDBCluster โดย
ดัง
สิ่งเดียวที่เปลี่ยน
.-- release-single.yaml ----- spec.instances: 1 /one Aggregate -- one Manifest -+one Component \one Recipe '- release-replicated.yaml -- spec.instances: 3Releases ทั้ง
ไฟล์
aggregate.yaml— เจตนาของ เป็นนัก พัฒนา และ เอกสาร ได้แก่เดียวกัน สำหรับ Releases ทั้ง สอง รายการ ส่วน ประกอบ mysql-operatorสำหรับ control plane ส่วนประกอบ dbประเภทcore/datastore/mysql-innodb-clusterและชุด อักขระ ที่ นัก พัฒนา ต้องการ ให้ เซิร์ฟเวอร์ ใช้ ไม่มี สิ่ง ใด ที่ นี่ บอก ว่า มี เซิร์ฟเวอร์ กี่ ตัว manifest.yaml— การแมป ของ ฝ่าย ปฏิบัติ การ ที่ Releases ทั้ง สอง รายการ ใช้ ร่วม กัน สอง บรรทัด คือ Recipe ใด ทำให้ เป็น รูป ธรรม control plane และ Recipe ใด ทำให้ เป็น รูป ธรรม ฐาน ข้อมูล release-single.yaml,release-replicated.yaml— การกำหนด ขนาด ของ ผู้ ดำเนิน การ ทั้ง สอง ต่าง กัน ที่ metadata.nameและserver_instancesส่วนฟิลด์ อื่น ทุก ฟิลด์ คง ให้ เท่า กัน โดย ตั้งใจ เพื่อ ให้ บรรทัด เดียว คือ ความ ต่าง ทั้งหมด .aggrega-config.yaml— ระบุรีจิสทรี hub ที่ แค็ตตาล็อก ของ ไลบรารี มาตรฐาน หา ค่า จาก นั้น ตัวอย่าง นี้ ไม่ เขียน เอนทิตี ของ ตนเอง
ร่างตัวอย่าง
คุณ
เขียน
aggrega draft --example mysql-innodb-clusterจาก
cd mysql-innodb-clusterบิลด์
aggrega build --release release-single.yaml --auto-pullaggrega build --release release-replicated.yaml --auto-pull--auto-pull เขียนdist/ และdist/ ระหว่าง
rm -rf dist && aggrega build --release release-replicated.yaml --auto-pullRelease แต่ละ
dist/stack/helm/db/innodbcluster.yamldist/stack/helm/mysql-operator/clusterrole.yamldist/stack/helm/mysql-operator/clusterrolebinding.yamldist/stack/helm/mysql-operator/deployment.yamldist/stack/helm/mysql-operator/serviceaccount.yamlกับผู้ช่วย AI
ผู้
ใช้เครื่องมือของ Aggrega เท่านั้น และอย่าสร้างโฟลเดอร์เอง หากโฟลเดอร์ Workspace ยังไม่มีโฟลเดอร์ `mysql-innodb-cluster` เรียกเครื่องมือ `draft` หนึ่งครั้งโดยตั้ง `example` เป็น `mysql-innodb-cluster` และไม่ระบุ `dir`: เครื่องมือจะเขียนตัวอย่างลงในโฟลเดอร์ `mysql-innodb-cluster` ใหม่ จากนั้นเรียกเครื่องมือ `build` หนึ่งครั้งต่อ Release แต่ละรายการตามลำดับนี้ — `release-single.yaml` และ `release-replicated.yaml` — โดยแต่ละครั้งตั้ง `workspace_root` เป็น `mysql-innodb-cluster` ตั้ง `release` เป็นไฟล์นั้น ตั้ง `auto_pull` เป็น true และตั้ง `write` เป็น true บอกฉันว่าแต่ละบิลด์เขียนไฟล์ใดบ้าง ไฟล์เหล่านั้นอยู่ใต้ `mysql-innodb-cluster/dist/`สิ่งที่ฐานข้อมูลเรนเดอร์ออกมา
# dist/stack/helm/db/innodbcluster.yaml — aggrega build --release release-single.yamlapiVersion: mysql.oracle.com/v2kind: InnoDBClustermetadata: [… omitted: the labels and annotations, described below] name: dbspec: instances: 1 router: instances: 1 version: "8.4.0" secretName: "mysql-root" mycnf: | [mysqld] character-set-server=utf8mb4 collation-server=utf8mb4_0900_ai_ciไฟล์
รายการ spec สี่instances ไปserver_instances ของ Release version ไปengine_version ของ Component secretName ไปcredentials_secret ของ Release และmycnf ไปcharset และ collation ของrouter.instances จะ
การเปรียบเทียบที่เป็นหัวใจ
ความ
--- dist/stack/helm/db/innodbcluster.yaml (single)+++ dist/stack/helm/db/innodbcluster.yaml (replicated) spec:- instances: 1+ instances: 3 router: instances: 1บรรทัด
จำนวน
control plane
[… omitted: the Deployment's metadata, selector and pod template up to the containers] containers: - name: controller image: container-registry.oracle.com/mysql/community-operator:26.7.0-2.3.0 [… omitted: the controller's readiness probe]Release ทั้งinfra.image ของ Component เอง ดังinfra.image ใน Release และ
control plane ถูก
ข้อกำหนดเบื้องต้นถูกระบุไว้ ไม่เคยถูกค้นพบเอง
คอมไพเลอร์control_plane_present ไว้
[… omitted: the pull's lines, which carry the same halt][CATALOG_ERROR E0033] Recipe/FeatureRecipe assertions caused by: Recipe "mysql-innodb-cluster" instance "db" assertion "mysql_operator_prerequisite": assertion "Recipe/mysql-innodb-cluster/db/mysql_operator_prerequisite": template: Recipe/mysql-innodb-cluster/db/mysql_operator_prerequisite:1:48: executing "Recipe/mysql-innodb-cluster/db/mysql_operator_prerequisite" at <fail "the MySQL Operator control plane must be installed in the target cluster before this realization emits its InnoDBCluster custom resource; once the control plane is present, affirm the prerequisite by setting infra.control_plane_present to true in the Release">: error calling fail: assertion failed: the MySQL Operator control plane must be installed in the target cluster before this realization emits its InnoDBCluster custom resource; once the control plane is present, affirm the prerequisite by setting infra.control_plane_present to true in the Releaseไม่มี
บัญชี root
Releases ทั้ง
db: infra: credentials_secret: mysql-rootไม่มีinfra.credentials เป็น generated แทนroot_password ของ
สิ่ง
ควรเลือกการทำให้เป็นรูปธรรมแบบใด
เลือกcore/datastore/mysql และ Recipe แบบcore/datastore/mysql-innodb-cluster เมื่อ
รูป../mysql-standalone/ และ
รอยต่ออยู่ที่ใด
เอกสาร
- นัก
พัฒนา บอก สิ่งที่ แอปพลิเคชัน ต้องการ จาก ฐาน ข้อมูล - ฝ่าย
ปฏิบัติ บอก ว่าการ ฐาน — Recipe ใดข้อมูล ประกอบ ด้วย อะไร ทำให้ เป็น รูป ธรรม ฐาน ข้อมูล - ผู้
ดำเนิน บอก ว่าการ ตัว นี้ ใหญ่ เท่าใด
เปลี่ยน server_instances เป็นaggregate.yaml ใน