Monday, November 27, 2023

[DevOps] Hint for running portainer under podman

Hello, 

Officially the Portainer is supports only docker, but on some systems we can use only Podman (RHEL systems), with this is hint you can run portainer under podman:

systemctl enable podman
systemctl start podman

#You will need to enable linger for this user in order for the socket to work when the user is not logged in.
loginctl enable-linger $USER

docker run -d -p 8000:8000 -p 9443:9443 --name portainer --restart=always -v /run/podman/podman.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce:latest


Friday, June 2, 2023

[DevOps] Debug MongoDB pipelines

Sometime, MongoDB server is crash when tried to run some pipelines (aggregations). The main problem – it's happens without logs and hardly to detect it and debug. 

For debugging, you can use this command in MongoDB client for getting latest logs before crash and for detecting what aggregation is evoking error.

db.adminCommand( { getLog:"global" })

This command requires some additional admin permissions for getting logs and not available for regular users

[DevOps] Remove all docker logs

Sometimes are needs to remove logs for all containers, for example, when you not have enough disk space

sudo sh -c "truncate -s 0 /var/lib/docker/containers/*/*-json.log"