All Projects → manticoresoftware → docker

manticoresoftware / docker

Licence: other
Official docker for Manticore Search

Programming Languages

shell
77523 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to docker

sphinxql
SphinxQL query builder for Node.js. sphinxql package supports Manticore Search and Sphinx Search
Stars: ✭ 21 (-46.15%)
Mutual labels:  search-engine, sphinxsearch, manticoresearch, manticore-search
go-sdk
Go client for Manticore Search
Stars: ✭ 22 (-43.59%)
Mutual labels:  sphinxsearch, manticoresearch
sov2ex
sov2ex - 一个便捷的 v2ex 站内搜索引擎
Stars: ✭ 36 (-7.69%)
Mutual labels:  search-engine
Verdant Search
用python+fastapi实现的搜索引擎
Stars: ✭ 13 (-66.67%)
Mutual labels:  search-engine
react-search
This package will help you create a pretty good and beautiful search. And other related features
Stars: ✭ 17 (-56.41%)
Mutual labels:  search-engine
legitbot
🤔 Is this Web request from a real search engine🕷 or from an impersonating agent 🕵️‍♀️?
Stars: ✭ 18 (-53.85%)
Mutual labels:  search-engine
torrent-hound
Search torrents from multiple websites via the CLI
Stars: ✭ 28 (-28.21%)
Mutual labels:  search-engine
wp-statistics
Complete WordPress Analytics and Statistics for your site!
Stars: ✭ 83 (+112.82%)
Mutual labels:  search-engine
maricutodb
PHP Flat File Database Manager
Stars: ✭ 23 (-41.03%)
Mutual labels:  search-engine
jack bunny
Inspired by Facebook's bunnylol search engine.
Stars: ✭ 19 (-51.28%)
Mutual labels:  search-engine
seo-analyzer
The library for analyze a HTML file to show all of the SEO defects
Stars: ✭ 53 (+35.9%)
Mutual labels:  search-engine
yang-db
YANGDB Open-source, Scalable, Non-native Graph database (Powered by Elasticsearch)
Stars: ✭ 92 (+135.9%)
Mutual labels:  search-engine
awesome-search-engine-optimization
A curated list of backlink, social signal opportunities, and link building strategies and tactics to help improve search engine results and ranking.
Stars: ✭ 82 (+110.26%)
Mutual labels:  search-engine
pia
📚 🔬 PIA - Protein Inference Algorithms
Stars: ✭ 19 (-51.28%)
Mutual labels:  search-engine
x
Commerce Search & Discovery frontend web components
Stars: ✭ 54 (+38.46%)
Mutual labels:  search-engine
minimal-search-engine
最小のサーチエンジン/PageRank/tf-idf
Stars: ✭ 18 (-53.85%)
Mutual labels:  search-engine
jochre
Java Optical CHaracter Recognition
Stars: ✭ 18 (-53.85%)
Mutual labels:  search-engine
instant-apps
Your search box is now an app store! 🎉
Stars: ✭ 93 (+138.46%)
Mutual labels:  search-engine
fleeg-platform
Fleeg is a free and open source platform to index and search pages.
Stars: ✭ 21 (-46.15%)
Mutual labels:  search-engine
OpenSearch
🔎 Open source distributed and RESTful search engine.
Stars: ✭ 5,585 (+14220.51%)
Mutual labels:  search-engine

Manticore Search Docker image

This is the git repo of official Docker image for Manticore Search.

Manticore Search is an easy to use open source fast database for search. It helps thousands of companies from small to large, such as Craigslist, to search and filter petabytes of text data on a single or hundreds of nodes, do stream full-text filtering, add auto-complete, spell correction, more-like-this, faceting and other search-related technologies to their websites and applications.

The default configuration includes a sample Real-Time index and listens on the default ports:

  • 9306 for connections from a MySQL client
  • 9308 for connections via HTTP
  • 9312 for connections via a binary protocol (e.g. in case you run a cluster)

The image comes with libraries for easy indexing data from MySQL, PostgreSQL XML and CSV files.

How to run Manticore Search Docker image

Quick usage

The below is the simplest way to start Manticore in a container and log in to it via mysql client:

