diff --git a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/versionLocalUpgrade.ts b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/versionLocalUpgrade.ts index 1ad0c01d9c..3d94273dc3 100644 --- a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/versionLocalUpgrade.ts +++ b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/versionLocalUpgrade.ts @@ -31,7 +31,7 @@ export async function generateMysqlVersionLocalUpgradeCloneData(ticketData: Tick [ClusterTypes.TENDBHA]: getTendbhaList, }; const clusterListResult = await apiMap[clusterType as keyof typeof apiMap]({ - id: infos.map((item) => item.cluster_ids[0]).join(','), + cluster_ids: infos.map((item) => item.cluster_ids[0]), }); const clusterListMap = clusterListResult.results.reduce( (obj, item) => { diff --git a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/versionMigrateUpgrade.ts b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/versionMigrateUpgrade.ts index ff592b508e..8acee7d43b 100644 --- a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/versionMigrateUpgrade.ts +++ b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/versionMigrateUpgrade.ts @@ -22,7 +22,7 @@ import { random } from '@utils'; export async function generateMysqlVersionMigrateUpgradeCloneData(ticketData: TicketModel) { const { clusters, infos, backup_source: backupSource, force } = ticketData.details; const clusterListResult = await getTendbhaList({ - id: infos.map((item) => item.cluster_ids[0]).join(','), + cluster_ids: infos.map((item) => item.cluster_ids[0]), }); const clusterListMap = clusterListResult.results.reduce( (obj, item) => { @@ -46,12 +46,30 @@ export async function generateMysqlVersionMigrateUpgradeCloneData(ticketData: Ti packageVersion: clusterListMap[clusterId].masters[0].version, moduleName: item.display_info.current_module_name, cloudId: clusters[clusterId].bk_cloud_id, + masterSlaveList: [ + ...clusterListMap[clusterId].masters, + ...clusterListMap[clusterId].slaves.filter((item) => item.is_stand_by), + ].map((item) => ({ + bk_biz_id: item.bk_biz_id, + bk_host_id: item.bk_host_id, + ip: item.ip, + bk_cloud_id: item.bk_cloud_id, + })), + readonlySlaveList: clusterListMap[clusterId].slaves + .filter((item) => !item.is_stand_by) + .map((item) => ({ + bk_biz_id: item.bk_biz_id, + bk_host_id: item.bk_host_id, + ip: item.ip, + bk_cloud_id: item.bk_cloud_id, + })), }, targetVersion: item.display_info.target_version, targetPackage: item.pkg_id, targetModule: item.new_db_module_id, masterHostData: item.new_master, slaveHostData: item.new_slave, + readonlyHostData: (item.read_only_slaves || []).map((readonlySlaveItem) => readonlySlaveItem.new_slave), }; }); diff --git a/dbm-ui/frontend/src/locales/zh-cn.json b/dbm-ui/frontend/src/locales/zh-cn.json index 440b1479e2..3a98e45af9 100644 --- a/dbm-ui/frontend/src/locales/zh-cn.json +++ b/dbm-ui/frontend/src/locales/zh-cn.json @@ -3496,5 +3496,54 @@ "特殊字符不允许包含空格": "特殊字符不允许包含空格", "请输入除大小写字母、数字外的英文半角字符": "请输入除大小写字母、数字外的英文半角字符", "请输入英文半角字符,重复字符将去重": "请输入英文半角字符,重复字符将去重", + "Follower节点规格": "Follower 节点规格", + "Observer节点规格": "Observer 节点规格", + "【Doris】集群管理": "【Doris】集群管理", + "申请Doris集群部署": "申请Doris集群部署", + "Doris版本": "Doris 版本", + "Follower节点": "Follower 节点", + "Observer节点": "Observer 节点", + "固定为n台": "固定为 {0} 台", + "查询端口": "查询端口", + "主机已被Follower节点使用": "主机已被 Follower 节点使用", + "主机已被Observer节点使用": "主机已被 Observer 节点使用", + "Follower节点IP": "Follower 节点 IP", + "Observer节点IP": "Observer 节点 IP", + "9010 和 9020 为服务内部占用端口": "9010 和 9020 为服务内部占用端口", + "与http端口互斥": "与 http 端口互斥", + "与查询端口互斥": "与查询端口互斥", + "至少添加一种节点IP": "至少添加一种节点 IP", + "name容量从n台扩容至n台": "{name} 容量从 {hostNumBefore} 台扩容至 {hostNumAfter} 台", + "name容量从n台缩容至n台": "{name} 容量从 {hostNumBefore} 台缩容至 {hostNumAfter} 台", + "至少缩容一种类型": "至少缩容一种类型", + "当前数量": "当前数量", + "确认禁用该集群?": "确认禁用该集群?", + "确认启用该集群?": "确认启用该集群?", + "启用后,将会恢复访问": "启用后,将会恢复访问", + "删除后将产生以下影响": "删除后将产生以下影响:", + "删除xxx集群": "删除 {0} 集群", + "删除xxx实例数据,停止相关进程": "删除 {xxx} 实例数据,停止相关进程", + "确认扩容集群?": "确认扩容集群?", + "若选择至少需要n台": "若选择至少需要 {0} 台", + "若选择至少需要n台,已选m台": "若选择至少需要 {0} 台,已选 {1} 台", + "扩容中": "扩容中", + "缩容中": "缩容中", + "替换中": "替换中", + "请保证冷/热节点至少存在一种": "请保证冷/热节点至少存在一种", + "Follower节点不支持缩容": "Follower节点不支持缩容", + "Follower类型节点若存在至少保留两台": "Follower类型节点若存在至少保留两台", + "冷/热 数据节点必选 1 种以上,每个角色至少需要 2 台": "冷/热 数据节点必选 1 种以上,每个角色至少需要 2 台", + "未完善": "未完善", + "扩容的节点 IP": "扩容的节点 IP", + "实例正在重启中,不能勾选": "实例正在重启中,不能勾选", + "较目标容量相差n台": ",较目标容量相差 {0} 台", + "较目标容量超出n台": ",较目标容量超出 {0} 台", + "Observer类型节点若存在至少保留两台": "Observer类型节点若存在至少保留两台", + "主从主机": "主从主机", + "只读主机": "只读主机", + "新主从主机": "新主从主机", + "新只读主机": "新只读主机", + "请输入n台IP_英文逗号或换行分隔": "请输入 {n} 台IP_英文逗号或换行分隔", + "请输入n台IP": "请输入 {n} 台IP", "这行勿动!新增翻译请在上一行添加!": "" -} + } diff --git a/dbm-ui/frontend/src/services/model/ticket/details/mysql.ts b/dbm-ui/frontend/src/services/model/ticket/details/mysql.ts index 78e9efdc4d..3e55c5c1e7 100644 --- a/dbm-ui/frontend/src/services/model/ticket/details/mysql.ts +++ b/dbm-ui/frontend/src/services/model/ticket/details/mysql.ts @@ -601,6 +601,10 @@ export interface MySQLMigrateUpgradeDetails extends DetailBase { pkg_id: string; new_master: MysqlIpItem; new_slave: MysqlIpItem; + read_only_slaves?: { + old_slave: MysqlIpItem; + new_slave: MysqlIpItem; + }[]; display_info: { current_version: string; target_version: string; @@ -609,6 +613,7 @@ export interface MySQLMigrateUpgradeDetails extends DetailBase { charset: string; current_module_name: string; target_module_name: string; + old_master_slave?: string[]; }; }[]; force: boolean; diff --git a/dbm-ui/frontend/src/views/db-manage/mysql/version-upgrade/pages/page1/Index.vue b/dbm-ui/frontend/src/views/db-manage/mysql/version-upgrade/pages/page1/Index.vue index bf23c5475d..5f751e81aa 100644 --- a/dbm-ui/frontend/src/views/db-manage/mysql/version-upgrade/pages/page1/Index.vue +++ b/dbm-ui/frontend/src/views/db-manage/mysql/version-upgrade/pages/page1/Index.vue @@ -18,7 +18,7 @@ theme="info" :title=" t( - '版本升级:接入层可直接原地升级,存储层需先创建相应版本的模块,连续版本可直接升级,跨版本需提供新机通过迁移完成升级;同机所有关联集群将一并升级', + '版本升级:主从接入层和单节点采用原地升级,存储层小版本升级采用原地升级(注意:暂不支持一主多从),大版本需提供新机迁移方式执行。同一主机所有关联集群将一并同步升级', ) " /> - + { formData.updateType = 'remote'; }); @@ -169,15 +168,17 @@ const formData = reactive(initFormData()); + const renderKey = computed(() => `${formData.roleType}-${formData.updateType}`); + const currentTable = computed(() => { - const { roleType, updateType } = formData; - if (roleType === 'haAccessLayer') { + const [currentUpdateType, currentRoleType] = renderKey.value.split('-'); + if (currentUpdateType === 'haAccessLayer') { return RenderAccessLayerTable; } - if (roleType === 'singleStorageLayer') { + if (currentUpdateType === 'singleStorageLayer') { return RenderSingleStorageTable; } - if (updateType === 'local') { + if (currentRoleType === 'local') { return RenderStorageLayerLocalTable; } return RenderStorageLayerRemoteTable; @@ -190,21 +191,15 @@ }, ); - watch( - () => formData.updateType, - () => { - tableList.value = []; - remark.value = ''; - if (formData.updateType === '') { - formData.updateType = 'local'; - } - }, - ); - - const handleRoleTypeChange = () => { - remark.value = ''; + watch(renderKey, () => { tableList.value = []; - }; + remark.value = ''; + }); + + // const handleRoleTypeChange = () => { + // remark.value = ''; + // tableList.value = []; + // }; diff --git a/dbm-ui/frontend/src/views/db-manage/mysql/version-upgrade/pages/page1/components/ha-access-layer/Index.vue b/dbm-ui/frontend/src/views/db-manage/mysql/version-upgrade/pages/page1/components/ha-access-layer/Index.vue index 413f44b703..234df9556f 100644 --- a/dbm-ui/frontend/src/views/db-manage/mysql/version-upgrade/pages/page1/components/ha-access-layer/Index.vue +++ b/dbm-ui/frontend/src/views/db-manage/mysql/version-upgrade/pages/page1/components/ha-access-layer/Index.vue @@ -56,13 +56,7 @@ @remove="handleRemove(index)" /> -
- - {{ t('忽略业务连接') }} - -
+ -
- - {{ t('忽略业务连接') }} - -
+ - + diff --git a/dbm-ui/frontend/src/views/db-manage/mysql/version-upgrade/pages/page1/components/ha-storage-layer-remote/RenderNewReadonlySlaveHost.vue b/dbm-ui/frontend/src/views/db-manage/mysql/version-upgrade/pages/page1/components/ha-storage-layer-remote/RenderNewReadonlySlaveHost.vue new file mode 100644 index 0000000000..f8d7e832ff --- /dev/null +++ b/dbm-ui/frontend/src/views/db-manage/mysql/version-upgrade/pages/page1/components/ha-storage-layer-remote/RenderNewReadonlySlaveHost.vue @@ -0,0 +1,182 @@ + + + + diff --git a/dbm-ui/frontend/src/views/db-manage/mysql/version-upgrade/pages/page1/components/ha-storage-layer-remote/RenderOldMasterSlaveHost.vue b/dbm-ui/frontend/src/views/db-manage/mysql/version-upgrade/pages/page1/components/ha-storage-layer-remote/RenderOldMasterSlaveHost.vue new file mode 100644 index 0000000000..6e019b131d --- /dev/null +++ b/dbm-ui/frontend/src/views/db-manage/mysql/version-upgrade/pages/page1/components/ha-storage-layer-remote/RenderOldMasterSlaveHost.vue @@ -0,0 +1,79 @@ + + + + + + diff --git a/dbm-ui/frontend/src/views/db-manage/mysql/version-upgrade/pages/page1/components/ha-storage-layer-remote/RenderTargetVersion.vue b/dbm-ui/frontend/src/views/db-manage/mysql/version-upgrade/pages/page1/components/ha-storage-layer-remote/RenderTargetVersion.vue index 22151dcae1..1da9ac4af2 100644 --- a/dbm-ui/frontend/src/views/db-manage/mysql/version-upgrade/pages/page1/components/ha-storage-layer-remote/RenderTargetVersion.vue +++ b/dbm-ui/frontend/src/views/db-manage/mysql/version-upgrade/pages/page1/components/ha-storage-layer-remote/RenderTargetVersion.vue @@ -253,6 +253,13 @@ id: version, name: version, })); + + if (localVersion.value) { + packageSelectList.value = (versionMap[localVersion.value] || []).map((versionItem) => ({ + id: versionItem.pkg_id, + name: versionItem.pkg_name, + })); + } }, }); diff --git a/dbm-ui/frontend/src/views/db-manage/mysql/version-upgrade/pages/page1/components/ha-storage-layer-remote/Row.vue b/dbm-ui/frontend/src/views/db-manage/mysql/version-upgrade/pages/page1/components/ha-storage-layer-remote/Row.vue index 9ed6589573..447fcf1785 100644 --- a/dbm-ui/frontend/src/views/db-manage/mysql/version-upgrade/pages/page1/components/ha-storage-layer-remote/Row.vue +++ b/dbm-ui/frontend/src/views/db-manage/mysql/version-upgrade/pages/page1/components/ha-storage-layer-remote/Row.vue @@ -19,6 +19,25 @@ :model-value="clusterInfo" @id-change="handleClusterIdChange" /> + + + + + + + + + + + - +