Docker failed: port is already allocated. 에러 발생

2024. 9. 29. 11:55·Error Note
반응형

- failed: port is already allocated 에러는 말 그대로 도커를 실행시킬 때, 매핑한 포트가 현재 로컬상 미리 선점된 포트라는 뜻입니다.

 

윈도우를 기준으로 설명드리면,

Docker 실행시 port 중복 에러가 발생하면,

 

>> netstat -ano | findstr :2181

 

위와 같이 특정 포트(2181) 이 실행중인지 확인하고,

프로세스가 존재한다면
   

 >> sudo kill -9 <PID>
    

위와 같이 프로세스 아이디를 입력하여 종료하면 됩니다.

만약 프로세스가 검색되지 않을 수도 있습니다.

이 경우는 OS 에서 해당 포트를 사용하지 못하도록 막아두었을 가능성이 있습니다.

 

cmd 를 관리자 권한으로 실행하고,

>> netsh interface ipv4 show excludedportrange protocol=tcp

 

위 명령어로 필요한 포트가 제한되어 있는지 확인합니다.
윈도우 내에서 자체적으로 보호중인 포트 번호를 확인하는 것입니다.

>> net stop winnat
>> netsh int ipv4 add excludedportrange protocol=tcp startport=2181 numberofports=1
>> net start winnat

위와 같이 포트를 재설정하면 됩니다.

반응형
저작자표시 비영리 변경금지 (새창열림)

'Error Note' 카테고리의 다른 글

[Springboot 에러] Request processing failed: org.springframework.web.multipart.MultipartException: Failed to parse multipart servlet request] with root cause] [le]org.apache.tomcat.util.http.fileupload.impl.FileCountLimitExceededException:  (0) 2025.12.16
Python Fastapi FormData alias is not working 2025-04-22  (0) 2025.04.22
docker compose 에서 network_mode: "host" 설정 시 local 에서 접근 불가.  (0) 2024.09.29
Springboot Kotlin 에서 @InitBinder 사용하기 (@InitBinder methods must not return a value (should be void): 에러 해결)  (0) 2023.08.31
Springboot Gradle 빌드시, java.lang.IllegalStateException: Module entity with name 에러 발생  (0) 2023.08.30
'Error Note' 카테고리의 다른 글
  • [Springboot 에러] Request processing failed: org.springframework.web.multipart.MultipartException: Failed to parse multipart servlet request] with root cause] [le]org.apache.tomcat.util.http.fileupload.impl.FileCountLimitExceededException:
  • Python Fastapi FormData alias is not working 2025-04-22
  • docker compose 에서 network_mode: "host" 설정 시 local 에서 접근 불가.
  • Springboot Kotlin 에서 @InitBinder 사용하기 (@InitBinder methods must not return a value (should be void): 에러 해결)
Railly Linker
Railly Linker
IT 지식 정리 및 공유 블로그
  • Railly Linker
    Railly`s IT 정리노트
    Railly Linker
  • 전체
    오늘
    어제
  • 공지사항

    • 분류 전체보기 (176)
      • Programming (80)
        • BackEnd (40)
        • FrontEnd (14)
        • DBMS (3)
        • ETC (23)
      • Study (88)
        • Computer Science (21)
        • Data Science (24)
        • Computer Vision (22)
        • Computer Graphics (1)
        • NLP (15)
        • ETC (4)
      • Error Note (7)
      • ETC (1)
  • 인기 글

  • 최근 글

  • 최근 댓글

  • 태그

    데이터베이스 제약
    springboot 배포
    Kotlin
    kotlin arraylist
    localhost
    MacOS
    논리적 삭제
    kotlin linkedlist
    지리 정보
    docker compose
    jvm 메모리 누수
    kotlin mutablelist
    unique
    단축키
    docker 배포
    network_mode: "host"
    list
  • 링크

    • RaillyLinker Github
  • hELLO· Designed By정상우.v4.10.0
Railly Linker
Docker failed: port is already allocated. 에러 발생
상단으로

티스토리툴바