Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions api/disaggregated/v1/unique_id.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ func (ddc *DorisDisaggregatedCluster) GetFEServiceName() string {
return ddc.Name + "-" + "fe"
}

func (ddc *DorisDisaggregatedCluster) GetFEVIPAddresss() string {
return ddc.GetFEServiceName() + "." + ddc.Namespace
}

func (ddc *DorisDisaggregatedCluster) GetFEInternalServiceName() string {
return ddc.Name + "-" + "fe-internal"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -496,9 +496,8 @@ func (dcgs *DisaggregatedComputeGroupsController) scaledOutBENodesBySQL(
adminUserName, password := resource.GetDorisLoginInformation(secret)

// get host and port
serviceName := cluster.GetFEServiceName()
// When the operator and dcr are deployed in different namespace, it will be inaccessible, so need to add the dcr svc namespace
host := serviceName + "." + cluster.Namespace
host := cluster.GetFEVIPAddresss()
confMap := dcgs.GetConfigValuesFromConfigMaps(cluster.Namespace, resource.FE_RESOLVEKEY, cluster.Spec.FeSpec.ConfigMaps)
queryPort := resource.GetPort(confMap, resource.QUERY_PORT)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ func (dcgs *DisaggregatedComputeGroupsController) newSpecificEnvs(ddc *dv1.Doris
fqp := resource.GetPort(confMap, resource.QUERY_PORT)
fqpStr := strconv.FormatInt(int64(fqp), 10)
//use fe service name as access address.
feAddr := ddc.GetFEServiceName()
feAddr := ddc.GetFEVIPAddresss()
cgEnvs = append(cgEnvs,
corev1.EnvVar{Name: resource.STATEFULSET_NAME, Value: stsName},
corev1.EnvVar{Name: resource.COMPUTE_GROUP_NAME, Value: ddc.GetCGName(cg)},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -308,9 +308,8 @@ func (dfc *DisaggregatedFEController) dropFEBySQLClient(ctx context.Context, k8s
adminUserName, password := resource.GetDorisLoginInformation(secret)

// get host and port
serviceName := cluster.GetFEServiceName()
// When the operator and dcr are deployed in different namespace, it will be inaccessible, so need to add the dcr svc namespace
host := serviceName + "." + cluster.Namespace
host := cluster.GetFEVIPAddresss()
confMap := dfc.GetConfigValuesFromConfigMaps(cluster.Namespace, resource.FE_RESOLVEKEY, cluster.Spec.FeSpec.ConfigMaps)
queryPort := resource.GetPort(confMap, resource.QUERY_PORT)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ func (dfc *DisaggregatedFEController) newSpecificEnvs(ddc *v1.DorisDisaggregated
corev1.EnvVar{Name: MS_ENDPOINT, Value: msEndpoint},
corev1.EnvVar{Name: CLUSTER_ID, Value: fmt.Sprintf("%d", ddc.GetInstanceHashId())},
corev1.EnvVar{Name: STATEFULSET_NAME, Value: stsName},
corev1.EnvVar{Name: resource.ENV_FE_ADDR, Value: ddc.GetFEServiceName()},
corev1.EnvVar{Name: resource.ENV_FE_ADDR, Value: ddc.GetFEVIPAddresss()},
corev1.EnvVar{Name: resource.ENV_FE_ELECT_NUMBER, Value: strconv.FormatInt(int64(ddc.GetElectionNumber()), 10)},
)
return feEnvs
Expand Down