Hello, I am using setting up a Docker container running ignition and I would like to tie the tag historian up to a MariaDB that is running on the host machine. What are the steps I need to take to ensure that it is setup properly?
In addition to this, I have also allowed the Ignition container to use the host networking resources, rather than bridging the container network to the host network, to make it "easier". I would like to use the bridge function, but I just need to get it working first.
If you're using host networking, then the fact that Ignition is in a docker container is almost irrelevant. Just configure your database connection like normal, and use localhost
in your connection URL. Connecting to MariaDB | Ignition User Manual
So I attempted this and I continue to get a Fault on the Database connection page. Is there a way to see why the fault is occurring? I have allowed all localhost connections on the MariaDB still having issues.
Is there anything in the logs? I personally don't know which logger you may need to adjust the log level on, but it's probably documented somewhere, maybe even in the forum.
Status > Connections > Databases. Click the Details button.
Should be a message and stack trace?
I checked the logs... it was a user-privileges issue from the Database side. Looking at those logs helped isolate the issue.
As a follow-up, if I wanted to use bridge mode rather than host mode, how would I configure the database connection? Would i have to reference the specific ip address of the host machine in the configuration? Also, how would I findout what IP address I am binded to inside the container, because I also need to allow the user privledges from the container, in my MariaDB priveledges.
I think you'd need to host the DB in either another Docker container or on some other host.
edit: that might not be right, you'll have to try some stuff.
You can get the container IP from the docker CLI, there's an example in here:
I think you can just use the host ip to reach the host when using the default bridge, but I don't remember for certain.
This worked! I had to make sure the host machine allowed the Docker Container IP address and the MariaDB instance allowed the user from the specific ip range. Once I got that set, I got the "VALID" connection! Thank you so much
Glad you got it working!
You can use host.docker.internal
within the container to resolve to the host machines address. ref: Explore networking features on Docker Desktop | Docker Docs