美文网首页
安装docker es+ik分词器脚本

安装docker es+ik分词器脚本

作者: 程序员大春 | 来源:发表于2021-03-01 15:22 被阅读0次
    #!/bin/sh
    
    APP_NAME=es
    DOCKER_PID=$(docker ps -a --filter name=${APP_NAME} | awk '{if (NR>1){print $1}}')
    if [ "$DOCKER_PID" ]; then
        echo ">>> Dcoker is already running PID=${DOCKER_PID} <<<"
        docker stop ${DOCKER_PID}
        docker rm ${DOCKER_PID}
    fi
    docker run -p 9200:9200 -p 9300:9300 --name ${APP_NAME} -e "discovery.type=single-node" -e "cluster.name=elasticsearch" -v $PWD/data:/usr/share/elasticsearch/data -v $PWD/plugins:/usr/share/elasticsearch/plugins -d elasticsearch:7.9.3
    chmod 774 $PWD/data
    cd plugins
    mkdir ik
    cd ik
    wget https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v7.9.3/elasticsearch-analysis-ik-7.9.3.zip
    unzip elasticsearch-analysis-ik-7.9.3.zip
    cp ../../IKAnalyzer.cfg.xml ./config/
    docker stop es
    docker start es
    

    相关文章

      网友评论

          本文标题:安装docker es+ik分词器脚本

          本文链接:https://www.haomeiwen.com/subject/jsjafltx.html