链接追踪系列-05.mac m1 安装es+kibana

运行启动脚本:

bash 复制代码
docker run -e ES_JAVA_OPTS="-Xms512m -Xmx512m" -d -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" \
 -v /Users/jelex/dockerV/es/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml  \
-v /Users/jelex/dockerV/es/data:/usr/share/elasticsearch/data \
-v /Users/jelex/dockerV/es/plugins:/usr/share/elasticsearch/plugins \
--name ES01 arm64v8/elasticsearch:7.17.5

#查看端口ip:

bash 复制代码
jelex@jelexxudeMacBook-Pro config % docker inspect -f '{{.Name}} - {{.NetworkSettings.IPAddress }}' $(docker ps -aq)
/ES01 - 172.17.0.4

下载对应版本的kibana: https://hub.docker.com/r/arm64v8/kibana/tags?page=1

bash 复制代码
docker run --name kibana -e ELASTICSEARCH_HOSTS=http://172.17.0.4:9200 -p 5601:5601 -d arm64v8/kibana:7.17.5

http://localhost:5601/app/home#/

下载ik-smart插件:

https://github.com/medcl/elasticsearch-analysis-ik

https://github.com/medcl/elasticsearch-analysis-ik/releases

下载解压放到plugins目录:

编辑IKAnalyzer.cfg.xml:

删除特殊文件:

重启es:

#kibana控制台测试: http://localhost:5601/app/dev_tools#/console

bash 复制代码
GET _analyze
{
   "analyzer": "ik_smart",
   "text": "徐菜鸟努力study,day day up,金庸先生!贫道酸衡子,敬仰大名~"
}

右侧输出结果:

bash 复制代码
#! Elasticsearch built-in security features are not enabled. Without authentication, your cluster could be accessible to anyone. See https://www.elastic.co/guide/en/elasticsearch/reference/7.17/security-minimal-setup.html to enable security.
{
  "tokens" : [
    {
      "token" : "徐菜鸟",
      "start_offset" : 0,
      "end_offset" : 3,
      "type" : "CN_WORD",
      "position" : 0
    },
    {
      "token" : "努力",
      "start_offset" : 3,
      "end_offset" : 5,
      "type" : "CN_WORD",
      "position" : 1
    },
    {
      "token" : "study",
      "start_offset" : 5,
      "end_offset" : 10,
      "type" : "ENGLISH",
      "position" : 2
    },
    {
      "token" : "day",
      "start_offset" : 11,
      "end_offset" : 14,
      "type" : "ENGLISH",
      "position" : 3
    },
    {
      "token" : "day",
      "start_offset" : 15,
      "end_offset" : 18,
      "type" : "ENGLISH",
      "position" : 4
    },
    {
      "token" : "up",
      "start_offset" : 19,
      "end_offset" : 21,
      "type" : "ENGLISH",
      "position" : 5
    },
    {
      "token" : "金庸",
      "start_offset" : 22,
      "end_offset" : 24,
      "type" : "CN_WORD",
      "position" : 6
    },
    {
      "token" : "先生",
      "start_offset" : 24,
      "end_offset" : 26,
      "type" : "CN_WORD",
      "position" : 7
    },
    {
      "token" : "贫道",
      "start_offset" : 27,
      "end_offset" : 29,
      "type" : "CN_WORD",
      "position" : 8
    },
    {
      "token" : "酸衡子",
      "start_offset" : 29,
      "end_offset" : 32,
      "type" : "CN_WORD",
      "position" : 9
    },
    {
      "token" : "敬仰",
      "start_offset" : 33,
      "end_offset" : 35,
      "type" : "CN_WORD",
      "position" : 10
    },
    {
      "token" : "大名",
      "start_offset" : 35,
      "end_offset" : 37,
      "type" : "CN_WORD",
      "position" : 11
    }
  ]
}

------------------------安装log stash---------------

拉取镜像:docker pull logstash:7.17.5

创建数据卷:

配置目录的权限:

先临时运行一下容器,把容器里默认的config目录全部文件复制到宿主机config目录里来:

bash 复制代码
docker run --name logstash01 -d logstash:7.17.5
docker cp logstash01:/usr/share/logstash/config/ /Users/jelex/dockerV/logstash/


复制默认的pipeline目录:docker cp logstash01:/usr/share/logstash/pipeline/ /Users/jelex/dockerV/logstash/

此时logstash还没有写权限:配置下:要运行kibana-tencent容器


创建用户:拥有上述权限:logstash_writer

修改logstash配置:使用远程服务器存储:


停止上面临时启动的logstash容器:docker stop logstash01

再删除: docker rm logstash01

bash 复制代码
#启动正式的:
docker run --name logstash01 \
-p 5044:5044 -p 9600:9600 \
-v /Users/jelex/dockerV/logstash/config:/usr/share/logstash/config \
-v /Users/jelex/dockerV/logstash/data:/usr/share/logstash/data \
-v /Users/jelex/dockerV/logstash/pipeline:/usr/share/logstash/pipeline \
-d logstash:7.17.5
相关推荐
随心但不率性20 小时前
macos app签名和公证
macos·策略模式
witton1 天前
macOS使用LLVM官方发布的tar.xz来安装Clang编译器
vscode·macos·cmake·clang·llvm·qtcreator·clang++
运维实战课程1 天前
elk(都是6.2.4重点-版本2-收集nginx日志并分析绘图(单点es,redis缓存)-无filebeat
nginx·elk·缓存
OKXLIN1 天前
IOS 自定义代理协议Delegate
macos·ios·cocoa
aerror1 天前
Macos下交叉编译安卓的paq8px压缩算法
android·macos
LOLA44442 天前
如何解压7z文件?8种方法(Win/Mac/手机/网页端)
macos·软件需求
刘泽美2 天前
Mac 查看 Java SDK 和 Android SDK 的路径
android·macos
kkk2358132 天前
Diffmerge的下载和使用
macos
桂月二二2 天前
使用 Intersection Observer 实现高效懒加载和滚动监听
前端·macos·前端框架
阿狸远翔2 天前
Mac 上管理本地 Go 版本
chrome·macos·golang