본문 바로가기
프로그래밍 기타

elastic search - failed to authenticate user [elastic]

by 애플 로그 2022. 6. 15.
반응형

elastic search - failed to authenticate user [elastic]

elasticsearch 7.6 버전을 잘 설치하고 기동했다.

특별히 문제가 없어보였는데, 호출시 인증 관련 에러가 발생했다.

 

1. 호출

curl -X GET --user elastic:tmvprxmfk1! "http://localhost:9200/_template/attic_template"
Enter host password for user 'elastic':

 

2. 에러 발생

{
  "error": {
    "root_cause": [
      {
        "type": "security_exception",
        "reason": "failed to authenticate user [elastic]",
        "header": {
          "WWW-Authenticate": "Basic realm=\"security\" charset=\"UTF-8\""
        }
      }
    ],
    "type": "security_exception",
    "reason": "failed to authenticate user [elastic]",
    "header": {
      "WWW-Authenticate": "Basic realm=\"security\" charset=\"UTF-8\""
    }
  },
  "status": 401
}

 

3. 해결

elasticsearch-setup-passwords interactive 를 실행 시켜주고 비밀번호를 초기화 해준다.

cd $elasticsearch_home$/bin
./elasticsearch-setup-passwords interactive


Enter password for [elastic]:
Reenter password for [elastic]:
Enter password for [apm_system]:
Reenter password for [apm_system]:
Enter password for [kibana]:
Reenter password for [kibana]:
Enter password for [logstash_system]:
Reenter password for [logstash_system]:
Enter password for [beats_system]:
Reenter password for [beats_system]:
Enter password for [remote_monitoring_user]:
Reenter password for [remote_monitoring_user]:
Changed password for user [apm_system]
Changed password for user [kibana]
Changed password for user [logstash_system]
Changed password for user [beats_system]
Changed password for user [remote_monitoring_user]
Changed password for user [elastic]

댓글