带有PostgreSQL后端数据库的EC2示例上出现mlflow错误

zhte4eai  于 2022-11-23  发布在  PostgreSQL
关注(0)|答案(1)|浏览(145)

我正在尝试运行此命令:

mlflow server --backend-store-uri postgresql://aagmlflow:mlflow-@aagmlflow.cbh3397nepzq.us-east-1.rds.amazonaws.com/mlflow --default-artifact-root file:/root/mlruns -h 0.0.0.0 -p8000

错误如下:

/usr/local/lib/python3.7/dist-packages/psycopg2/__init__.py:144: UserWarning: The psycopg2 wheel package will be renamed from release 2.8; in order to keep installing from binary please use "pip install psycopg2-binary" instead. For details see: <http://initd.org/psycopg/docs/install.html#binary-install-from-pypi>.
  """)
2022/10/27 16:16:03 WARNING mlflow.store.db.utils: SQLAlchemy engine could not be created. The following exception is caught.
(psycopg2.OperationalError) FATAL:  password authentication failed for user "aagmlflow"
FATAL:  password authentication failed for user "aagmlflow"

(Background on this error at: https://sqlalche.me/e/14/e3q8)
Operation will be retried in 0.1 seconds
2022/10/27 16:16:03 WARNING mlflow.store.db.utils: SQLAlchemy engine could not be created. The following exception is caught.
(psycopg2.OperationalError) FATAL:  password authentication failed for user "aagmlflow"
FATAL:  password authentication failed for user "aagmlflow"

(Background on this error at: https://sqlalche.me/e/14/e3q8)
Operation will be retried in 0.3 seconds
2022/10/27 16:16:04 WARNING mlflow.store.db.utils: SQLAlchemy engine could not be created. The following exception is caught.
(psycopg2.OperationalError) FATAL:  password authentication failed for user "aagmlflow"
FATAL:  password authentication failed for user "aagmlflow"

(Background on this error at: https://sqlalche.me/e/14/e3q8)

我在这里做错了什么?有没有什么方法可以解决这个问题?请我需要社区的帮助。

oyxsuwqo

oyxsuwqo1#

这实际上帮助我解决了这个问题。

mlflow server  --backend-store-uri postgresql \
               --default-artifact-root file:/tmp \
               --host 0.0.0.0 \
               --port 8000

我还用这个做了一个码头集装箱。

# Docker multistage build to reduce image size
FROM python:3.10 AS build
RUN python -m venv /opt/venv
# Make sure we use the virtualenv:
ENV PATH="/opt/venv/bin:$PATH"
RUN pip install mlflow

FROM python:3.10-slim
COPY --from=build /opt/venv /opt/venv
COPY --from=build /usr/lib /usr/lib
# Make sure we use the virtualenv:
ENV PATH="/opt/venv/bin:$PATH"
EXPOSE 8000/tcp
ENTRYPOINT [ "mlflow", "server", "--host", "0.0.0.0"]
CMD [ "--backend-store-uri", "/tmp"]

然后构建并运行容器

docker build -t mlflow-tracking . && docker run -dp 80:8000 mlflow-tracking

相关问题