docker run --name manticore --rm -d manticoresearch/manticore && sleep 3 && docker exec -it manticore mysql && docker stop manticore

When you exit from the mysql client it stops and removes the container, so use it only for testing / sandboxing purposes. See below how to use it in production.

The image comes with a sample index which can be loaded like this:

mysql> source /sandbox.sql

Also the mysql client has in history several sample queries that you can run on the above index, just use Up/Down keys in the client to see and run them.

Production use

Ports and mounting points

For data persistence /var/lib/manticore/ should be mounted to local storage or other desired storage engine.

docker run --name manticore -v $(pwd)/data:/var/lib/manticore -p 127.0.0.1:9306:9306 -p 127.0.0.1:9308:9308 -d manticoresearch/manticore

Configuration file inside the instance is located at /etc/manticoresearch/manticore.conf. For custom settings, this file should be mounted to your own configuration file.

The ports are 9306/9308/9312 for SQL/HTTP/Binary, expose them depending on how you are going to use Manticore. For example:

docker run --name manticore -v $(pwd)/manticore.conf:/etc/manticoresearch/manticore.conf -v $(pwd)/data:/var/lib/manticore/ -p 127.0.0.1:9306:9306 -p 127.0.0.1:9308:9308 -d manticoresearch/manticore

Make sure to remove 127.0.0.1: if you want the ports to be available for external hosts.

Manticore Columnar Library

The docker image doesn't include Manticore Columnar Library which has to be used if you need:

  • columnar storage
  • secondary indexes

but you can easily enable it in runtime by using environment variable MCL=1, i.e. docker run -e MCL=1 ... manticoresearch/manticore. It will then download and install the library and put it to the data dir (which is normally mapped as a volume in production). Next time you run the container the library will be already there, hence it won't be downloaded again unless you change the Manticore Search version.

Docker-compose

In many cases you might want to use Manticore together with other images specified in a docker-compose YAML file. Here is the minimal recommended specification for Manticore Search in docker-compose.yml:

version: '2.2'

services:
  manticore:
    container_name: manticore
    image: manticoresearch/manticore
    restart: always
    ports:
      - 127.0.0.1:9306:9306
      - 127.0.0.1:9308:9308
    ulimits:
      nproc: 65535
      nofile:
         soft: 65535
         hard: 65535
      memlock:
        soft: -1
        hard: -1
    environment:
      - MCL=1
    volumes:
      - ./data:/var/lib/manticore
#      - ./manticore.conf:/etc/manticoresearch/manticore.conf # uncommment if you use a custom config

Besides using the exposed ports 9306 and 9308 you can log into the instance by running docker-compose exec manticore mysql.

HTTP protocol

Manticore is accessible via HTTP on ports 9308 and 9312. You can map either of them locally and connect with curl:

docker run --name manticore -p 9308:9308 -d manticoresearch/manticore

Create a table:

curl -X POST 'http://127.0.0.1:9308/sql' -d 'mode=raw&query=CREATE TABLE testrt ( title text, content text, gid integer)'

Insert a document:

curl -X POST 'http://127.0.0.1:9308/json/insert' -d'{"index":"testrt","id":1,"doc":{"title":"Hello","content":"world","gid":1}}'

Perform a simple search:

curl -X POST 'http://127.0.0.1:9308/json/search' -d '{"index":"testrt","query":{"match":{"*":"hello world"}}}'

Logging

By default, Manticore logs to /dev/stdout, so you can watch the log on the host with:

docker logs manticore

If you want to get log of your queries the same way you can do it by passing environment variable QUERY_LOG_TO_STDOUT=true.

Multi-node cluster with replication

Here is a simple docker-compose.yml for defining a two node cluster:

version: '2.2'

services:

  manticore-1:
    image: manticoresearch/manticore
    restart: always
    ulimits:
      nproc: 65535
      nofile:
         soft: 65535
         hard: 65535
      memlock:
        soft: -1
        hard: -1
    environment:
      - MCL=1
    networks:
      - manticore
  manticore-2:
    image: manticoresearch/manticore
    restart: always
    ulimits:
      nproc: 65535
      nofile:
        soft: 65535
        hard: 65535
      memlock:
        soft: -1
        hard: -1
    environment:
      - MCL=1
    networks:
      - manticore
