GithubHelp home page GithubHelp logo

manticoresoftware / docker Goto Github PK

View Code? Open in Web Editor NEW
61.0 14.0 20.0 35.57 MB

Official docker for Manticore Search

Dockerfile 44.73% Shell 55.27%
docker-image manticore-search sphinxsearch manticoresearch search-engine

docker's Introduction

Manticore Search Docker image

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

❗ Please note: This is a development version repo. For the latest release's information, refer to the readme at https://github.com/manticoresoftware/docker/tree/docker-6.3.0

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 the mysql client:

docker run -e EXTRA=1 --name manticore --rm -d manticoresearch/manticore && echo "Waiting for Manticore docker to start. Consider mapping the data_dir to make it start faster next time" && until docker logs manticore 2>&1 | grep -q "accepting connections"; do sleep 1; echo -n .; done && echo && docker exec -it manticore mysql && docker stop manticore

Note that upon exiting the MySQL client, the Manticore container will be stopped and removed, resulting in no saved data. For information on using Manticore in a production environment, please see below.

The image comes with a sample table that can be loaded like this:

mysql> source /sandbox.sql

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

Production use

Ports and mounting points

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

The configuration file within the instance can be found at /etc/manticoresearch/manticore.conf. To apply custom settings, ensure that this file is mounted to your own configuration file. Additionally, configuration parameters can be set through environment variables.

It is important to note that configuring certain parameters through environment variables takes precedence. For example, if you set -e searchd_listen='19306:mysql' via environments and concurrently include listen = 9306:mysql in the configuration, the search functionality will ultimately listen on port 19306 for SQL connections.

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 -e EXTRA=1 --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

or

docker run -e EXTRA=1 --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 and Manticore Buddy

The Manticore Search Docker image doesn't come with the Manticore Columnar Library pre-installed, which is necessary if you require columnar storage and secondary indexes. However, it can easily be enabled during runtime by setting the environment variable EXTRA=1. For example, docker run -e EXTRA=1 ... manticoresearch/manticore. This will download and install the library in the data directory (which is typically mapped as a volume in production environments) and it won't be re-downloaded unless the Manticore Search version is changed.

Using EXTRA=1 also activates Manticore Buddy, which is used for processing certain commands. For more information, refer to the changelog.

If you only need the MCL, you can use the environment variable MCL=1.

Docker-compose

In many cases, you may want to use Manticore in conjunction with other images specified in a Docker Compose YAML file. Below is the minimal recommended configuration for Manticore Search in a docker-compose.yml file:

version: '2.2'

services:
  manticore:
    container_name: manticore
    image: manticoresearch/manticore
    environment:
      - EXTRA=1
    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
    volumes:
      - ./data:/var/lib/manticore
#      - ./manticore.conf:/etc/manticoresearch/manticore.conf # uncomment 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

HTTP protocol is exposed on port 9308. You can map the port locally and connect using curl.:

docker run -e EXTRA=1 --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, the server is set to send its logging to /dev/stdout, which can be viewed from the host with:

docker logs manticore

The query log can be diverted to Docker log by passing the 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
    environment:
      - EXTRA=1
    restart: always
    ulimits:
      nproc: 65535
      nofile:
         soft: 65535
         hard: 65535
      memlock:
        soft: -1
        hard: -1
    networks:
      - manticore
  manticore-2:
    image: manticoresearch/manticore
    environment:
      - EXTRA=1
    restart: always
    ulimits:
      nproc: 65535
      nofile:
        soft: 65535
        hard: 65535
      memlock:
        soft: -1
        hard: -1
    networks:
      - manticore
networks:
  manticore:
    driver: bridge
  • Start it: docker-compose up
  • Create a cluster:
    $ 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
    $ 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 best performance, table components can be "mlocked" 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 a custom configuration that includes table definitions, you will need to mount the configuration to the instance:

docker run -e EXTRA=1 --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 table files (like creating or rotating plain tables) 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 tables:

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, example for in case of mysql_version_string the variable must be named searchd_mysql_version_string:

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

If you intend to enable the own listen directive, utilize the searchd_listen environment variable.

You can specify multiple interfaces separated by a semicolon (|). To exclusively listen on a network address, employ the $ip variable (internally retrieved from hostname -i) as an address alias.

For instance, using -e searchd_listen='9316:http|9307:mysql|$ip:5443:mysql_vip' will incorporate an additional SQL interface on port 9307, an SQL VIP listener on port 5443 operating solely on the instance's IP (such as 172.17.0.2), and an HTTP listener on port 9316.

Attention: Setting this variable overrides default listeners!

