Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(kafka): 修复kafka manager不自动添加集群 #3908

Merged
merged 1 commit into from
Apr 9, 2024
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -804,8 +804,6 @@ func (i *InstallKafkaComp) InstallManager() error {

/* 配置账号密码
basicAuthentication.enabled=true
basicAuthentication.username=""
basicAuthentication.password=""
*/
extraCmd = fmt.Sprintf(`sed -i -e '/basicAuthentication.enabled/s/false/true/' \
-e '/basicAuthentication.username=/d' \
Expand Down Expand Up @@ -984,8 +982,15 @@ func configCluster(cmak CmakConfig, noSecurity int) (err error) {
}
// http://localhost:9000/{prefix}/clusters
url := "http://" + cmak.NodeIP + ":9000" + cmak.HTTPPath + "/clusters"
req, err := http.NewRequest("POST", url, strings.NewReader(postData.Encode()))
if err != nil {
return err
}
req.SetBasicAuth(cmak.Username, cmak.Password)
contentType := "application/x-www-form-urlencoded"
if _, err = http.Post(url, contentType, strings.NewReader(postData.Encode())); err != nil {
req.Header.Add("Content-Type", contentType)
client := &http.Client{}
if _, err = client.Do(req); err != nil {
logger.Error("post manager failed, %v", err)
return err
}
Expand Down
Loading