Docker> postgresql9.6 error - postgresql

I am using docker to install postgresql 9.6 from centos7 image. I got an error while initialize the postgresql and also problem with this service.
sh-4.2# usr/pgsql-9.6/bin/postgresql96-setup initdb
Failed to get D-Bus connection: Operation not permitted
failed to find PGDATA setting in postgresql-9.6.service
sh-4.2# systemctl start postgresql-9.6.service
Failed to get D-Bus connection: Operation not permitted

Related

mlflow error on an EC2 instance with postgreSQL backend database

I am trying to run this command:
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
Error is below here:
/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)
what could i be doing wrong here?
Is there any way i could troubleshoot this? Please i need help from the community.
this actually helped me resolved this issue.
mlflow server --backend-store-uri postgresql \
--default-artifact-root file:/tmp \
--host 0.0.0.0 \
--port 8000
I also ran a docker container with this too.
# 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"]
then build & run the container
docker build -t mlflow-tracking . && docker run -dp 80:8000 mlflow-tracking

MongoDB starting with status error on macOS

I'm using homebrew to initialize mongodb as it follows:
brew services start mongodb-community#5.0
It starts successfully
==> Successfully started mongodb-community (label: homebrew.mxcl.mongodb-community)
However, when I type mongoto run mongodb, I keep getting connection refused:
MongoDB shell version v5.0.2
connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb
Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed: SocketException: Error connecting to 127.0.0.1:27017 :: caused by :: Connection refused :
connect#src/mongo/shell/mongo.js:372:17
#(connect):2:6
exception: connect failed
exiting with code 1
So I typed brew services list to check if the mongoDB is up, and it seems it started with an error status:
Name
Status
User
Plist
mongodb-community
error
guilhermemendes
/opt/homebrew/opt/mongodb-community/...
check the following.
if you are using M1 based MacOS then install mongo db (and brew) with Rosetta.
check the IP binding on mongo config
(/usr/local/etc/mongod.conf or /opt/homebrew/etc/mongod.conf)
verify the connection string URI format - Mongo docs - connection-string-uri-format

Downgrading MongoDB 3.4 to 3.2, can't connect to shell

I am getting this error instead of my shell prompt (running Ubuntu 16.04LTS).
I'm pretty new to MongoDB. I had to downgrade from version 3.4 to 3.2:
https://docs.mongodb.com/manual/release-notes/3.4-downgrade-standalone/
I followed those instructions (I thought) pretty faithfully, but now can't access the shell to confirm, etc.
scorpian555#scorpo:~$ mongo
MongoDB shell version: 3.2.15
connecting to: test
2017-07-13T14:41:31.434-0400 W NETWORK [thread1] Failed to connect to
127.0.0.1:27017, in(checking socket for error after poll), reason:
errno:111 Connection refused
2017-07-13T14:41:31.434-0400 E QUERY [thread1] Error: couldn't
connect to server 127.0.0.1:27017, connection attempt failed :
connect#src/mongo/shell/mongo.js:229:14
#(connect):1:6
exception: connect failed
There was a socket file that the error seems to be referencing at /tmp/mongodb-27017.sock
Per these, I ended up removing that socket file, then tried to reboot the mongod daemon:
'Failed to unlink socket file" error in MongoDB 3.0
MongoDB - Permission denied for socket: /tmp/mongodb-27017.sock
service mongod restart
service mongod status
scorpian555#scorpo:~$ service mongod status
● mongod.service - High-performance, schema-free document-oriented
database
Loaded: loaded (/lib/systemd/system/mongod.service; enabled; vendor
preset: enabled)
Active: active (running) since Thu 2017-07-13 14:58:08 EDT; 4s ago
Docs: https://docs.mongodb.org/manual
Main PID: 4763 (mongod)
CGroup: /system.slice/mongod.service
└─4763 /usr/bin/mongod --quiet --config /etc/mongod.conf
Jul 13 14:58:08 scorpo systemd[1]: Started High-performance, schema-
free document-oriented database.
Per those, I removed the socket file and ran:
scorpian555#scorpo:~$ ls -ld /tmp
drwxrwxrwt 17 root root 20480 Jul 13 14:58 /tmp
I think I'm a little lost here, I was under the impression that, upon restart of the daemon, it would recreate this temporary file, at which point I would check the permissions.
I can't find the link at the moment, but had found elsewhere instructions to make sure the owner of the mongod.sock file was mongod (not root) and I would have to chown it if it wasn't mongod.
I'm pretty new to MongoDB, like I said. I found this as another possible issue, but wanted to see if I should dive down this rabbit hole or whether I might be looking in the wrong place?
Connection refused to MongoDB errno 111
Thanks.
My issue was that, while I started the mongod service, I did not actually run the daemon with sudo as needed.

Suddenly can't connect to remote mlab mongodb

I'm trying to connect to a remote mlab database. Everything works fine, except for some times I simply can’t connect to the database. It might have something to do with my computer since my test server can connect to it without any problems. Nevertheless I can’t figure out what the problem might be. I went through their connection troubleshooting guide but already got stuck at the first step
nc -w 3 -v ds119568.mlab.com 19568
gives the following error:
nc: connectx to ds119568.mlab.com port 19568 (tcp) failed: Operation timed out
Trying to connect via mongo shell gives this error:
MongoDB shell version v3.4.3
connecting to: mongodb://ds119568.mlab.com:19568/ba
2017-07-08T15:05:04.528+0200 W NETWORK [thread1] Failed to connect to
54.73.159.50:19568 after 5000ms milliseconds, giving up.
2017-07-08T15:05:04.533+0200 E QUERY [thread1] Error: couldn't
connect to server ds119568.mlab.com:19568, connection attempt failed :
connect#src/mongo/shell/mongo.js:237:13
#(connect):1:6
exception: connect failed
Advice what on what could be the problem here? Does it have something to do with the firewall of my computer?
This worked for me (Ubuntu 16.04) :
sudo systemctl start mongod
Doesn't give output. Check the status to verify that the service has started properly.
sudo systemctl status mongod
Output should be something like:
● mongod.service - High-performance, schema-free document-oriented database
Loaded: loaded (/lib/systemd/system/mongod.service; disabled; vendor preset: enabled)
Active: active (running) since Fri 2017-02-17 18:57:26 UTC; 17min ago
Docs: https://docs.mongodb.org/manual
Main PID: 2811 (mongod)
Tasks: 17
Memory: 56.8M
CPU: 7.294s
CGroup: /system.slice/mongod.service
└─2811 /usr/bin/mongod --quiet --config /etc/mongod.conf
Verify that its running:
sudo systemctl enable mongod
Output should be:
Created symlink from /etc/systemd/system/multi-user.target.wants/mongod.service
to /lib/systemd/system/mongod.service.
Then you should be able to connect to mongo shell.
mongo
For more refer to this link: https://www.digitalocean.com/community/tutorials/how-to-install-and-secure-mongodb-on-ubuntu-16-04

Error running PostgreSQL on Docker-io

When attempting to initialise the PostgreSQL database after installing on a Docker-io Fedora 19 container I get the following error:
bash-4.2# postgresql-setup initdb
Failed to get D-Bus connection: No connection to service manager.
failed to find PGDATA setting in postgresql.service
Looks like an environmental issue but any help would be appreciated.