$ docker run -e EXTRA=1 --rm -p 1188:9307  -e searchd_mysql_version_string='5.5.0' -e searchd_listen='9316:http|9307:mysql|$ip:5443:mysql_vip' manticoresearch/manticore
[Mon Feb 19 10:12:20.501 2024] [1] using config file '/etc/manticoresearch/manticore.conf.sh' (297 chars)...
starting daemon version '6.2.13 56aaf1f55@24021713 dev (columnar 2.2.5 8c90c1f@240217) (secondary 2.2.5 8c90c1f@240217) (knn 2.2.5 8c90c1f@240217)' ...
listening on all interfaces for sphinx and http(s), port=9316
listening on all interfaces for mysql, port=9307
listening on 172.17.0.2:5443 for VIP mysql
prereading 0 tables
preread 0 tables in 0.000 sec
accepting connections

Startup flags

To start Manticore with custom startup flags, specify them as arguments when using docker run. Ensure you do not include the searchd command and include the --nodetach flag. Here's an example:

docker run -e EXTRA=1 --name manticore --rm manticoresearch/manticore:latest --replay-flags=ignore-trx-errors --nodetach

Running under non-root

By default, the main Manticore process searchd is running under user manticore inside the container, but the script which runs on starting the container is run under your default docker user which in most cases is root. If that's not what you want you can use docker ... --user manticore or user: manticore in docker compose yaml to make everything run under manticore. Read below about possible volume permissions issue you can get and how to solve it.

Building plain tables

There are several methods to build plain tables from your custom configuration file. There's the CREATE_PLAIN_TABLES (docker run -e CREATE_PLAIN_TABLES=...) evironment variable for that.

  1. Build all plain tables on startup:
    Simply set the environment variable to CREATE_PLAIN_TABLES=1.

  2. Build specific tables on startup:
    To initiate indexing for specific tables, use the following syntax: CREATE_PLAIN_TABLES=tbl1;tbl2.

  3. Scheduled building of specific tables:
    Schedule indexing tasks for specific tables using the format CREATE_PLAIN_TABLES={table name}:{schedule in cron format}.

    • For a single table, use: CREATE_PLAIN_TABLES=tbl:* * * * *.
    • To index multiple tables, format it like this: CREATE_PLAIN_TABLES=tbl:* * * * *;tbl2:*/5 2 * * *.
  4. Combining scheduled and startup table rebuilding:
    To combine scheduled building with the indexing of desired tables on startup, use this format: CREATE_PLAIN_TABLES=tbl:* * * * *;tbl2:*/5 2 * * *;deltaTable;tbl3.

Backup and restore

Full backup

To create a full backup, you need to include the -e EXTRA=1 flag. The manticore-backup package utilizes the manticore-executor, which is installed with the EXTRA packages.

Creating a full backup is a straightforward process. Simply run the following command:

docker exec -it CONTAINER-ID manticore-backup --backup-dir=/tmp

This command will generate a backup in your /tmp/ directory.

$ ls /tmp/ | grep backup-*
backup-20230509133521

Inside this folder, you will find your backup.

Restore full dump

To restore your full backup on startup, you need to mount your backup to the /docker-entrypoint-initdb.d folder.

Please note that you should mount the content of your backup, not the backup folder itself (e.g., backup-202307..).

The backup will be restored if the data directory is empty. Otherwise, it will be skipped, even if it's mounted on the second launch or any other time. Once the backup is restored, the daemon will start.

Creating SQL dumps

manticore-backup creates a physical backup. If you prefer a logical backup, you can use mysqldump in the container. For that use docker exec to log in to the container and run the tool. Here's an example:

docker exec some-mysql sh -c 'exec mysqldump' > /some/path/on/your/host/dump.sql

Restore SQL dumps

For restoring data from an sql file created by mysqldump, you can use the docker exec command with the -i flag like this:

docker exec -i MANTICORE_CONTAINER sh -c 'exec mysql' < /some/path/on/your/host/dump.sql

Building docker image with buildx

To build multi-arch images, we use the buildx docker plugin. Before building, follow these steps:

docker buildx create  --name manticore_build --platform linux/amd64,linux/arm64
docker buildx use manticore_build
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes

Once the above steps are completed, run the following build and push commands:

docker buildx build --push --build-arg DEV=1 --platform linux/arm64,linux/amd64 --tag  manticoresearch/manticore:$BUILD_TAG .

Troubleshooting

Permissions issue with a mounted volume

In case you are running Manticore Search docker under non-root (using docker ... --user manticore or user: manticore in docker compose yaml), you can face a permissions issue, for example:

FATAL: directory /var/lib/manticore write error: failed to open /var/lib/manticore/tmp: Permission denied

or in case you are using -e EXTRA=1:

mkdir: cannot create directory ‘/var/lib/manticore/.mcl/’: Permission denied

This can happen because the user which is used to run processes inside the container may have no permissions to modify the directory you have mounted to the container. To fix it you can chown or chmod the mounted directory. If you run the container under user manticore you need to do:

chown -R 999:999 data

since user manticore has ID 999 inside the container.

Issues

For reporting issues, please use the issue tracker.

docker's People

Contributors

