【问题标题】:Russian characters are returned in bad charset俄语字符以错误的字符集返回
【发布时间】:2018-01-02 12:30:30
【问题描述】:

在我的 Centos 7 工作站上,我有弹性搜索(ver.5.5.1)图像服务:docker.elastic.co/elasticsearch/elasticsearch:5.5.1。

我的工作站上的文件系统类型是 xfs。

我有 .tar 存档,其中 /usr/share/elasticsearch/data/nodes/0/ 包含索引结构: (来自 kibana 的 JSON)

{
  "_index": "fias-addrobj",
  "_type": "document",
  "_id": "00173aad-ae1a-413e-b73c-d9e573923ef9",
  "_score": 1,
  "_source": {
    "aoid": "00173aad-ae1a-413e-b73c-d9e573923ef9",
    "formalname": "УчительÑкий",
    "regioncode": "26",
    "offname": "УчительÑкий",
    "shortname": "проез",
    "aolevel": 7,
    "parentguid": "2a1c7bdb-05ea-492f-9e1c-b3999f79dcbc",
    "aoguid": "1a10726e-c22d-4ed0-b01e-ebe7bce46ddf",
    "actstatus": 1
  }
}

开始记录我的 JVM 参数:

JVM 参数 [ -Xms2g, -Xmx2g, -XX:+UseConcMarkSweepGC, -XX:CMSInitiatingOccupancyFraction=75, -XX:+UseCMSInitiatingOccupancyOnly, -XX:+AlwaysPreTouch,-Xss1m, -Djava.awt.headless=true,-Dfile.encoding=UTF-8, -Djna.nosys=真, -Djdk.io.permissionsUseCanonicalPath=true, -Dio.netty.noUnsafe=true, -Dio.netty.noKeySetOptimization=true, -Dio.netty.recycler.maxCapacityPerThread=0,-Dlog4j.shutdownHookEnabled=false, -Dlog4j2.disable.jmx=真, -Dlog4j.skipJansi=真, -XX:+HeapDumpOnOutOfMemoryError, -Des.cgroups.hierarchy.override=/, -Xms512m,-Xmx512m,-DFile.encoding=UTF-8, -Des.path.home=/usr/share/elasticsearch ]

formalname – string、offname – string、shortname – string 字符集错误。

【问题讨论】:

  • 成功!问题在于控制台的编码错误。

标签: elasticsearch character-encoding


【解决方案1】:

我只是想帮你,但我没有太多的名声,所以我不能写评论......

反正我也有很多经验“Charset”是不匹配的。 所以,我认为您必须再进行一项测试,即修改 JVM 选项。

我在下面的 Java 选项中找到了两个相关的文档。

doc1. 链接:https://www.elastic.co/guide/en/elasticsearch/reference/current/setting-system-settings.html

doc2. 链接:https://www.elastic.co/guide/en/elasticsearch/guide/current/heap-sizing.html

两个文件都修改了其他选项来启动elasticSearch,但是JVM选项不依赖于elasticSearch。 所以,我认为尝试运行并非毫无价值。

ES_JAVA_OPTS="-dFile.encoding=UTF-8" ./bin/elasticsearch

导出 ES_JAVA_OPTS="-dFile.encoding=UTF-8" ./bin/elasticsearch

【讨论】:

    猜你喜欢
    • 2017-04-09
    • 2013-12-08
    • 2011-01-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-12-18
    • 1970-01-01
    相关资源
    最近更新 更多