ElasticHQ / elasticsearch-HQ

Monitoring and Management Web Application for ElasticSearch instances and clusters.
http://www.elastichq.org
Other
4.97k stars 532 forks source link

attempt to write a readonly database #403

Closed KlavsKlavsen closed 5 years ago

KlavsKlavsen commented 6 years ago

python 3.5, elastichq 3.4.0..

I run daemon as nobody user..The error message is from when I try to add cluster config.. it seems it defaults to putting its sqlite3 db smack in the middle of the python .. /usr/share/python/elasticsearch-hq/lib/python3.5/site-packages/elastichq.db

I could not find any settings example file..i assume I can tell it which DB to use, where to store sqlite3 db etc.?

KlavsKlavsen commented 6 years ago

(it says it tries to load /etc/elastichq/settings.json)

KlavsKlavsen commented 6 years ago

i had to switch to running it as root user it to work :(

royrusso commented 6 years ago

This is strange... the elastichq.db is normally created where the code is running, so local. Typically this is at the same level as application.py. I find it strange that it's attempting to create it where the imports are in site-packages.

KlavsKlavsen commented 6 years ago

its probably because I created a systemd service file to run it.. it really should load a config file, to tell it where to put its data, so one can make sure the user it runs as, can write to that folder.

wdm0006 commented 6 years ago

@KlavsKlavsen you should actually be able to do that already, if you write a settings.json file with the sqlite db specified in SQLALCHEMY_DATABASE_URI as wherever you want the path to be. You can put that file in ~ or in /etc/elastic-hq.

KlavsKlavsen commented 6 years ago

And could you give an example of such a settings.json file? how should it look - what parameters can I set there?

royrusso commented 6 years ago

I will add this to the online docs, once I get an example working.