klokantech / osmnames-sphinxsearch

Geocoder search engine for OSMNames.org data powered by sphinx search
https://osmnames.org/
MIT License
76 stars 24 forks source link

Can't connect to MYSQL server #53

Closed Johanneke closed 6 years ago

Johanneke commented 6 years ago

I've downloaded the planet file from osmnames.org and unarchived it. I then ran docker run -d -v /path/to/folder/:/data/ -p 80:80 klokantech/osmnames-sphinxsearch with the correct path, but on any query I try I get the following response: { "count": 20, "startIndex": 0, "message": "(2003, \"Can't connect to MySQL server on '127.0.0.1' (111)\")", "totalResults": 0, "results": [] }

MartinMikita commented 6 years ago

Hello,

The planet file is very large, and it took ~ 30 minutes on 8-cores CPU with SSD disk index and start the sphinxsearch database.

How long have you waited after running the docker till you received the response?

You can check the indexing process, which is logged into the file /var/log/sphinxsearch/sphinx-reindex.log inside the running container.

Johanneke commented 6 years ago

Ah, that might be it then. Might be nice to add to the documentation how/where to find the progress. I'll try again now.

MartinMikita commented 6 years ago

The longer time for indexing is mentioned in the documentation already - https://github.com/klokantech/osmnames-sphinxsearch#index-storage-space

After you confirm, that it is now working, we may add mention about the progress of the index log.

Johanneke commented 6 years ago

The log states the following:

using config file '/etc/sphinxsearch/sphinx.conf'...
WARNING: key 'charset_type' was permanently removed from Sphinx configuration. Refer to documentation for details.
WARNING: key 'charset_type' was permanently removed from Sphinx configuration. Refer to documentation for details.
indexing index 'ind_charset'...
ERROR: index 'ind_charset': key 'path' not found.
indexing index 'ind_main_charset'...
ERROR: index 'ind_main_charset': key 'path' not found.
indexing index 'ind_name_exact_0'...

I don't know if that is normal and I just need to wait longer? I just started the container.

MartinMikita commented 6 years ago

This is normal and expected for the config, wait for 30 minutes and then check the whole log file, most require is the ending of the log file, not the beginning (tail -n 30 /var/log/sphinxsearch/sphinx-reindex.log)

Johanneke commented 6 years ago

It works, the logging ends with "finished", and my query returns results. Thanks!