How to access PostgreSQL and MongoDB databases in wolkenkit - wolkenkit

I am not able to connect with MongoDB and PostgreSQL. I am using the command below:
docker exec -it todomvc-mongodb mongo -user wolkenkit -p 576085646aa24f4670b929f0c47032ebf149e48f admin.
It shows the following result:
2018-08-14T11:48:20.592+0000 E QUERY [thread1] Error: Authentication failed. : –

I have tried to reproduce your issue. What I have done:
I cloned the wolkenkit-todomvc sample application.
I started it using wolkenkit start.
This gave me the (randomly created) shared key 4852f4430d67990c28354b6fafae449c4f82e9ab (please note that this value is different each time you run wolkenkit start, unless you set it explicitly to a value of your choice, so YMMV).
Then I tried:
$ docker exec -it todomvc-mongodb mongo -user wolkenkit -p 4852f4430d67990c28354b6fafae449c4f82e9ab admin
It actually doesn't work. The reason for this is that the parameter -user does not exist, it either has to be -u or --username. If you run:
$ docker exec -it todomvc-mongodb mongo -u wolkenkit -p 4852f4430d67990c28354b6fafae449c4f82e9ab admin
Then, things work as expected.
Hope this helps 😊

Related

Can't start docker container with Keycloak 16, exited with code 1

I'm a newbie with docker, today I'm trying to start my docker container with keycloak without success, I haven't made any change to the container and it just doesn't want to start up.
Here is the docker log error:
*** JBossAS process (188) received TERM signal ***
User with username 'admin' already added to '/opt/jboss/keycloak/standalone/configuration/keycloak-add-user.json'
The container is not inside any volume, and it was created using the command
docker run -p 8080:8080 -e KEYCLOAK_ADMIN=admin -e KEYCLOAK_ADMIN_PASSWORD=admin quay.io/keycloak/keycloak:16.1.0
I tried it as well and the user account was not created. I believe that is as a result of the fact that the default 16.x.x and below are all based on wildfly and not quarkus. The new quarkus version supports these environment variables for setting up the initial admin user and is the .x preview version from 16.x.x and below.
It is only from 17.x.x onwards that quarkus is fully supported in the default version and is no longer a .x preview version. Link here
I tested this hypothesis by running the same command but only changing the version of keycloak to 17.x.x and adding the state the server should run in and that run fine. The documentation for this is here
docker run -p 8080:8080 -e KEYCLOAK_ADMIN=admin -e KEYCLOAK_ADMIN_PASSWORD=admin quay.io/keycloak/keycloak:17.0.0 start-dev
Also note that the admin login is now at http://localhost:8080/admin instead of http://localhost:8080/auth in the new version.

How to store configuration and database outside orientdb docker container

I'm stuck trying to store OrientDB database and configuration outside of the docker container I'm running. This is the first time using both docker and orientdb so my confusion is multilevel.
Based on https://hub.docker.com/_/orientdb/ I have successfully ran the command docker run -d --name orientdb -p 2424:2424 -p 2480:2480 -e ORIENTDB_ROOT_PASSWORD=rootpwd orientdb but I'm stuck trying to specify where on my local disk to store data and configuration so its not lost when the container is stopped/removed.
I tried adding the -v <databases_path>:/orientdb/databases option but to no avail. I'm probably missing something very basic (since this is my first hands on experience with docker and orientdb). Trying to set up volumes in docker desktop and other trial and error tests have also failed.
Can anyone help? Or point me to some tutorial where I can learn because I'm stuck.
Thanks to #nulldroid I finally figured it out. It was the syntax which messed me up as usual. The following command worked for me. No need to set up volumes etc just a correct formatted path to the directory I already had created using the "/d/" in the beginning for windows "D:"
docker run -d --name orientdb -p 2424:2424 -p 2480:2480 -v /d/docker/test1/databases:/orientdb/databases -e ORIENTDB_ROOT_PASSWORD=root orientdb:latest

invalid credentials for user 'monetdb' when using the official docker image and a .monetdb file

