磁気検索サイト2020年1月2日更新
https://www.cnblogs.com/cilisousuo/p/12099547.html
1.表示ページ
2.手続きのフレームワーク
名前 | 使用 |
---|---|
サーバ | データ収集の急流 |
ワーカー | ハッシュは、情報を収集します |
ウェブ | データショー |
ツール | ツール |
インストール3.
- 設置環境の前に、あなたは、configure golang環境に必要な 囲碁 のダウンロード
- PythonとMongoDBのをインストールします。
sudo apt install mongodb
sudo apt install python3 python3-pip
pip3 install elastic-doc-manager[elastic5]
- サーバーのインストール
go get github.com/Bmixo/btSearch/server
- インストール作業員
go get github.com/Bmixo/btSearch/worker
- Elasticsearch dockerp設定
docker run --restart=always -p 9200:9200 -p 9300:9300 --name=tmp docker.elastic.co/elasticsearch/elasticsearch:5.6.0
インストールの分析-IKトークナイザ
docker ps
docker exec -it $dockid /bin/bash
./bin/elasticsearch-plugin install https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v5.6.0/elasticsearch-analysis-ik-5.6.0.zip
Elasticsearchコンフィギュレーションデータ格納ディレクトリ
mkdir -p /data/docker
docker cp $dockid:/usr/share/elasticsearch/ /data/docker
chmod 777 -R /data/
ファイル名を指定して実行Elasticsearchドッカサービス
docker run --restart=always -p 9200:9200 -p 9300:9300 --name=es \
-e ES_JAVA_OPTS="-Xms1024m -Xmx1024m" \
-v /data/docker/elasticsearch/data:/usr/share/elasticsearch/data \
-v /data/docker/elasticsearch/logs:/usr/share/elasticsearch/logs \
-v /data/docker/elasticsearch/config:/usr/share/elasticsearch/config \
-v /data/docker/elasticsearch/plugins:/usr/share/elasticsearch/plugins \
-v /etc/localtime:/etc/localtime \
-v /etc/timezone:/etc/timezone \
docker.elastic.co/elasticsearch/elasticsearch:5.6.0
正しく設定Elasticsearchの現在の動作状態を確認するために、次のコマンドを実行
curl --user elastic:changeme -XGET 'http://127.0.0.1:9200/_cat/health'
デフォルトの設定Elasticsearchトークナイザ
curl --user elastic:changeme -XPUT http://localhost:9200/bavbt -H 'Content-Type: application/json'
curl --user elastic:changeme -XPOST 'localhost:9200/bavbt/_close'
curl --user elastic:changeme -XPUT localhost:9200/bavbt/_settings?pretty -d '{
"index":{
"analysis" : {
"analyzer" : {
"default" : {
"type" : "ik_max_word"
}
},
"search_analyzer" : {
"default" : {
"type" : "ik_max_word"
}
}
}
}
}'
curl --user elastic:changeme -XPOST 'localhost:9200/bavbt/_open'
- MongoDBのレプリカセット構成
service mongod stop
vim /etc/mongodb.conf
添加replSet=rs1
service mongod start
()が正しく設定されmongoshelly実行rs.initiateによってレプリカセットを表示するには、することができます
4.ファイル名を指定して実行
まず、あなたのconfファイルを設定する必要があります
[mongodb]
musername=
mpassword=
database=bavbt
collection=torrent
addr=127.0.0.1:27017
[elasticsearch]
url=http://127.0.0.1:9200/bavbt/torrent/
eusername=elastic
epassword=changeme
[webServer]
webServerAddr=127.0.0.1:7878
データベースの同期Elasticsearchサービスを開きます。
mongo-connector -m mongodb://localhost:27017/?unicode_decode_error_handler=ignore -t http://elastic:changeme@localhost:9200/torrent -d elastic2_doc_manager -n bavbt.torrent -i name,length,hot,create_time,category,infohash
サーバが実行されます
go run github.com/Bmixo/btSearch/server
労働者の実行
go run github.com/Bmixo/btSearch/worker
5.すべて
Redisのオプト背景データプレゼンテーションD2-管理者を追加します。