sudo docker-compose up
[+] Running 3/3
✔ Network myapp_manticore-network Created 1.1s
✔ Container manticore Recreated 7.5s
✔ Container myapp-mysql-client-1 Created 4.8s
Attaching to manticore, mysql-client-1
manticore | Manticore 6.2.12 dc5144d35@230822 (columnar 2.2.4 5aec342@230822) (secondary 2.2.4 5aec342@230822)
manticore | Manticore 6.2.12 dc5144d35@230822 (columnar 2.2.4 5aec342@230822) (secondary 2.2.4 5aec342@230822)
manticore | [Sat Jan 13 04:12:55.472 2024] [1] using config file '/etc/manticoresearch/manticore.conf' (9278 chars)...
manticore | starting daemon version '6.2.12 dc5144d35@230822 (columnar 2.2.4 5aec342@230822) (secondary 2.2.4 5aec342@230822)' ...
manticore | listening on all interfaces for mysql, port=9306
manticore | listening on UNIX socket /var/run/mysqld/mysqld.sock
manticore | listening on 172.21.0.2:9312 for sphinx and http(s)
manticore | listening on all interfaces for sphinx and http(s), port=9308
sudo docker-compose exec mysql-client mysql -h manticore -P 9306
ERROR 2003 (HY000): Can't connect to MySQL server on 'manticore:9306' (111)
sudo docker-compose exec mysql-client mysql -P 9306
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
sudo docker-compose exec manticore mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111)
sudo docker-compose exec mysql-client mysql -h manticore -P 9306 and sudo docker-compose exec manticore mysql work fine for me with exactly same docker-compose file.
sudo docker-compose exec mysql-client mysql -P 9306 shouldn’t work.
Please provide your full log of docker compose up, perhaps there’s some error.
I tried everything yesterday but its not working. Any ideaas?
Also wanted to inform you that in the docs, if we insert - ./manticore.conf:/etc/manticoresearch/manticore.conf in the docker compose it gives an error about trying to mount a directory over a file.
I think the correct statement should be ./manticore.conf:/etc/manticoresearch
Yup. I asked some1, & he said that the problem is with mysql since docker & mysql dont work together properly. So they suggested, to have a local mysql installation & use manticore from docker as usual to connect. It sounds promising, but im yet to check that approach
Ive made the changes per your suggestion-
with this
sudo docker-compose exec -it manticore gosu manticore indexer --all --rotate
Manticore 6.2.12 dc5144d35@230822 (columnar 2.2.4 5aec342@230822) (secondary 2.2.4 5aec342@230822)
Copyright (c) 2001-2016, Andrew Aksyonoff
Copyright (c) 2008-2016, Sphinx Technologies Inc (http://sphinxsearch.com)
Copyright (c) 2017-2023, Manticore Software LTD (https://manticoresearch.com)
using config file '/etc/manticoresearch/manticore.conf'...
indexing table 'product'...
FATAL: failed to open /var/lib/manticore.tmp.spl: Permission denied, will not index. Try --rotate option.
& this
sudo docker-compose exec -it manticore indexer --all --rotate
Manticore 6.2.12 dc5144d35@230822 (columnar 2.2.4 5aec342@230822) (secondary 2.2.4 5aec342@230822)
Copyright (c) 2001-2016, Andrew Aksyonoff
Copyright (c) 2008-2016, Sphinx Technologies Inc (http://sphinxsearch.com)
Copyright (c) 2017-2023, Manticore Software LTD (https://manticoresearch.com)
using config file '/etc/manticoresearch/manticore.conf'...
indexing table 'product'...
ERROR: table 'product': sql_connect: Can't connect to MySQL server on '127.0.0.1:9306' (111) (DSN=mysql://root:***@127.0.0.1:9306/testdb).
total 0 docs, 0 bytes
total 0.002 sec, 0 bytes/sec, 0.00 docs/sec
total 0 reads, 0.000 sec, 0.0 kb/call avg, 0.0 msec/call avg
total 0 writes, 0.000 sec, 0.0 kb/call avg, 0.0 msec/call avg
using docker/docker-compose yields same result. Sorry for constantly asking for help but im stuck on this for like forever now, & I need some help.
Much appreciated
ok so correct me if im wrong because this is a bit confusing- mysql localhost:9306 is just a clients wherein we write queries for manticore to work, but for creation of tables, insertions etc, we use a different host & port? & why do we do this? As in whats the structure or flow pattern of the execution of this?
Any articles I can refer to or any examples that work (including mysql commands)?
sql_host/sql_port are what indexer will connect to in order to fetch data from your external database. Otherwise it just can’t know where to execute your sql_query, you have to give the source all the credentials including proper host/port to connect to the mysql instance.
So, you need to run another mysql container alongside with the manticore container or if there’s already a running one, you can map it’s port to the manticore container in the docker-compose YAML and then use that instead of 9306 in sql_port.
ok…ill try to do this, not quite sure I understand whats going on yet, but ill give it a shot.
My main db is cassandra actually. so im gonna have to populate the same data in mysql too for indexing ig. Thankyou for bearing with me
ive read that plain tables make it easier for indexing in bulk. The architecture is - store data in a message queue & as soon as say 100 messages are obtained, insert them in bulk to be indexed. Cassandra is used for persistence but the data that cassandra stores needs to be real time. But for searches, since no user is going to search for something just recently posted, the time delay is acceptable.
Thats the approach I thought of?
insert/replce/delete in Manticore in the same place where you insert/replace/delete in Cassandra
write a small script to read from Cassandra and insert into a Manticore real-time table in batches. It looks like you already have such a script, but it now writes first into mysql and then you run indexer to copy the data into Manticore. If this is true, then it’s non-efficient.
oh. thats some valuable insights. Honestly, i dont have any scripts yet because m priority rn is to first have manticore work atleast without any errors. But yeah, i am a bit confused about how manticore works so I didnt know what im doing apart from following a few blogs.
Honestly, I can make a latency tradeoff because searches not being immediately available is no big deal. But I need this entire thing to run as cheaply as possible, in terms of memory, (thus going for columnar, ig). & offer fast reads too ofc which manticore is quite decent at. I dont want to store any data in manticore since dont wanna pay for extra storage. Only 1 db for storage, so will have to index data everytime ig.
With this architecture consideration, what would you recommend?
& what exactly do you mean by -
insert/replce/delete in Manticore in the same place where you insert/replace/delete in Cassandra
afaik, in the docs it only connects to some sql & odbc dbs. How do I get manticore to access the cassandra db?
im sorry for the trouble but could you explain why the current method is inefficient & whats the most cheap method I can use in terms of memory. I dont want to persist the data anywhere btw except cassandra.
whats the most cheap method I can use in terms of memory. I dont want to persist the data anywhere btw except cassandra.
In this case:
you don’t need mysql since it also requires RAM
write a script which reads from Cassandra and writes to Manticore batch by batch (e.g. 1000 docs in each batch). Previously you asked:
& what exactly do you mean by - “insert/replce/delete in Manticore in the same place where you insert/replace/delete in Cassandra”
Please read about RT mode and RT tables in the docs. E.g take this course Manticore Introduction in RealTime tables about RT tables in Plain mode and look through the quick start guide. Then when you learn how to insert data into a Manticore real-time table, consider updating your app, so you write not only to Cassandra, but to Manticore too.