elasticsearch-analysis-vietnamese icon indicating copy to clipboard operation
elasticsearch-analysis-vietnamese copied to clipboard

Hướng dẫn đầy đủ cài đặt đây !

Open thusinh1969 opened this issue 3 years ago • 8 comments

*** Môi trường Ubuntu 18.04 (or whatever), phải install Java JDK chứ không phải JRE vì cần javac cho cái C++ Tokenizer. Các file .yml tự làm cho chuẩn theo hường dẫn của các gits. Docker hay VM cũng vậy, đơn giản thế này.

sudo su apt-get update -y apt-get upgrade -y apt-get install build-essential cmake unzip pkg-config gcc-7 g++-7 -y apt-get install wget curl nano git default-jdk maven -y

cd /

*** Tải ElasticSearch 7.12.1 wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.12.1-linux-x86_64.tar.gz tar -xzf elasticsearch-7.12.1-linux-x86_64.tar.gz mv elasticsearch-7.12.1-linux-x86_64 /es

** Tải ES Analysis Vietnam git clone https://github.com/duydo/elasticsearch-analysis-vietnamese.git cd elasticsearch-analysis-vietnamese mvn package

** Tải C++ Tokenizer git clone https://github.com/coccoc/coccoc-tokenizer.git cd coccoc-tokenizer mkdir build cd build cmake -DBUILD_JAVA=1 .. make install

** Cài plugin: cd /es echo "Y" | ./bin/elasticsearch-plugin install file:///elasticsearch-analysis-vietnamese/target/releases/elasticsearch-analysis-vietnamese-7.12.1.zip

*** Chuẩn bị groupadd -g 999 nqrt && useradd -r -u 999 -g nqrt nqrt usermod -aG sudo nqrt chown nqrt:nqrt /es -R sysctl -w vm.max_map_count=262144

su nqrt

** Run export ES_JAVA_OPTS="-Xms2048m -Xmx2048m -Djava.library.path=/usr/local/lib" cd /es ./bin/elasticsearch

thusinh1969 avatar Sep 27 '21 05:09 thusinh1969

Lưu ý: nên dùng ES 7.3.1, các version cũ crash loạn xạ với Java core dump !

sudo su apt-get update -y apt-get upgrade -y apt-get install build-essential cmake unzip pkg-config gcc-7 g++-7 -y apt-get install wget curl nano git -y

cd /

*** Tải ElasticSearch 7.3.1 wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.3.1-linux-x86_64.tar.gz tar -xzf elasticsearch-7.3.1-linux-x86_64.tar.gz mv elasticsearch-7.3.1-linux-x86_64 /es

export PATH=$PATH:/es/jdk/bin export JAVA_HOME=/es/jdk export ES_JAVA_HOME=/es/jdk

** Tải ES Analysis Vietnam wget https://github.com/duydo/elasticsearch-analysis-vietnamese/releases/download/v7.3.1/elasticsearch-analysis-vietnamese-7.3.1.zip mv elasticsearch-analysis-vietnamese-7.3.1.zip /tmp

** Tải C++ Tokenizer git clone https://github.com/coccoc/coccoc-tokenizer.git cd coccoc-tokenizer mkdir build cd build cmake -DBUILD_JAVA=1 .. make install

** Cài plugin: cd /es echo "Y" | ./bin/elasticsearch-plugin install file:///tmp/elasticsearch-analysis-vietnamese-7.3.1.zip

*** Chuẩn bị groupadd -g 999 nqrt && useradd -r -u 999 -g nqrt nqrt usermod -aG sudo nqrt chown nqrt:nqrt /es -R sysctl -w vm.max_map_count=262144

su nqrt

** Run export ES_JAVA_OPTS="-Xms2048m -Xmx2048m -Djava.library.path=/usr/local/lib" cd /es ./bin/elasticsearch

Steve

thusinh1969 avatar Sep 27 '21 07:09 thusinh1969

Lưu ý: nên dùng ES 7.3.1, các version cũ crash loạn xạ với Java core dump !

v7.3.1 xài tokenizer cũ của anh Phương chứ không xài coccoc-tokenizer nha, trong README có nói rõ

Cám ơn bác đã bỏ thời gian ra viết hướng dẫn cài đặt chi tiết cho mọi người.

duydo avatar Sep 28 '21 06:09 duydo

Dành cho bạn nào cần sử dụng docker https://github.com/viiiprock/es-vietnamese-docker

viiiprock avatar Nov 16 '21 04:11 viiiprock

Mình có viết Dockerfile/Docker-Compose Elasticsearch 7.12.1 với coccoc-tokenizer và elasticsearch-analysis-vietnamese cho ae nào cần https://github.com/cpfriend1721994/docker-es-cococ-tokenizer

cpfriend1721994 avatar Nov 17 '21 09:11 cpfriend1721994

