V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
• 请不要在回答技术问题时复制粘贴 AI 生成的内容
kestrelBright
V2EX  ›  程序员

求助 docker kibana 自动退出

  •  
  •   kestrelBright · 2023-03-20 13:46:40 +08:00 · 1302 次点击
    这是一个创建于 647 天前的主题,其中的信息可能已经有所发展或是发生改变。

    docker-composer.yml

    version: '3.4'
    services:
      #elasticsearch
      elasticsearch:
        image: elasticsearch:7.17.7
        ports:
         - "9200:9200"
        volumes:
         - ~/Documents/xxx/elasticsearch/data:/usr/share/elasticsearch/data
         - ~/Documents/xxx/elasticsearch/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml
         - ~/Documents/xxx/elasticsearch/plugins:/usr/share/elasticsearch/plugins
        environment:
          - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
        ulimits:
          memlock:
            soft: -1
            hard: -1
        container_name: es
        networks:
          - code-network
      #kibana
      kibana:
        image: kibana:7.17.7
        depends_on:
          - elasticsearch
        ports:
          - 5601:5601
        container_name: kibana
        volumes:
          - ~/Documents/xxx/kibana/kibana.yml:/usr/share/kibana/config/kibana.yml
        networks:
          - code-network
    networks:
        code-network:
            driver: bridge
    

    elasticsearch.yml

    cluster.name: "docker-cluster"
    network.host: 0.0.0.0
    
    http.cors.enabled: true
    http.cors.allow-origin: "*"
    
    
    cluster.initial_master_nodes: ["node-1"]
    
    xpack.security.enabled: false
    
    

    kibana.yml

    server.name: kibana
    server.host: "0.0.0.0"
    server.shutdownTimeout: "5s"
    elasticsearch.hosts: [ "http://elasticsearch:9200" ]
    monitoring.ui.container.elasticsearch.enabled: true
    
    xpack.infra.enabled: false
    xpack.logstash.enabled: false
    xpack.canvas.enabled: false
    
    #设置 kibana 中文显示
    i18n.locale: zh-CN
    

    kibana 日志

    2023-03-20 11:59:28 {"type":"log","@timestamp":"2023-03-20T03:59:28+00:00","tags":["info","plugins","reporting","config"],"pid":7,"message":"Chromium 沙盒提供附加保护层,受 Linux Ubuntu 20.04 OS 支持。自动启用 Chromium 沙盒。"}
    2023-03-20 11:59:28 {"type":"log","@timestamp":"2023-03-20T03:59:28+00:00","tags":["info","savedobjects-service"],"pid":7,"message":"Waiting until all Elasticsearch nodes are compatible with Kibana before starting saved objects migrations..."}
    2023-03-20 11:59:28 {"type":"log","@timestamp":"2023-03-20T03:59:28+00:00","tags":["info","savedobjects-service"],"pid":7,"message":"Starting saved objects migrations"}
    2023-03-20 12:01:28 {"type":"log","@timestamp":"2023-03-20T04:01:28+00:00","tags":["fatal","root"],"pid":7,"message":"TimeoutError: Request timed out\n    at ClientRequest.onTimeout (/usr/share/kibana/node_modules/@elastic/elasticsearch/lib/Connection.js:110:16)\n    at ClientRequest.emit (node:events:513:28)\n    at Socket.emitRequestTimeout (node:_http_client:814:9)\n    at Object.onceWrapper (node:events:627:28)\n    at Socket.emit (node:events:525:35)\n    at Socket._onTimeout (node:net:526:8)\n    at listOnTimeout (node:internal/timers:559:17)\n    at processTimers (node:internal/timers:502:7) {\n  meta: {\n    body: null,\n    statusCode: null,\n    headers: null,\n    meta: {\n      context: null,\n      request: [Object],\n      name: 'elasticsearch-js',\n      connection: [Object],\n      attempts: 3,\n      aborted: false\n    }\n  }\n}"}
    2023-03-20 12:01:28 {"type":"log","@timestamp":"2023-03-20T04:01:28+00:00","tags":["info","plugins-system","standard"],"pid":7,"message":"Stopping all plugins."}
    2023-03-20 12:01:28 {"type":"log","@timestamp":"2023-03-20T04:01:28+00:00","tags":["info","plugins","monitoring","monitoring","kibana-monitoring"],"pid":7,"message":"Monitoring stats collection is stopped"}
    2023-03-20 12:01:55 {"type":"log","@timestamp":"2023-03-20T04:01:55+00:00","tags":["warning","config","deprecation"],"pid":7,"message":"Configuring \"xpack.canvas.enabled\" is deprecated and will be removed in 8.0.0."}
    2023-03-20 12:01:57 {"type":"log","@timestamp":"2023-03-20T04:01:57+00:00","tags":["info","plugins-service"],"pid":7,"message":"Plugin \"apm\" has been disabled since the following direct or transitive dependencies are missing, disabled, or have incompatible types: [infra]"}
    2023-03-20 12:01:57 {"type":"log","@timestamp":"2023-03-20T04:01:57+00:00","tags":["info","plugins-service"],"pid":7,"message":"Plugin \"canvas\" is disabled."}
    2023-03-20 12:01:57 {"type":"log","@timestamp":"2023-03-20T04:01:57+00:00","tags":["info","plugins-service"],"pid":7,"message":"Plugin \"enterpriseSearch\" has been disabled since the following direct or transitive dependencies are missing, disabled, or have incompatible types: [infra]"}
    2023-03-20 12:01:57 {"type":"log","@timestamp":"2023-03-20T04:01:57+00:00","tags":["info","plugins-service"],"pid":7,"message":"Plugin \"infra\" is disabled."}
    2023-03-20 12:01:57 {"type":"log","@timestamp":"2023-03-20T04:01:57+00:00","tags":["info","plugins-service"],"pid":7,"message":"Plugin \"logstash\" is disabled."}
    2023-03-20 12:01:57 {"type":"log","@timestamp":"2023-03-20T04:01:57+00:00","tags":["info","plugins-service"],"pid":7,"message":"Plugin \"metricsEntities\" is disabled."}
    2023-03-20 12:01:57 {"type":"log","@timestamp":"2023-03-20T04:01:57+00:00","tags":["info","http","server","Preboot"],"pid":7,"message":"http server running at http://0.0.0.0:5601"}
    2023-03-20 12:01:57 {"type":"log","@timestamp":"2023-03-20T04:01:57+00:00","tags":["warning","config","deprecation"],"pid":7,"message":"Starting in 8.0, the Kibana logging format will be changing. This may affect you if you are doing any special handling of your Kibana logs, such as ingesting logs into Elasticsearch for further analysis. If you are using the new logging configuration, you are already receiving logs in both old and new formats, and the old format will simply be going away. If you are not yet using the new logging configuration, the log format will change upon upgrade to 8.0. Beginning in 8.0, the format of JSON logs will be ECS-compatible JSON, and the default pattern log format will be configurable with our new logging system. Please refer to the documentation for more information about the new logging format."}
    2023-03-20 12:01:57 {"type":"log","@timestamp":"2023-03-20T04:01:57+00:00","tags":["warning","config","deprecation"],"pid":7,"message":"配置“xpack.infra.enabled”已过时,将在 8.0.0 中移除。"}
    2023-03-20 12:01:57 {"type":"log","@timestamp":"2023-03-20T04:01:57+00:00","tags":["warning","config","deprecation"],"pid":7,"message":"配置“xpack.logstash.enabled”已过时,将在 8.0.0 中移除。"}
    2023-03-20 12:01:57 {"type":"log","@timestamp":"2023-03-20T04:01:57+00:00","tags":["warning","config","deprecation"],"pid":7,"message":"The default mechanism for Reporting privileges will work differently in future versions, which will affect the behavior of this cluster. Set \"xpack.reporting.roles.enabled\" to \"false\" to adopt the future behavior before upgrading."}
    2023-03-20 12:01:57 {"type":"log","@timestamp":"2023-03-20T04:01:57+00:00","tags":["warning","config","deprecation"],"pid":7,"message":"从 8.0 开始,用户会话将在处于非活动状态 8 小时后自动超时。覆盖此值以更改超时。"}
    2023-03-20 12:01:57 {"type":"log","@timestamp":"2023-03-20T04:01:57+00:00","tags":["warning","config","deprecation"],"pid":7,"message":"从 8.0 开始,将在 30 天后自动要求用户重新登录。覆盖此值以更改超时。"}
    2023-03-20 12:01:57 {"type":"log","@timestamp":"2023-03-20T04:01:57+00:00","tags":["info","plugins-system","standard"],"pid":7,"message":"Setting up [108] plugins: [translations,licensing,globalSearch,globalSearchProviders,features,licenseApiGuard,code,usageCollection,xpackLegacy,taskManager,telemetryCollectionManager,telemetryCollectionXpack,kibanaUsageCollection,share,embeddable,uiActionsEnhanced,screenshotMode,banners,telemetry,newsfeed,mapsEms,mapsLegacy,kibanaLegacy,fieldFormats,expressions,dataViews,charts,esUiShared,bfetch,data,savedObjects,presentationUtil,expressionShape,expressionRevealImage,expressionRepeatImage,expressionMetric,expressionImage,customIntegrations,home,searchprofiler,painlessLab,grokdebugger,management,watcher,licenseManagement,advancedSettings,spaces,security,savedObjectsTagging,reporting,lists,ingestPipelines,fileUpload,encryptedSavedObjects,dataEnhanced,cloud,upgradeAssistant,snapshotRestore,eventLog,actions,alerting,triggersActionsUi,transform,stackAlerts,ruleRegistry,visualizations,visTypeXy,visTypeVislib,visTypeVega,visTypeTimelion,visTypeTagcloud,visTypeTable,visTypePie,visTypeMetric,visTypeMarkdown,tileMap,regionMap,expressionTagcloud,expressionMetricVis,console,graph,fleet,indexManagement,remoteClusters,crossClusterReplication,indexLifecycleManagement,dashboard,maps,dashboardMode,dashboardEnhanced,visualize,visTypeTimeseries,rollup,indexPatternFieldEditor,lens,cases,timelines,discover,osquery,observability,monitoring,discoverEnhanced,dataVisualizer,ml,uptime,securitySolution,savedObjectsManagement,indexPatternManagement]"}
    2023-03-20 12:01:57 {"type":"log","@timestamp":"2023-03-20T04:01:57+00:00","tags":["info","plugins","taskManager"],"pid":7,"message":"TaskManager is identified by the Kibana UUID: 8b527e6e-3972-45a8-8e6d-3e626c87eca4"}
    2023-03-20 12:01:57 {"type":"log","@timestamp":"2023-03-20T04:01:57+00:00","tags":["warning","plugins","security","config"],"pid":7,"message":"Generating a random key for xpack.security.encryptionKey. To prevent sessions from being invalidated on restart, please set xpack.security.encryptionKey in the kibana.yml or use the bin/kibana-encryption-keys command."}
    2023-03-20 12:01:57 {"type":"log","@timestamp":"2023-03-20T04:01:57+00:00","tags":["warning","plugins","security","config"],"pid":7,"message":"Session cookies will be transmitted over insecure connections. This is not recommended."}
    2023-03-20 12:01:57 {"type":"log","@timestamp":"2023-03-20T04:01:57+00:00","tags":["warning","plugins","security","config"],"pid":7,"message":"Generating a random key for xpack.security.encryptionKey. To prevent sessions from being invalidated on restart, please set xpack.security.encryptionKey in the kibana.yml or use the bin/kibana-encryption-keys command."}
    2023-03-20 12:01:57 {"type":"log","@timestamp":"2023-03-20T04:01:57+00:00","tags":["warning","plugins","security","config"],"pid":7,"message":"Session cookies will be transmitted over insecure connections. This is not recommended."}
    2023-03-20 12:01:57 {"type":"log","@timestamp":"2023-03-20T04:01:57+00:00","tags":["warning","plugins","reporting","config"],"pid":7,"message":"为 xpack.reporting.encryptionKey 生成随机密钥。为防止会话在重启时失效,请在 kibana.yml 中设置 xpack.reporting.encryptionKey 或使用 bin/kibana-encryption-keys 命令。"}
    2023-03-20 12:01:57 {"type":"log","@timestamp":"2023-03-20T04:01:57+00:00","tags":["warning","plugins","encryptedSavedObjects"],"pid":7,"message":"Saved objects encryption key is not set. This will severely limit Kibana functionality. Please set xpack.encryptedSavedObjects.encryptionKey in the kibana.yml or use the bin/kibana-encryption-keys command."}
    2023-03-20 12:01:57 {"type":"log","@timestamp":"2023-03-20T04:01:57+00:00","tags":["warning","plugins","actions"],"pid":7,"message":"APIs are disabled because the Encrypted Saved Objects plugin is missing encryption key. Please set xpack.encryptedSavedObjects.encryptionKey in the kibana.yml or use the bin/kibana-encryption-keys command."}
    2023-03-20 12:01:57 {"type":"log","@timestamp":"2023-03-20T04:01:57+00:00","tags":["warning","plugins","alerting"],"pid":7,"message":"APIs are disabled because the Encrypted Saved Objects plugin is missing encryption key. Please set xpack.encryptedSavedObjects.encryptionKey in the kibana.yml or use the bin/kibana-encryption-keys command."}
    2023-03-20 12:01:57 {"type":"log","@timestamp":"2023-03-20T04:01:57+00:00","tags":["info","plugins","ruleRegistry"],"pid":7,"message":"Installing common resources shared between all indices"}
    2023-03-20 12:01:57 {"type":"log","@timestamp":"2023-03-20T04:01:57+00:00","tags":["info","plugins","reporting","config"],"pid":7,"message":"Chromium 沙盒提供附加保护层,受 Linux Ubuntu 20.04 OS 支持。自动启用 Chromium 沙盒。"}
    2023-03-20 12:01:57 {"type":"log","@timestamp":"2023-03-20T04:01:57+00:00","tags":["info","savedobjects-service"],"pid":7,"message":"Waiting until all Elasticsearch nodes are compatible with Kibana before starting saved objects migrations..."}
    2023-03-20 12:01:57 {"type":"log","@timestamp":"2023-03-20T04:01:57+00:00","tags":["info","savedobjects-service"],"pid":7,"message":"Starting saved objects migrations"}
    2023-03-20 12:03:57 {"type":"log","@timestamp":"2023-03-20T04:03:57+00:00","tags":["fatal","root"],"pid":7,"message":"TimeoutError: Request timed out\n    at ClientRequest.onTimeout (/usr/share/kibana/node_modules/@elastic/elasticsearch/lib/Connection.js:110:16)\n    at ClientRequest.emit (node:events:513:28)\n    at Socket.emitRequestTimeout (node:_http_client:814:9)\n    at Object.onceWrapper (node:events:627:28)\n    at Socket.emit (node:events:525:35)\n    at Socket._onTimeout (node:net:526:8)\n    at listOnTimeout (node:internal/timers:559:17)\n    at processTimers (node:internal/timers:502:7) {\n  meta: {\n    body: null,\n    statusCode: null,\n    headers: null,\n    meta: {\n      context: null,\n      request: [Object],\n      name: 'elasticsearch-js',\n      connection: [Object],\n      attempts: 3,\n      aborted: false\n    }\n  }\n}"}
    2023-03-20 12:03:57 {"type":"log","@timestamp":"2023-03-20T04:03:57+00:00","tags":["info","plugins-system","standard"],"pid":7,"message":"Stopping all plugins."}
    2023-03-20 12:03:57 {"type":"log","@timestamp":"2023-03-20T04:03:57+00:00","tags":["info","plugins","monitoring","monitoring","kibana-monitoring"],"pid":7,"message":"Monitoring stats collection is stopped"}
    2023-03-20 12:03:57 
    2023-03-20 12:03:57  FATAL  TimeoutError: Request timed out
    
    5 条回复    2023-03-20 21:34:09 +08:00
    HMYDK
        1
    HMYDK  
       2023-03-20 15:13:06 +08:00
    docker 启动的时候有没有限制 es 内存?可能是内存不够了被 kill 了
    HMYDK
        2
    HMYDK  
       2023-03-20 15:14:37 +08:00
    sorry , 忽略我的回答
    SKYNE
        3
    SKYNE  
       2023-03-20 15:22:44 +08:00   ❤️ 1
    ES 没必要挂载配置文件,通过环境变量很方便,单节点需要使用 single-node 模式
    参考一下: https://www.elastic.co/guide/en/elasticsearch/reference/7.17/docker.html
    示例(已验证):
    version: '3'
    services:
    es01:
    image: elasticsearch:7.17.7
    container_name: es01
    environment:
    - discovery.type=single-node
    - cluster.name=t-demo
    - node.name=es01
    - bootstrap.memory_lock=true
    - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
    restart: on-failure
    ulimits:
    memlock:
    soft: -1
    hard: -1
    volumes:
    - ./data:/usr/share/elasticsearch/data
    ports:
    - 9200:9200
    networks:
    - elastic
    kibana:
    depends_on:
    - es01
    image: kibana:7.17.7
    ports:
    - 5601:5601
    environment:
    - SERVERNAME=kibana
    - ELASTICSEARCH_HOSTS=http://es01:9200
    - I18N_LOCALE=zh-CN
    networks:
    - elastic
    networks:
    elastic:
    driver: bridge
    # 记得修改权限
    chown -R 1000:1000 data
    kestrelBright
        4
    kestrelBright  
    OP
       2023-03-20 17:29:36 +08:00
    @SKYNE 可以了 谢谢
    SKYNE
        5
    SKYNE  
       2023-03-20 21:34:09 +08:00
    no thanks
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1051 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 19:59 · PVG 03:59 · LAX 11:59 · JFK 14:59
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.