adriannuta avatar djklim87 avatar donhardman avatar klirichek avatar manticoresearch avatar pavelshilin89 avatar pwoszczyk avatar sanikolaev avatar tbk avatar tomatolog avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docker's Issues

Ideas for more tests

The task is to prepare ideas for more tests. I'll start:

Once we are done with the ideas let's create another task to implement them, perhaps they should be grouped into a few issues.

Store Index Data in Container not Volume

Hi,

We are looking at using manticore for its PQ featureset. For our usecase we would want to be able to setup an image that has a number of PQ queries already inserted into it, and version this image so it can be portable. Currently the use of volumes (while it makes sense for traditional search) to store data prevent the containers from being fully portable in a container engine like Nomad or K8s. Because the total number of pq queries is much less total storage the traditional indexing we would like to save them with the containers. Then should we require horizontal scaling of the manticore we can simply spawn more containers anywhere without worrying if the volumes need to be replicated to the target host as well.

Is there a recommend way to modify the Dockerfile to support this? I already have found that if I rebuild the image with a custom sphinx.conf I am able to keep my pq index created, but for some reason it never keeps the queries even after a docker commit.

Running with --network=host produces FATAL

[box@github ~]$ docker run --rm --network host manticoresearch/manticore:dev-6.2.13-69cd5a6
hostname: Name or service not known
[Thu Dec  7 07:19:35.174 2023] [1] using config file '/etc/manticoresearch/manticore.conf.sh' (375 chars)...
starting daemon version '6.2.13 69cd5a61f@231207 dev' ...
listening on all interfaces for mysql, port=9306
listening on UNIX socket /var/run/mysqld/mysqld.sock
listening on all interfaces for sphinx and http(s), port=9308
FATAL: port 0 is out of range
shutdown daemon version '6.2.13 69cd5a61f@231207 dev' ...
shutdown complete
Manticore 6.2.13 69cd5a61f@231207 dev
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)

too many ports EXPOSEd in Dockerfile - incompatibility with GitLab CI

I try to use this image as a service in GitLab CI.
The behaviour of Gitlab CI is such that it looks up the ports EXPOSEd and checks if they are available. Unfortunately, this image's Dockerfile tells that it EXPOSEs ports 9306, 9308, 9312, and, for some reason, 9315-9325. Of course it doesn't actually listen on those 9315-9325 ports, therefore fails the GitLab's check.

Unfortunately it is not possible to "unexpose" ports using a child image (FROM manticoresearch/manticore in Dockerfile), the only option I am left with is completely forking the project, which i would like to avoid.

Is it really necessary to keep this EXPOSE 9315-9325 statement in the Dockerfile? The image users can always bind any port using docker run -p ... option.

Fix entrypoint for backup restore

We should follow the common logic used in most popular repositories for restoring data. Let's adapt it to only restore on the first initialization and display a warning if we have a backup but it's already initialized.

Permission denied

cmd: docker run -e EXTRA=1 --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

2023-11-05 12:01:15 (1.08 MB/s) - ‘/tmp/manticore-columnar-lib_2.2.4-230822-5aec342_amd64.deb.1’ saved [1641468/1641468]

debian-binary: Permission denied

Source password via variable

How hide password from manticore.conf? Can I use a variable?

docker-compose.yml:

version: "3.7"

networks:
    backend:
        driver: bridge

