I'm trying to demo this out in lab environment but I can't get it to work following the docs/walkthrough. When I browse to the librenms web interface I get:
Error connecting to database.
Access denied for user 'librenms'@'172.17.0.3' (using password: YES)
Where 172.17.0.3 is the ip for the librenms container, not the mysql container.
Since I'm just trying to demo before deploying to production I haven't done anything exotic. These are all the commands I've run:
# creating the mysql container
docker run \
--name librenms-mysql \
-d \
-e MYSQL_ROOT_PASSWORD=P@ssw0rd \
-p 127.0.0.1:3306:3306 \
-v /my/persistent/directory/mysql:/var/lib/mysql \
mysql:latest --sql-mode=""
# mysql database as per the librenms docs
mysql --host=127.0.0.1 --user=root -pP@ssw0rd -e "CREATE DATABASE librenms CHARACTER SET utf8 COLLATE utf8_unicode_ci;"
mysql --host=127.0.0.1 --user=root -pP@ssw0rd -e "CREATE USER 'librenms'@'localhost' IDENTIFIED BY 'P@ssw0rd';"
mysql --host=127.0.0.1 --user=root -pP@ssw0rd -e "GRANT ALL PRIVILEGES ON librenms.* TO 'librenms'@'localhost';"
mysql --host=127.0.0.1 --user=root -pP@ssw0rd -e "FLUSH PRIVILEGES;"
# creating the librenms container
docker run \
-d \
-h librenms \
-p 80:80 \
-e DB_HOST=db \
-e DB_NAME=librenms \
-e DB_USER=librenms \
-e DB_PASS=P@ssw0rd \
-e BASE_URL=http://localhost \
--link librenms-mysql:db \
-v /data/logs:/opt/librenms/logs \
-v /data/rrd:/opt/librenms/rrd \
--name librenms \
jarischaefer/docker-librenms
The included P@ssw0rd isn't a real password so don't worry about me posting that.
My docker ps looks like this:
root@photon-2f4de1f20a6e [ ~ ]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
aaf35d473365 jarischaefer/docker-librenms "/sbin/my_init" 8 minutes ago Up 8 minutes 0.0.0.0:80->80/tcp, 443/tcp librenms
5122eba16ad7 mysql:latest "docker-entrypoint..." 11 minutes ago Up 11 minutes 127.0.0.1:3306->3306/tcp, 33060/tcp librenms-mysql
I'm not sure where I've gone wrong so any help I could get on this would be greatly appreciated.
Thanks.
EDIT:
Just some more info on this. As per the nginx logs:
0 shows that dbConnect is being passed the right args (librenms-mysql, librenms, P@ssw0rd, librenms) but #5 indicates something is changing the database to the librenms container's ip.
I'm trying to demo this out in lab environment but I can't get it to work following the docs/walkthrough. When I browse to the librenms web interface I get:
Where 172.17.0.3 is the ip for the librenms container, not the mysql container.
Since I'm just trying to demo before deploying to production I haven't done anything exotic. These are all the commands I've run:
The included P@ssw0rd isn't a real password so don't worry about me posting that.
My
docker ps
looks like this:I'm not sure where I've gone wrong so any help I could get on this would be greatly appreciated.
Thanks.
EDIT: Just some more info on this. As per the nginx logs:
0 shows that dbConnect is being passed the right args (librenms-mysql, librenms, P@ssw0rd, librenms) but #5 indicates something is changing the database to the librenms container's ip.