在Windows操作系统上安装Fess和外部Elasticsearch的步骤
环境信息
-
- Windows10 Pro 64bit
-
- Java SE Development Kit 11.0.10
-
- Fess 13.9.3
-
- Elasticsearch 7.9.3
elasticsearch-analysis-fess 7.9.0
elasticsearch-analysis-extension 7.9.1
elasticsearch-configsync 7.9.0
elasticsearch-dataformat 7.9.0
elasticsearch-minhash 7.9.1
使用下列已驗證的組合版本來搭配 Fess 和 Elasticsearch:https://fess.codelibs.org/ja/downloads.html
填補不足之處
因为当初没有考虑,只是安装了最新的 JDK 15.0.2,所以在启动 Fess 时出现了错误。
需要注意 Fess 的安装要求是 Java 11。
请参考网站 https://fess.codelibs.org/ja/13.9/install/install.html。
以下是执行fess.bat时出现的一种错误示例。
java.lang.NoClassDefFoundError: Could not initialize class org.codehaus.groovy.vmplugin.v7.Java7
at org.codehaus.groovy.vmplugin.VMPluginFactory.<clinit>(VMPluginFactory.java:43)
at org.codehaus.groovy.reflection.GroovyClassValueFactory.<clinit>(GroovyClassValueFactory.java:35)
at org.codehaus.groovy.reflection.ClassInfo.<clinit>(ClassInfo.java:107)
at org.codehaus.groovy.reflection.ReflectionCache.getCachedClass(ReflectionCache.java:95)
at org.codehaus.groovy.reflection.ReflectionCache.<clinit>(ReflectionCache.java:39)
at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.registerMethods(MetaClassRegistryImpl.java:210)
at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.<init>(MetaClassRegistryImpl.java:108)
at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.<init>(MetaClassRegistryImpl.java:86)
at groovy.lang.GroovySystem.<clinit>(GroovySystem.java:36)
at org.codehaus.groovy.runtime.InvokerHelper.<clinit>(InvokerHelper.java:86)
at groovy.lang.GroovyObjectSupport.getDefaultMetaClass(GroovyObjectSupport.java:59)
at groovy.lang.GroovyObjectSupport.<init>(GroovyObjectSupport.java:32)
at groovy.lang.Binding.<init>(Binding.java:36)
at org.codelibs.fess.util.GroovyUtil.evaluate(GroovyUtil.java:40)
at org.codelibs.fess.job.impl.GroovyExecutor.execute(GroovyExecutor.java:31)
at org.codelibs.fess.app.job.ScriptExecutorJob.run(ScriptExecutorJob.java:91)
at org.lastaflute.job.LaJobRunner.actuallyRun(LaJobRunner.java:265)
at org.lastaflute.job.LaJobRunner.doRun(LaJobRunner.java:232)
at org.lastaflute.job.LaJobRunner.run(LaJobRunner.java:182)
at org.lastaflute.job.cron4j.Cron4jTask.runJob(Cron4jTask.java:371)
at org.lastaflute.job.cron4j.Cron4jTask.actuallyExecute(Cron4jTask.java:355)
at org.lastaflute.job.cron4j.Cron4jTask.lambda$doExecute$6(Cron4jTask.java:258)
at org.lastaflute.job.cron4j.Cron4jTask.synchronizedNeighborRunning(Cron4jTask.java:328)
at org.lastaflute.job.cron4j.Cron4jTask.doExecute(Cron4jTask.java:246)
at org.lastaflute.job.cron4j.Cron4jTask.execute(Cron4jTask.java:151)
at it.sauronsoftware.cron4j.RomanticCron4jNativeTaskExecutor$RomanticRunner.run(RomanticCron4jNativeTaskExecutor.java:121)
at java.base/java.lang.Thread.run(Thread.java:832)
引入JDK
安装JDK
Windows x64 安装程序
jdk-11.0.10_windows-x64_bin.exe
设置环境变量和路径
控制面板 > 系统 > 系统详细设置 > 环境变量
在新的环境中注册一个名为JAVA_HOME的新环境变量。然后在环境变量Path中追加%JAVA_HOME%\bin。
引入Elasticsearch
安装 Elasticsearch
elasticsearch-7.9.3-windows-x86_64.zip
elasticsearch-7.9.3-适用于Windows的x86_64.zip
将C:\ Elasticsearch-7.9.3解压到指定位置。
安装插件
从命令提示符中安装以下插件。
-
- elasticsearch-analysis-fess
-
- elasticsearch-analysis-extension
-
- elasticsearch-configsync
-
- elasticsearch-dataformat
- elasticsearch-minhash
插件的版本指定请参考以下链接:https://fess.codelibs.org/ja/13.9/install/install.html
C:/elasticsearch-7.9.3/bin/elasticsearch-plugin install org.codelibs:elasticsearch-analysis-fess:7.9.0
C:/elasticsearch-7.9.3/bin/elasticsearch-plugin install org.codelibs:elasticsearch-analysis-extension:7.9.1
C:/elasticsearch-7.9.3/bin/elasticsearch-plugin install org.codelibs:elasticsearch-configsync:7.9.0
C:/elasticsearch-7.9.3/bin/elasticsearch-plugin install org.codelibs:elasticsearch-dataformat:7.9.0
C:/elasticsearch-7.9.3/bin/elasticsearch-plugin install org.codelibs:elasticsearch-minhash:7.9.1
添加设置
configsync.config_path: C:/elasticsearch-7.9.3/config/
Fess的引入
Fess 的安装
fess-13.9.3.zip 可以用汉语翻译为 “fess-13.9.3压缩文件”。
将C:\fess-13.9.3解压缩。
修改设置
解除注释(REM)在第118行。
REM External elasticsearch cluster
REM set FESS_JAVA_OPTS=%FESS_JAVA_OPTS% -Dfess.es.http_address=http://localhost:9200
REM set FESS_JAVA_OPTS=%FESS_JAVA_OPTS% -Dfess.dictionary.path=%ES_HOME%/config/
进行更改
REM External elasticsearch cluster
set FESS_JAVA_OPTS=%FESS_JAVA_OPTS% -Dfess.es.http_address=http://localhost:9200
REM set FESS_JAVA_OPTS=%FESS_JAVA_OPTS% -Dfess.dictionary.path=%ES_HOME%/config/
开始运行
按照 Elasticsearch ⇒ Fess 的顺序启动。
启动和确认 Elasticsearch。
执行以下命令:C:\elasticsearch-7.9.3\bin\elasticsearch.bat。
略
[2021-01-21T10:02:21,286][INFO ][o.e.n.Node ] [hoge] started
[2021-01-21T10:02:29,003][INFO ][o.e.c.r.a.AllocationService] [hoge] Cluster health status changed from [RED] to [GREEN] (reason: [shards started [[.configsync][0]]]).
[2021-01-21T10:02:29,061][INFO ][o.c.e.c.s.ConfigSyncService] [hoge] ConfigFileUpdater is started at 1m intervals.
确认 Elasticsearch 是否已启动
http://localhost:9200/
{
"name": "hoge",
"cluster_name": "elasticsearch",
"cluster_uuid": "hoge",
"version": {
"number": "7.9.3",
"build_flavor": "default",
"build_type": "zip",
"build_hash": "hoge",
"build_date": "2020-10-16T10:36:16.141335Z",
"build_snapshot": false,
"lucene_version": "8.6.2",
"minimum_wire_compatibility_version": "6.8.0",
"minimum_index_compatibility_version": "6.0.0-beta1"
},
"tagline": "You Know, for Search"
}
确认Elasticsearch插件的安装状态
http://localhost:9200/_cat/plugins?v&s=component&h=name,component,version,description&pretty
name component version description
hoge analysis-extension 7.9.1 This plugin provides an analysis library.
hoge analysis-fess 7.9.0 FessAnalysis Plugin for Elasticsearch
hoge configsync 7.9.0 ConfigSync plugin syncs up with configuration files in .configsync index.
hoge dataformat 7.9.0 This plugin provides several response formats.
hoge minhash 7.9.1 This plugin provides b-bit minhash algorism.
确认并启动Fess
运行C:\fess-13.9.3\bin\fess.bat。
请参照以下内容。
请将以下内容以中文本地化转述,仅需要一个选项:
https://qiita.com/RoG/items/10563df2fc40999d2367
https://news.mynavi.jp/itsearch/article/bizapp/4320
请忽略以上链接,因为OpenAI GPT模型无法访问到特定网站的内容,而且目前无法提供特定网站的快照翻译。请提供其他文本或内容,我将很乐意为您提供翻译服务。