services:`
    manticore:
        image: manticoresearch/manticore
        restart: unless-stopped
        environment:
            - variable_sql_pass=${DB_ROOT_PASSWORD} <--- password from secret .env
        ports:
            - 127.0.0.1:9306:9306
        ulimits:
            ...
        depends_on:
            - db
        volumes:
            - ./docker/manticore:/etc/manticoresearch
        networks:
            - backend

./docker/manticore/manticore.conf:

source mysource
{
	type       = mysql
	sql_host   = db
	sql_user   = root
	sql_pass   = <---- password via variable possible?
	sql_db     = mydb
	sql_port   = 3306
}
...

Incorrect UTF-8 character display in stdout logs

Russian search results are correct.
When logging to a file, the display of Russian letters is also correct.
But when redirecting query.log to /dev/stdout characters looks like on image:
image

English letters displayed also correctly.

Having troubles with docker run using my custom sphinx.conf file

In a local project, using Windows 10 Home which only supports Docker Toolbox (uses VirtualBox) using version 18.09.3, i tried the command

docker run --name manticore -v ~/repositories/sphinxql/__tests__/:/etc/sphinxsearch/ -v ~/repositories/sphinxql/__tests__/data/:/var/lib/manticore/data -v ~/repositories/sphinxql/__tests__/:/var/log/manticore -p 9306:9307 manticoresearch/manticore

In ~/repositories/sphinxql/__tests__/ there is a sphinx.conf file and i get the following error

[Sun Oct 27 16:14:59.688 2019] [1] using config file '/etc/sphinxsearch/sphinx.conf' (7930 chars)...
[Sun Oct 27 16:14:59.692 2019] [1] WARNING: TCP fast open unavailable (can't read /proc/sys/net/ipv4/tcp_fastopen, unsupported kernel?)
[Sun Oct 27 16:14:59.694 2019] [1] WARNING: ICU: failed to load icu library (tried libicuuc.so.57)
[Sun Oct 27 16:14:59.694 2019] [1] FATAL: failed to create pid file 'searchd.pid': Permission denied
[Sun Oct 27 16:15:02.695 2019] [1] shutdown complete
Manticore 3.2.0 e526a014@191017 release
Copyright (c) 2001-2016, Andrew Aksyonoff
Copyright (c) 2008-2016, Sphinx Technologies Inc (http://sphinxsearch.com)
Copyright (c) 2017-2019, Manticore Software LTD (http://manticoresearch.com)

Manticore doesn't work

Dear friends,

I set it up via docker-compose, followed by docs: https://github.com/manticoresoftware/docker
But manticore does not run properly.

My docker-compose.yaml

version: '2.2'

services:
  manticore:
    container_name: manticore
    #image: manticoresearch/manticore
    image: manticoresearch/manticore:6.2.0
    environment:
      - EXTRA=1
    restart: always
    ports:
      #- 127.0.0.1:9306:9306
      #- 127.0.0.1:9308:9308
      - 192.168.20.3:9306:9306
      - 192.168.20.3:9308:9308
      #- 9306:9306
      #- 9308:9308
    ulimits:
      nproc: 65535
      nofile:
         soft: 65535
         hard: 65535
      memlock:
        soft: -1
        hard: -1
    volumes:
      - /cache1/manticoresearch:/var/lib/manticore

Run and show logs: docker-compose up -d; docker-compose logs -f

manticore    | Resolving repo.manticoresearch.com (repo.manticoresearch.com)... 49.12.119.254
manticore    | Connecting to repo.manticoresearch.com (repo.manticoresearch.com)|49.12.119.254|:443... connected.
manticore    | HTTP request sent, awaiting response... 200 OK
manticore    | Length: 1661462 (1.6M) [application/octet-stream]
manticore    | Saving to: ‘/tmp/manticore-columnar-lib_2.2.0-230804-dc33868_amd64.deb’
manticore    |
manticore    |      0K .......... .......... .......... .......... ..........  3%  248K 6s
manticore    |     50K .......... .......... .......... .......... ..........  6%  247K 6s
manticore    |    100K .......... .......... .......... .......... ..........  9%  104M 4s
manticore    |    150K .......... .......... .......... .......... .......... 12%  247K 4s
manticore    |    200K .......... .......... .......... .......... .......... 15%  101M 3s
manticore    |    250K .......... .......... .......... .......... .......... 18% 88.5M 3s
manticore    |    300K .......... .......... .......... .......... .......... 21% 70.2M 2s
manticore    |    350K .......... .......... .......... .......... .......... 24%  248K 2s
manticore    |    400K .......... .......... .......... .......... .......... 27% 47.8M 2s
manticore    |    450K .......... .......... .......... .......... .......... 30%  109M 2s
manticore    |    500K .......... .......... .......... .......... .......... 33%  115M 2s
manticore    |    550K .......... .......... .......... .......... .......... 36%  101M 1s
manticore    |    600K .......... .......... .......... .......... .......... 40%  112M 1s
manticore    |    650K .......... .......... .......... .......... .......... 43%  112M 1s
manticore    |    700K .......... .......... .......... .......... .......... 46%  253K 1s
manticore    |    750K .......... .......... .......... .......... .......... 49% 26.0M 1s
manticore    |    800K .......... .......... .......... .......... .......... 52% 58.4M 1s
manticore    |    850K .......... .......... .......... .......... .......... 55% 52.6M 1s
manticore    |    900K .......... .......... .......... .......... .......... 58% 44.7M 1s
manticore    |    950K .......... .......... .......... .......... .......... 61% 80.0M 1s
manticore    |   1000K .......... .......... .......... .......... .......... 64%  104M 1s
manticore    |   1050K .......... .......... .......... .......... .......... 67% 97.5M 0s
manticore    |   1100K .......... .......... .......... .......... .......... 70%  100M 0s
manticore    |   1150K .......... .......... .......... .......... .......... 73% 81.6M 0s
manticore    |   1200K .......... .......... .......... .......... .......... 77%  102M 0s
manticore    |   1250K .......... .......... .......... .......... .......... 80% 93.5M 0s
manticore    |   1300K .......... .......... .......... .......... .......... 83% 85.3M 0s
manticore    |   1350K .......... .......... .......... .......... .......... 86% 83.4M 0s
manticore    |   1400K .......... .......... .......... .......... .......... 89%  261K 0s
manticore    |   1450K .......... .......... .......... .......... .......... 92% 44.9M 0s
manticore    |   1500K .......... .......... .......... .......... .......... 95% 88.9M 0s
manticore    |   1550K .......... .......... .......... .......... .......... 98% 67.4M 0s
manticore    |   1600K .......... .......... ..                              100%  144M=1.2s
manticore    |
manticore    | 2023-08-15 09:33:13 (1.30 MB/s) - ‘/tmp/manticore-columnar-lib_2.2.0-230804-dc33868_amd64.deb’ saved [1661462/1661462]
manticore    |
manticore    | Manticore 6.2.0 45680f95d@230804 (columnar 2.2.0 dc33868@230804) (secondary 2.2.0 dc33868@230804)
manticore    | [Tue Aug 15 09:33:13.714 2023] [1] using config file '/etc/manticoresearch/manticore.conf' (9278 chars)...
manticore    | starting daemon version '6.2.0 45680f95d@230804 (columnar 2.2.0 dc33868@230804) (secondary 2.2.0 dc33868@230804)' ...
manticore    | listening on all interfaces for mysql, port=9306
manticore    | listening on UNIX socket /var/run/mysqld/mysqld.sock
manticore    | listening on 172.22.0.2:9312 for sphinx and http(s)
manticore    | listening on all interfaces for sphinx and http(s), port=9308

Then netstats -natpu|grep LISTEN

tcp        0      0 192.168.20.3:9306       0.0.0.0:*               LISTEN      9727/docker-proxy
tcp        0      0 192.168.20.3:9308       0.0.0.0:*               LISTEN      9713/docker-proxy

But I can not telnet, also access via http from outsite.

So, then I exec into the container and run: docker exec -it manticore /bin/sh

# wget http://localhost:9308
--2023-08-15 09:38:47--  http://localhost:9308/
Resolving localhost (localhost)... 127.0.0.1, ::1
Connecting to localhost (localhost)|127.0.0.1|:9308... failed: Connection refused.
Connecting to localhost (localhost)|::1|:9308... failed: Cannot assign requested address.
Retrying.

# wget http://127.0.0.1:9308
--2023-08-15 09:39:07--  http://127.0.0.1:9308/
Connecting to 127.0.0.1:9308... failed: Connection refused.

Docker version: 19.03.5
Docker-compose version: 1.29.2

Please let me me know what i'm wrong or docs are missing something. Thank so much!

BUDDY warnings if EXTRA is not set

Version affected

6.2.0

Desctiption

If environment variable EXTRA=0 or EXTRA is not set in file docker-compose.yml (thus Manticore Buddy is deactivated) I get an warnings about BUDDY in docker log:

WARNING: [BUDDY] invalid output, should be 'Buddy ver, started address:port', got '/usr/share/manticore/modules/manticore-buddy/bin/manticore-buddy: line 26: /usr/bin/manticore-executor: Success
'
[BUDDY] restarting
WARNING: [BUDDY] invalid output, should be 'Buddy ver, started address:port', got '/usr/share/manticore/modules/manticore-buddy/bin/manticore-buddy: line 26: /usr/bin/manticore-executor: Success
'
[BUDDY] restarting
WARNING: [BUDDY] invalid output, should be 'Buddy ver, started address:port', got '/usr/share/manticore/modules/manticore-buddy/bin/manticore-buddy: line 26: /usr/bin/manticore-executor: Success
'
[BUDDY] restart amount of attempts (3) has been exceeded

Is these warnings are normal?

EXTRA=1 should install manticore-galera

Galera has been separated into a separate package manticore-galera. The dev docker now doesn't have it. The task is to install manticore-galera in case of EXTRA=1.

AF_INET address found for: 172.20.0.3 when running docker compose in windows.

Hi ,

When I run docker-compose up in windows for manticore service. I get below
error FATAL: no AF_INET address found for: 172.20.0.3

Attaching logs:
2023-08-23 15:34:10 Executing: mysql -e 'CREATE CLUSTER DMETRICS_FTS_1' 2023-08-23 15:34:10 [Wed Aug 23 10:04:10.863 2023] [1] using config file '/etc/manticoresearch/manticore.conf' (9427 chars)... 2023-08-23 15:34:10 starting daemon version '6.0.4 1a3a4ea82@230314 (columnar 2.0.4 5a49bd7@230306) (secondary 2.0.4 5a49bd7@230306)' ... 2023-08-23 15:34:10 listening on all interfaces for mysql, port=9306 2023-08-23 15:34:10 listening on UNIX socket /var/run/mysqld/mysqld.sock 2023-08-23 15:34:10 FATAL: no AF_INET address found for: 172.20.0.3 2023-08-23 15:34:13 shutdown daemon version '6.0.4 1a3a4ea82@230314 (columnar 2.0.4 5a49bd7@230306) (secondary 2.0.4 5a49bd7@230306)' ... 2023-08-23 15:34:13 shutdown complete 2023-08-23 15:34:13 Manticore 6.0.4 1a3a4ea82@230314 (columnar 2.0.4 5a49bd7@230306) (secondary 2.0.4 5a49bd7@230306) 2023-08-23 15:34:13 Copyright (c) 2001-2016, Andrew Aksyonoff 2023-08-23 15:34:13 Copyright (c) 2008-2016, Sphinx Technologies Inc (http://sphinxsearch.com) 2023-08-23 15:34:13 Copyright (c) 2017-2023, Manticore Software LTD (https://manticoresearch.com) 2023-08-23 15:34:13 2023-08-23 15:34:14 Executing: mysql -e 'CREATE CLUSTER DMETRICS_FTS_1' 2023-08-23 15:34:14 [Wed Aug 23 10:04:14.977 2023] [1] using config file '/etc/manticoresearch/manticore.conf' (9427 chars)... 2023-08-23 15:34:14 starting daemon version '6.0.4 1a3a4ea82@230314 (columnar 2.0.4 5a49bd7@230306) (secondary 2.0.4 5a49bd7@230306)' ... 2023-08-23 15:34:14 listening on all interfaces for mysql, port=9306 2023-08-23 15:34:14 listening on UNIX socket /var/run/mysqld/mysqld.sock 2023-08-23 15:34:14 FATAL: no AF_INET address found for: 172.20.0.3

I am using manticore.conf defined here https://github.com/manticoresoftware/docker/blob/master/manticore.conf.

I found somehow correct value of ip is not getting assigned here in manticore.conf, it works when I hardcode the ip

  listen = 9306:mysql41
   listen = /var/run/mysqld/mysqld.sock:mysql41
   listen = $ip:9312
   listen = 9308:http
   listen = $ip:9315-9325:replication

Compile warnings are expected?

[ 98%] Building C object src/CMakeFiles/searchd.dir/http/http_parser.c.o
/build/manticore/src/searchd.cpp: In member function 'void SearchRequestBuilder_t::SendQuery(const char*, ISphOutputBuffer&, const CSphQuery&, int) const':
/build/manticore/src/searchd.cpp:3164:10: warning: enumeration value 'SPH_FILTER_EXPRESSION' not handled in switch [-Wswitch]
   switch ( tFilter.m_eType )
          ^
/build/manticore/src/searchd.cpp: In function 'void ConfigureSearchd(const CSphConfig&, bool)':
/build/manticore/src/searchd.cpp:23212:83: warning: format '%lu' expects argument of type 'long unsigned int', but argument 2 has type 'long long unsigned int' [-Wformat=]
    sphWarning ( "max_open_files is %lu, expected positive value; ignored", uLimit );
                                                                                   ^
/build/manticore/src/searchd.cpp:23225:98: warning: format '%lu' expects argument of type 'long unsigned int', but argument 2 has type 'long long unsigned int' [-Wformat=]
      sphWarning ( "Failed to setrlimit on %lu, error %d: %s", uLimit, errno, strerrorm ( errno ) );
                                                                                                  ^
/build/manticore/src/searchd.cpp:23228:44: warning: format '%lu' expects argument of type 'long unsigned int', but argument 2 has type 'long long unsigned int' [-Wformat=]
       uLimit, uPrevLimit, dRlimit.rlim_max );
                                            ^
/build/manticore/src/searchd.cpp:23228:44: warning: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'long long unsigned int' [-Wformat=]
/build/manticore/src/searchd.cpp:23228:44: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'rlim_t {aka long long unsigned int}' [-Wformat=]
[100%] Linking CXX executable searchd

Docker down if QUERY_LOG_TO_STDOUT set

Actual for last dev builds

klim@klim-MS-7A72:/tmp$ docker run -e QUERY_LOG_TO_STDOUT=true -e EXTRA=1 -p 9306:9306 -it --rm manticoresearch/manticore:dev
Unable to find image 'manticoresearch/manticore:dev' locally
dev: Pulling from manticoresearch/manticore
379bae5ee2d6: Pull complete 
4f4fb700ef54: Pull complete 
Digest: sha256:f491d33f47806bfcdc63cdc86b95fe9c03e75c36cde035bee34de7ba7bce9bb5
Status: Downloaded newer image for manticoresearch/manticore:dev
Install extra packages
--2023-10-02 17:40:36--  http://repo.manticoresearch.com/repository/manticoresearch_jammy_dev/dists/jammy/main/binary-amd64/manticore-executor_0.7.7-23081316-7723c87_amd64.deb
Resolving repo.manticoresearch.com (repo.manticoresearch.com)... 49.12.119.254
Connecting to repo.manticoresearch.com (repo.manticoresearch.com)|49.12.119.254|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 8168264 (7.8M) [application/octet-stream]
Saving to: ‘/var/lib/manticore/.extra/manticore-executor_0.7.7-23081316-7723c87_amd64.deb’

manticore-executor_0.7.7-23081316-7723c87_amd6 100%[==================================================================================================>]   7.79M  3.73MB/s    in 2.1s    

2023-10-02 17:40:38 (3.73 MB/s) - ‘/var/lib/manticore/.extra/manticore-executor_0.7.7-23081316-7723c87_amd64.deb’ saved [8168264/8168264]

Columnar version mismatch
Lib columnar not installed
Secondary columnar not installed
--2023-10-02 17:40:39--  http://repo.manticoresearch.com/repository/manticoresearch_jammy_dev/dists/jammy/main/binary-amd64/manticore-columnar-lib_2.2.5-230928-b8be4eb_amd64.deb
Resolving repo.manticoresearch.com (repo.manticoresearch.com)... 49.12.119.254
Connecting to repo.manticoresearch.com (repo.manticoresearch.com)|49.12.119.254|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1767308 (1.7M) [application/octet-stream]
Saving to: ‘/tmp/manticore-columnar-lib_2.2.5-230928-b8be4eb_amd64.deb’

manticore-columnar-lib_2.2.5-230928-b8be4eb_am 100%[==================================================================================================>]   1.68M  3.28MB/s    in 0.5s    

2023-10-02 17:40:39 (3.28 MB/s) - ‘/tmp/manticore-columnar-lib_2.2.5-230928-b8be4eb_amd64.deb’ saved [1767308/1767308]

Manticore 6.2.13 85ffbbbb8@230929 dev (columnar 2.2.5 b8be4eb@230928) (secondary 2.2.5 b8be4eb@230928)
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)

[40:40.046] [1] using config file '/etc/manticoresearch/manticore.conf' (9276 chars)...
FATAL: failed to open query log file '/var/log/manticore/query.log': Permission denied

Test: EXTRA=0/1

Create a test to make sure the EXTRA env. var. works as expected:

  • installs the extra packages and makes them accessible in Manticore when used (searchd -v should be enough)
    • doesn't install them again when the container is started again (as it caches them)
  • does not install them when not used

Improve flexibility of configuration via env. vars

Currently it's possible to configure searchd via env. vars, but it's limited by only those settings that are hardcoded in manticore.conf, so some new and undocumented settings are not working, e.g. -e searchd_query_log_commands=1. The task is to refactor the feature, so it's possible to pass arbitrary settings via env. vars.

Cannot interrupt container while running from command line

Cannot stop it when running with default from command line, only one way – open another terminal and docker rm -f or kill

The terminal hangs forever and looks like signals not going to process while it's running with searchd --nodetach

[box@github ~]$ docker run --rm manticoresearch/manticore:dev-6.2.13-69cd5a6
[Thu Dec  7 07:20:27.666 2023] [1] using config file '/etc/manticoresearch/manticore.conf.sh' (395 chars)...
starting daemon version '6.2.13 69cd5a61f@231207 dev' ...
listening on all interfaces for mysql, port=9306
listening on UNIX socket /var/run/mysqld/mysqld.sock
listening on all interfaces for sphinx and http(s), port=9308
listening on 172.17.0.2:9312 for sphinx and http(s)
prereading 0 tables
preread 0 tables in 0.000 sec
accepting connections
^C^Z




^C           

Expected: it handles CTRL+C and stops

Add support for service cron (feature request)

Feature request

Please add support for service cron in Docker container of Manticore Search.

For today I need to create custom script for ENTRYPOINT to add all services missing in the Docker container (including crond), since internal logic of your script docker-entrypoint.sh is strictly tied to launch searchd or indexer from CMD.

I ask you to refactor docker-entrypoint.sh and add the ability to run my own script incudes all missing commands.

Forum discussion (russian): https://forum.manticoresearch.com/t/crond-docker/1616

Index creation with lemmatize_en doesn't work as expected

Hi

I tried to perform the following command using docker container and got an error:

mysql> CREATE TABLE IF NOT EXISTS lis_prod_test (publish_date timestamp, internal_id text stored, article_body_hash text stored, content text indexed) stopwords = 'en' morphology='lemmatize_en' morpoholgoy='lemmatize_en_all' morpoholgoy='stem_en' morpoholgoy='libstemmer_en'  html_strip = '1' min_prefix_len='3' min_prefix_len = '3' engine='columnar';
ERROR 1064 (42000): error adding index 'lis_prod_test': failed to open /en.pak: No such file or directory

Afteward I tried to place e.pak into /usr/share/manticore and it doesn't work as well:

total 1628
drwxr-xr-x 1 root root    4096 Mar 27 16:31 ./
drwxr-xr-x 1 root root    4096 Mar 27 16:13 ../
-rw-r--r-- 1 root root      36 Dec 23 03:22 INSTALL
drwxr-xr-x 5 root root    4096 Dec 23 05:32 api/
-rw-r--r-- 1 root root 1632084 Mar 27 16:31 en.pak
drwxr-xr-x 2 root root    4096 Dec 23 05:32 icu/
drwxr-xr-x 1 root root    4096 Mar 20 20:50 modules/
drwxr-xr-x 2 root root    4096 Dec 23 05:32 stopwords/

Prepare for building multi-arch docker

The task is:

  1. Read and understand https://www.docker.com/blog/multi-arch-build-and-images-the-simple-way/
  2. Prepare needed changes in https://github.com/manticoresoftware/docker (and perhaps other places too) to:
    • start providing a multi-arch image starting from the next release
    • start providing a multi-arch dev image even before the upcoming release
  3. If needed, document what one needs to do to build and push a new image in https://github.com/manticoresoftware/docker/blob/master/building.md

Plain index creation on docker container startup

Is any way to create and fulfill a plain index on Docker container startup?

I have a limited data set (a few million) that can be loaded in seconds. I don't plan to use volumes.

My config:

source my_database  
{  
    type = mysql  
    sql_host = db  
    sql_user = root  
    sql_pass = pass  
    sql_db = database  
    sql_port = 3306  
  
    sql_query_pre = SET CHARACTER_SET_RESULTS=utf8  
    sql_query_pre = SET NAMES utf8  
    sql_query = SELECT id, text FROM table  
}  
  
index my_index  
{  
    type = plain  
    source = my_database  
    path = /var/lib/manticore/data/my_index  
}  

The container starts with warnings:

[Mon Jul 17 15:27:53.004 2023] [98] WARNING: Unable to load header... Error failed to open /var/lib/manticore/data/my_index.sph: No such file or directory  
[Mon Jul 17 15:27:53.004 2023] [98] WARNING: table 'my_index': prealloc: failed to open /var/lib/manticore/data/my_index.sph: No such file or directory - NOT SERVING  

I can perform indexer RELOAD TABLES after startup but want to avoid it.

I don't want to overwrite ENTRYPOINT because the current implementation support the Manticore Buddy installation. Future support will be hard if I copy & extend the current entrypoint.

Is any way? Did I miss some config witch enables plain index creation after startup?

Indexer runs twice on container start

Version affected

6.2.12

Description

If environment variable CREATE_PLAIN_TABLES=1, then indexer runs twice on container start, because ENTRYPOINT script docker-entrypoint.sh calls itself at line 168:

      exec gosu manticore "$0" "$@"

Please check and fix.

Incorrect docker mount point

In README.md instruction mount point for data is incorrect:
$(pwd)/data:/var/lib/manticore/data/

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

Manticore stores data in /var/lib/manticore/, so documented mountpoint not working.

manticore-backup is not working

The official full backup instruction is not working:

➜  ~ docker pull manticoresearch/manticore:dev
dev: Pulling from manticoresearch/manticore

➜  ~ docker run -e EXTRA=1 --name manticore -v $(pwd)/data:/var/lib/manticore -p 127.0.0.1:9306:9306 -d manticoresearch/manticore:dev

➜  ~ mysql -P9306 -h0 -e "create table t;"

➜  ~ docker exec -it manticore manticore-backup --backup-dir=/tmp
Copyright (c) 2023-2024, Manticore Software LTD (https://manticoresearch.com)

Manticore config file: /etc/manticoresearch/manticore.conf
Tables to backup: all tables
Backup dir: /tmp

Manticore config
  endpoint =  http://127.0.0.1:9312
2024-02-16 11:15:23 [Error] Failed to send query to the Manticore Search daemon. Ensure that it is set up to listen for HTTP or HTTPS connections and has the appropriate certificates in place. Additionally, check the 'max_connections' setting in the configuration file to ensure that it has not been exceeded.

Cannot create directory ‘galera’: File exists

According Telegram issue https://t.me/manticore_chat/7198/10987

mkdir: cannot create directory ‘galera’: File exists
Manticore 6.2.13 4950f3d02@24020213 dev (columnar 2.2.5 214ce90@240115) (secondary 2.2.5 214ce90@240115) (knn 2.2.5 214ce90@240115)
Copyright (c) 2001-2016, Andrew Aksyonoff
Copyright (c) 2008-2016, Sphinx Technologies Inc (http://sphinxsearch.com)
Copyright (c) 2017-2024, Manticore Software LTD (https://manticoresearch.com)

Backups in Docker

Unless if I'm missing something, the current instructions do not indicate how to restore a backup when using Docker. Simply running

docker exec -it CONTAINER-ID /usr/bin/manticore-backup --backup-dir=... --restore=....

does not work, because searchd will then be running within the Dockter container, which is not allowed during restore :-(

Thanks for your help!

QUERY_LOG_TO_STDOUT=true does not work correctly

Version affected

6.2.0

Desctiption

The environment variable QUERY_LOG_TO_STDOUT=true does not work (i.e. log of queries does not redirected to /dev/stdout) if option query_log is absent in section searchd of configuration file manticore.conf.

Please check and fix.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.