@cpfriend1721994 Lúc mình chạy từ Dockerfile thì gặp lỗi này: ERROR: [1] bootstrap checks failed. You must address the points described in the following [1] lines before starting Elasticsearch. bootstrap check failure [1] of [1]: the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must be configured ERROR: Elasticsearch did not exit normally - check the logs at /usr/share/elasticsearch/logs/docker-cluster.log {"type": "server", "timestamp": "2022-01-14T06:17:11,550Z", "level": "INFO", "component": "o.e.n.Node", "cluster.name": "docker-cluster", "node.name": "localhost", "message": "stopping ..." } {"type": "server", "timestamp": "2022-01-14T06:17:11,555Z", "level": "INFO", "component": "o.e.n.Node", "cluster.name": "docker-cluster", "node.name": "localhost", "message": "stopped" } {"type": "server", "timestamp": "2022-01-14T06:17:11,555Z", "level": "INFO", "component": "o.e.n.Node", "cluster.name": "docker-cluster", "node.name": "localhost", "message": "closing ..." } {"type": "server", "timestamp": "2022-01-14T06:17:11,560Z", "level": "INFO", "component": "o.e.n.Node", "cluster.name": "docker-cluster", "node.name": "localhost", "message": "closed" } {"type": "server", "timestamp": "2022-01-14T06:17:11,562Z", "level": "INFO", "component": "o.e.x.m.p.NativeController", "cluster.name": "docker-cluster", "node.name": "localhost", "message": "Native controller process has stopped - no new native processes can be started" }

Xin giúp đỡ!

hoptrangetcare avatar Jan 14 '22 06:01 hoptrangetcare

Nếu dùng elasticsearch 8.1.3 , thì các bạn có thể dùng :

  1. https://github.com/miczone/coccoc-tokenizer.git
  2. https://github.com/miczone/elasticsearch-analysis-vietnamese

linuxpham avatar May 02 '22 14:05 linuxpham

@cpfriend1721994 Lúc mình chạy từ Dockerfile thì gặp lỗi này: ERROR: [1] bootstrap checks failed. You must address the points described in the following [1] lines before starting Elasticsearch. bootstrap check failure [1] of [1]: the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must be configured ERROR: Elasticsearch did not exit normally - check the logs at /usr/share/elasticsearch/logs/docker-cluster.log {"type": "server", "timestamp": "2022-01-14T06:17:11,550Z", "level": "INFO", "component": "o.e.n.Node", "cluster.name": "docker-cluster", "node.name": "localhost", "message": "stopping ..." } {"type": "server", "timestamp": "2022-01-14T06:17:11,555Z", "level": "INFO", "component": "o.e.n.Node", "cluster.name": "docker-cluster", "node.name": "localhost", "message": "stopped" } {"type": "server", "timestamp": "2022-01-14T06:17:11,555Z", "level": "INFO", "component": "o.e.n.Node", "cluster.name": "docker-cluster", "node.name": "localhost", "message": "closing ..." } {"type": "server", "timestamp": "2022-01-14T06:17:11,560Z", "level": "INFO", "component": "o.e.n.Node", "cluster.name": "docker-cluster", "node.name": "localhost", "message": "closed" } {"type": "server", "timestamp": "2022-01-14T06:17:11,562Z", "level": "INFO", "component": "o.e.x.m.p.NativeController", "cluster.name": "docker-cluster", "node.name": "localhost", "message": "Native controller process has stopped - no new native processes can be started" }

Xin giúp đỡ!

chua install cococ tokenizer cpp nha ban => https://github.com/miczone/coccoc-tokenizer.git

linuxpham avatar May 02 '22 14:05 linuxpham

@hoptrangetcare bạn tạo issues trên repo chính giúp mình nhé, bạn chạy từ docker-compose thì bị lỗi không

cpfriend1721994 avatar May 08 '22 22:05 cpfriend1721994

image

Mình chạy mvn package thì bắn ra log này , mn có ai bị lỗi này chưa nhỉ ? version mình dùng là 7.14.2

hoangphuong-dev avatar Oct 21 '22 08:10 hoangphuong-dev

2023-02-22_15-11-43

mình install tokenizer của coccoc thì gặp lỗi này, có ai biết cách fix không ạ

thonguyennn avatar Feb 22 '23 08:02 thonguyennn

Em đang thử trên elastic phiên bản 8.7 nhưng chưa build được file .zip để thêm vào, toàn báo lỗi, không biết đã ai làm chưa Screenshot from 2023-04-17 16-45-28 Screenshot from 2023-04-18 08-21-19 Screenshot from 2023-04-18 08-43-53

lephuhung avatar Apr 18 '23 14:04 lephuhung

Mình mới update plugin cho v8.7.0, có hỗ trợ build Docker image rồi nhé.

duydo avatar May 08 '23 07:05 duydo