• docker nacos2.03 详细流程 5分钟搞定


    前提要你有docker ,MySQL 没有的话参看我的其他博客

    1:下载sql 语句导入MySQL

    https://github.com/alibaba/nacos/blob/master/config/src/main/resources/META-INF/nacos-db.sql

    或者点下这个链接去找

    https://www.cnblogs.com/qq3245792286/p/15936192.html

    2:创建目录

    mkdir -p /home/nacos/conf

    mkdir -p /home/nacos/data

    mkdir -p /home/nacos/logs

    3:第一次运行nacos并复制相应的文件 主要是application.properties

    docker run -d -p 8848:8848 \
    --name nacos \
    --network woniu_network \
    --ip 192.168.88.8888
    --env MODE=standalone \
    --env SPRING_DATASOURCE_PLATFORM=mysql \
    --env MYSQL_SERVICE_HOST=192.168.88.8888 \
    --env MYSQL_SERVICE_PORT=3306 \
    --env MYSQL_SERVICE_DB_NAME=nacos \
    --env MYSQL_SERVICE_USER=root \
    --env MYSQL_SERVICE_PASSWORD=root123 \
    nacos/nacos-server:2.0.3

    docker ps

    这里我直接把nacos目录复制过来了

    docker cp 63e9741402ed:/home/nacos /home

    找到application.properties

    把内容修改成自己的,ip 用户名 密码啊什么的

    直接上内容你复制就完了,

    ================================================================================


    server.servlet.contextPath=/nacos
    server.port=8848

    spring.datasource.platform=mysql
    db.num=1

    db.url.0=jdbc:mysql://ip:3306/nacos?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useUnicode=true&useSSL=false&serverTimezone=UTC
    db.user=username
    db.password=password

    db.pool.config.connectionTimeout=30000
    db.pool.config.validationTimeout=10000
    db.pool.config.maximumPoolSize=20
    db.pool.config.minimumIdle=2

    nacos.naming.empty-service.auto-clean=true
    nacos.naming.empty-service.clean.initial-delay-ms=50000
    nacos.naming.empty-service.clean.period-time-ms=30000

    management.metrics.export.elastic.enabled=false
    management.metrics.export.influx.enabled=false
    server.tomcat.accesslog.enabled=true
    server.tomcat.accesslog.pattern=%h %l %u %t "%r" %s %b %D %{User-Agent}i %{Request-Source}i
    server.tomcat.basedir=
    nacos.security.ignore.urls=/,/error,/**/*.css,/**/*.js,/**/*.html,/**/*.map,/**/*.svg,/**/*.png,/**/*.ico,/console-ui/public/**,/v1/auth/**,/v1/console/health/**,/actuator/**,/v1/console/server/**
    nacos.core.auth.system.type=nacos
    nacos.core.auth.enabled=false
    nacos.core.auth.default.token.expire.seconds=18000
    nacos.core.auth.default.token.secret.key=SecretKey012345678901234567890123456789012345678901234567890123456789
    nacos.core.auth.caching.enabled=true
    nacos.core.auth.enable.userAgentAuthWhite=false
    nacos.core.auth.server.identity.key=serverIdentity
    nacos.core.auth.server.identity.value=security
    nacos.istio.mcp.server.enabled=false

    ================================================================================

    颜色部分改成你的,说到这你还不懂 改行吧

    开玩笑 不懂的私信我

    删掉这个nacos

    docker rm -f nacos

    4再运行

    docker run -d -p 8848:8848 \
    --name nacos \
    --ip 192.168.88.8888 \
    --privileged=true \
    --restart=always \
    --env MODE=standalone \
    --env SPRING_DATASOURCE_PLATFORM=mysql \
    --env MYSQL_SERVICE_HOST=192.168.88.8888 \
    --env MYSQL_SERVICE_PORT=3306 \
    --env MYSQL_SERVICE_DB_NAME=nacos \
    --env MYSQL_SERVICE_USER=root \
    --env MYSQL_SERVICE_PASSWORD=root123 \
    -v /home/nacos/conf:/home/nacos/conf \
    -v /home/nacos/logs:/home/nacos/logs \
    -v /home/nacos/data:/home/nacos/data \
    nacos/nacos-server:2.0.3

    颜色部分改成你的,说到这你还不懂 改行吧

    开玩笑 不懂的私信我

     5:成了

     

  • 相关阅读:
    124. Binary Tree Maximum Path Sum
    99. Recover Binary Search Tree
    255. Verify Preorder Sequence in Binary Search Tree
    [LeetCode] 79. Word Search Java
    [LeetCode] 78. Subsets Java
    [LeetCode] 77. Combinations Java
    [LeetCode] 52. N-Queens II Java
    [LeetCode] 51. N-Queens Java
    [LeetCode] 47. Permutations II Java
    [LeetCode] 46. Permutations Java
  • 原文地址:https://www.cnblogs.com/qq3245792286/p/15936165.html
Copyright © 2020-2023  润新知