-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MySQL database support #953
Comments
For alternatives, I can think of at least two
|
I mean to support MySQL Databases for storing data of it, where are data stored now? I don't want to monitor it. |
Going to cross reference #894. I don't know if its Louis saying he wont support other databases, or just that they aren't supported RN tho. |
Please @louislam stay strong on this and do not accept anything related to supporting other DBs. |
With easy to setup being one of the key advantages of this tool, adding a full database server could significantly complicate things. Even at the scale of GitLab, where they have cookbooks and Rails powering their database migrations, I still end up having issues during upgrade. I also don't think it's anywhere close to being possible with the current codebase, since a lot of things are closely coupled with SQLite. |
Yes, especially Uptime Kuma is being developed by my free time and contributors' free time. Manpower is not enough for supporting this feature, so it is likely to be a very low priority request. The feature request itself isn't bad, just because the complexity of the task. It remains open. |
I understand why you went the way with SQLite and why it is a pain in the butt to maintain other DBs. I just want to add one more use case where it is needed. I'm using the docker-swarm stack for fail-proof, and there is no way to use local storage because the app can be migrated to another machine. So the only way for the app to function is to have an external DB. |
So today I got bored and added support for MySQL on my fork. Connection options are provided via ENV variables. Support for another databases should be easily added in However it is not backwards compatible with existing databases. I have removed the old patching functions, the database template file and implemented migrations using knex. Backwards compatibility could be done in two ways
@louislam please take a look at it, whether you agree to move to knex I had to convert two complex queries to knex format/syntax. Other queries seem simple enough to be compatible with most (if not all) SQL databases. I'd recommend to convert them also, but did not want to waste time if it won't be accepted. PS: I tried to make the "uptime formula" calculation/query/function more understandable. I spent 20 minutes trying to comprehend it 😅. |
@trogper I think opening a PR can help to push further this integration. Otherwise, it's hard to track all your changes and make some decisions. |
How does one pass credentials for testing that port? I am getting a lot of log entries for no credentials passed? |
Maybe using a more modular approach would suffice for people that need mysql support. It is pretty simple to write a healthcheck rest service that you let respond with HTTP 200 if the cluster is healthy, and with HTTP 500 if it isn't. As inspiration, you could take a look at the service we wrote for PostgreSQL: https://github.com/neuroforgede/pg_auto_failover_ansible/tree/master/tools/health_monitor |
@s4ke this is not about monitoring MySQL, but about using MySQL as the database. |
@trogper ouch, sorry. read it again. |
I don't really know how to develop NodeJS, but I do need to use other databases because I have over 300 services to monitor and SQLite expands a lot and crashes almost every day. Very good open source project, I hope someone can solve . |
@elizabeth-wilona |
{"status":"fail","msg":"Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call?"}
It happens randomly when my database file has about 1GB, and it happens more and more frequently as the volume gets bigger and bigger. |
You can use this script in /etc/crontab (at least it works in Debian, I suppose Ubuntu also)
It just checks if Mysql running. |
For me the motivation to use a DB other than Sqlite is to ease the deployment of Uptime Kuma. Currently I deployed it as a StaefulSet in EKS, and used a Persisted Volume backed by AWS EBS.
That's mean Uptime Kuma can't run in an HA mode. I'm thinking of workaround this issue by running another separate instance of Uptime Kuma, in a different zone, which monitor the other instance of Uptime Kuma. But of course it complicate the situation. I understand how hard is to support multiple databases, especially when the core code contains the logic for all those database. Maybe it would be better to introduce a plugable |
@dvdlevanon We already have something like pluggabe storage engine - an ORM. Kuma uses knox.js, which supports many different SQL databases, but kuma in current implementation is fixed to SQLite only. I have experimented with removing the explicit SQLite dependency and adding support for MySQL in my fork and PR #1139. |
Having mysql support would be super important too me, because my uptime kuma is super slow I have about 68 monitors and loading the dashboard takes about half a minute with a sqlite size of about 720mb |
We have 100+ monitors and kuma is becoming super slow. Adding or deleting a monitor can easily take minutes(!) |
50~ monitors, it's very slow. |
@vadikcoma @ljcbaby |
v2 will include the ability to connect to a mysql |
🏷️ Feature Request Type
Other
🔖 Feature description
Add MySQL db support
✔️ Solution
Support MySQL databases
❓ Alternatives
No response
📝 Additional Context
No response
The text was updated successfully, but these errors were encountered: