美文网首页
十、docker安装及挂载

十、docker安装及挂载

作者: 紫荆秋雪_文 | 来源:发表于2020-06-21 16:18 被阅读0次

    一、docker安装常用软件

    1、安装MySQL

    docker run --restart=always -d --name mysql \
    -v /raven/mysql/conf/my.cnf:/etc/mysql/my.cnf \
    -v /raven/mysql/logs:/logs \
    -v /raven/mysql/data/mysql:/var/lib/mysql \
    -p 3306:3306 -e MYSQL_ROOT_PASSWORD=123456 mysql:8.0.18
    

    2、安装redis

    # 安装 redis
    docker run -d --privileged=true -p 6379:6379 --restart always \
    -v /raven/redis/conf/redis.conf:/etc/redis/redis.conf \
    -v /raven/redis/data:/data \
    --name myredis redis redis-server /etc/redis/redis.conf --appendonly yes
    

    3、安装Elasticsearch

    # 安装 elasticsearch
    docker run --name myES -p 9200:9200 -p 9300:9300 \
    -e "discovery.type=single-node" \
    -e ES_JAVA_OPTS="-Xms64m -Xmx128m" \
    -v /raven/docker/elasticsearch/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml \
    -v /raven/docker/elasticsearch/data:/usr/share/elasticsearch/data \
    -v /raven/docker/elasticsearch/plugins:/usr/share/elasticsearch/plugins \
    -d elasticsearch:7.7.1
    
    docker run --name myES -p 9200:9200 -p 9300:9300 \
    -e "discovery.type=single-node" \
    -e ES_JAVA_OPTS="-Xms64m -Xmx128m" \
    -v /raven/elasticsearch/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml \
    -v /raven/elasticsearch/data:/usr/share/elasticsearch/data \
    -v /raven/elasticsearch/plugins:/usr/share/elasticsearch/plugins \
    -d elasticsearch:7.7.1
    
    docker run -d --restart=always --name mykibana -p 5601:5601 \
    -v /raven/kibana/config/kibana.yml:/usr/share/kibana/config/kibana.yml kibana:7.7.1
    
    • 下载ik分词器
    wget https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v7.7.1/elasticsearch-analysis-ik-7.7.1.zip
    

    4、安装kibana

    # 安装 kibana
    docker run -d --restart=always --name mykibana -p 5601:5601 \
    -v /raven/docker/kibana/config/kibana.yml:/usr/share/kibana/config/kibana.yml kibana:7.7.1
    
    docker run -d --name myKibana -e ELASTICSEARCH_HOSTS=http://123.57.102.7:9200 \
    -p 5601:5601 kibana:7.7.1
    
    • kibana.yml
    server.name: kibana
    server.host: "0"
    elasticsearch.hosts: [ "http://elasticsearch:9200" ]
    xpack.monitoring.ui.container.elasticsearch.enabled: true
    

    相关文章

      网友评论

          本文标题:十、docker安装及挂载

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