How to recreate my problem
Creating the MonetDB Container
I have this setup (using windows with Docker Desktop).
Create the official monetdb docker container with the follwing command:
docker run -v $HOME/Desktop/monetdbtest:/monetdbtest -e 'MONET_DATABASE=docker' -e 'MONETDB_PASSWORD=docker' -p 50000:50000 -d topaztechnology/monetdb:latest
explanation what the command does:
creates a monetdb container with a database called 'docker' and applies the password 'docker' to the default user called 'monetdb'. It also mounts my directory monetdbtest/ into the container.
Testing the container with DBeaver
I test the connection using DBeaver with the following credentials:
JDBC URL: jdbc:monetdb://localhost:50000/docker
host: localhost
port: 50000
Database/schema: docker
username: monetdb
password: docker
this works fine, i am able to connect and can exequte sql queries with dbeaver.
Using mclient within the container to send queries
I enter the container as root with the following command:
docker exec -u root -t -i nostalgic_hodgkin /bin/bash
(replace nostalgic_hodgkin with your randomly generated container name)
2.
I navigate to my mounted directory
cd monetdbtest
then I test the connection with mclient:
mclient -h localhost -p 50000 -d docker
I get asked for user and password, so for user I enter
monetdb and for password I enter docker. It works and I am in the mclient shell, able to execute SQL queries.
3.
Since I don't want to always enter username and password I create a .monetdb file in the monetdbtest/ directory. It looks like this:
user=monetdb
password=docker
Now I should be able to use the mclient command without entering user information. So I type this command:
mclient -h localhost -p 50000 -d docker
However I get the message:
'nvalidCredentialsException:checkCredentials:invalid credentials for user 'monetdb
I did everything according to the mclient manual. Maybe I missed something?
You may need to export the environment variable DOTMONETDBFILE with value /monetdbtest/.monetdb. See the man page for mclient, especially the paragraph before the OPTIONS heading.

Cant add users to InfluxDb 2.0 GUI/Docker

Im using unraid server and the Docker image InfluxDB.
I'm able to go to mine localhost:8086, and I create root user (admin user), but then, I do not have the option for adding more users.
I can add more organizations and buckets, but I simply can't add any users?
Any hints? Im new to this InfluxDB, my ultimate goal is to hook up with Grafana and Telegraf..
I'd assume that you can add users using the command from the docs.
With docker this should be possible with something like this (given your container name os influxdb2):
$ docker exec influxdb2 influx user create \
-n <username> \
-p <password> \
-o <org-name>
Try logging into the Docker image itself and using the influx command directly to see if you can create a new user - it may give you some insight into what's going on.
docker exec -it imagename bash
then when you have a shell
influx user create -n username
As said the command
docker exec IMAGE influx user create -n username
should achieve the same thing.

Docker container running SQL Server seems to crash every time

I created a Docker container:
sudo docker pull microsoft/mssql-server-linux:2017-latest
Then I ran it:
sudo docker run -e 'ACCEPT_EULA=Y' -e 'MSSQL_SA_PASSWORD=root' -p 1401:1433
--name sqlserver1 -d microsoft/mssql-server-linux:2017-latest
I ran:
docker start sqlserver1
After about 3 seconds docker ps returns empty - making me think the container is shutting down.
I'm new to Docker - is this really shutting down automatically? If so, how do I prevent that?
I gave this a shot, and it looks as if your problem is not a Docker problem...it's simply a MSSQL problem. If you look at the logs for your container, you'll see:
ERROR: Unable to set system administrator password: Password validation failed.
The password does not meet SQL Server password policy requirements because it is
too short. The password must be at least 8 characters.
It looks as if MSSQL enforces password complexity requirements, which include length and number of character classes. The following seems to work fine:
docker run -it -e 'ACCEPT_EULA=Y' -e 'MSSQL_SA_PASSWORD=r00t.R00T' -p 1401:1433 --name sqlserver1 microsoft/mssql-server-linux:2017-latest

Resources