본문 바로가기
Engineering/토치서브(Torchserve)

[Torchserve] torchserve error - java.io.IOException: Failed to bind ②

by Hyen4110 2022. 8. 31.
반응형

torchserve error - java.io.IOException: Failed to bind 

이전 글에서 에러를 해결하기위해 PORT 번호를 바꾸는 방법을 찾았다.

2022.08.29 - [Error] - [torchserve] torchserve error - java.io.IOException: Failed to bind ①

 

[torchserve] torchserve error - java.io.IOException: Failed to bind ①

torchserve --stop으로 중단시킨 후 --start 로 재시작하였으나, 주소가 이미 사용 중이라는 에러가 발생함 netstat 으로 8080 포트를 확인했지만, kill 할 수있는 PID가 보이지않음! # 문제점1. torchserve가..

hyen4110.tistory.com

 

요약하자면, 

원하는 PORT를 할당하여 직접 config.properties를 입력하는 방법으로 PORT를 바꿨다.

 

PORT 번호는 정상적으로 변경되었지만, 여전히 

torchserve error - java.io.IOException: Failed to bind  에러가 발생했다.

문제는, torchserve initialize 함수에서 self.model 선언 시

huggingface 에서 제공하는 SentenceTransformer 클래스를 생성할때 문제가 발생했다.

pretrained model을 load 할 때 PORT문제가 한번더 발생한다는것 알 수 있었다.

해결방법을 구글링하던 중 

 

config.properties 내에 변경해야할 parameter가 더 있다는것을 알게되었다.

https://github.com/pytorch/serve/issues/346#issuecomment-1001132272

 

port in use: try to test/run torchserve in colab (Torchserve stopped. java.io.IOException: Failed to bind to address: http://127

Is there a workaround to run/dev in colab? Can't get it to run on windows (see previous issue I just entered, so moved to colab....still fails). Followed all pip setup and requirements in readm...

github.com

 

결과적으로 config.properties 파일에

두 grpc port argument를 추가하니 

더 이상 java.io.IOException: Failed to bind 발생하지 않음!

inference_address=http://0.0.0.0:9871
management_address=http://0.0.0.0:9872
metrics_address=http://0.0.0.0:9873

grpc_inference_port=8871
grpc_management_port=8872

 

 

반응형

댓글