[Eureka] Django Eureka 연동
[Eureka Client 설치]
pip install py_eureka_client
[Django App 설정]
app/__init__.py
import py_eureka_client.eureka_client as eureka_client
import py_eureka_client.logger as logger
your_rest_server_port = 8001
# The flowing code will register your server to eureka server and also start to send heartbeat every 30 seconds
discovery_client = eureka_client.init(eureka_server="http://localhost:8761",
app_name="tricycle",
instance_host="localhost",
instance_port=your_rest_server_port,
ha_strategy=eureka_client.HA_STRATEGY_STICK)
logger.set_level("DEBUG")
댓글
댓글 쓰기