networks:
  manticore:
    driver: bridge
  • Start it: docker-compose up

  • Create a cluster with a table:

    $ docker-compose exec manticore-1 mysql
    
    mysql> CREATE TABLE testrt ( title text, content text, gid integer);
    
    mysql> CREATE CLUSTER posts;
    Query OK, 0 rows affected (0.24 sec)
    
    mysql> ALTER CLUSTER posts ADD testrt;
    Query OK, 0 rows affected (0.07 sec)
    
    MySQL [(none)]> exit
    Bye
  • Join to the the cluster on the 2nd instance and insert smth to the table:

    $ docker-compose exec manticore-2 mysql
    
    mysql> JOIN CLUSTER posts AT 'manticore-1:9312';
    mysql> INSERT INTO posts:testrt(title,content,gid)  VALUES('hello','world',1);
    Query OK, 1 row affected (0.00 sec)
    
    MySQL [(none)]> exit
    Bye
  • If you now go back to the first instance you'll see the new record:

    $ docker-compose exec manticore-1 mysql
    
    MySQL [(none)]> select * from testrt;
    +---------------------+------+-------+---------+
    | id                  | gid  | title | content |
    +---------------------+------+-------+---------+
    | 3891565839006040065 |    1 | hello | world   |
    +---------------------+------+-------+---------+
    1 row in set (0.00 sec)
    
    MySQL [(none)]> exit
    Bye

Memory locking and limits

It's recommended to overwrite the default ulimits of docker for the Manticore instance:

 --ulimit nofile=65536:65536

For the best performance, Manticore tables' components can be locked into memory. When Manticore is run under Docker, the instance requires additional privileges to allow memory locking. The following options must be added when running the instance:

  --cap-add=IPC_LOCK --ulimit memlock=-1:-1

Configuring Manticore Search with Docker

If you want to run Manticore with your custom config containing indexes definition you will need to mount the configuration to the instance:

docker run --name manticore -v $(pwd)/manticore.conf:/etc/manticoresearch/manticore.conf -v $(pwd)/data/:/var/lib/manticore -p 127.0.0.1:9306:9306 -d manticoresearch/manticore

Take into account that Manticore search inside the container is run under user manticore. Performing operations with tables (like creating or rotating plain indexes) should be also done under manticore. Otherwise the files will be created under root and the search daemon won't have rights to open them. For example here is how you can rotate all plain indexes:

docker exec -it manticore gosu manticore indexer --all --rotate

You can also set individual searchd and common configuration settings using Docker environment variables.

The settings must be prefixed with their section name, for example to change value of setting mysql_version_string in section searchd the variable must be named searchd_mysql_version_string:

docker run --name manticore  -p 127.0.0.1:9306:9306  -e searchd_mysql_version_string='5.5.0' -d manticoresearch/manticore

In case of listen directive, you can pass using Docker variable searchd_listen new listening interfaces in addition to the default ones. Multiple interfaces can be declared separated by semi-colon ("|"). For listening only on network address, the $ip (retrieved internally from hostname -i) can be used as address alias.

For example -e searchd_listen='9316:http|9307:mysql|$ip:5443:mysql_vip' will add an additional SQL interface on port 9307, a SQL VIP on 5443 running only on the instance IP and HTTP on port 9316, beside the defaults on 9306 and 9308, respectively.

$ docker run --rm -p 1188:9307  -e searchd_mysql_version_string='5.5.0' -e searchd_listen='9316:http|9307:mysql|$ip:5443:mysql_vip'  manticore
[Mon Aug 17 07:31:58.719 2020] [1] using config file '/etc/manticoresearch/manticore.conf' (9130 chars)...
listening on all interfaces for http, port=9316
listening on all interfaces for mysql, port=9307
listening on 172.17.0.17:5443 for VIP mysql
listening on all interfaces for mysql, port=9306
listening on UNIX socket /var/run/mysqld/mysqld.sock
listening on 172.17.0.17:9312 for sphinx
listening on all interfaces for http, port=9308
prereading 0 indexes
prereaded 0 indexes in 0.000 sec
accepting connections

Issues

For reporting issues, please use the issue tracker.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].