滑板nomad和prd那个好用

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了滑板nomad和prd那个好用相关的知识,希望对你有一定的参考价值。

参考技术A nomad比较好用。
nomad适合入门级玩家去玩的一款滑板,属于入门级别的,适合新手。prd需要熟练的,控板能力强的。可以根据自己的熟练程度选择合适自己的。
Nomad由滑手IvanMoreno于2000年创立,是西班牙的第一个本土滑板品牌。Nomad灵感来自于nomadism一词,中文寓意游牧民,就像滑手们喜欢带着滑板四处旅行,与世界各地的滑手进行交流,发现并尝试新的滑板地形一样,品牌理念正是源于此意,属于中端档次。

通过 nomad 在 docker 中安装卷

【中文标题】通过 nomad 在 docker 中安装卷【英文标题】:Mounting volumes in docker via nomad 【发布时间】:2021-10-20 08:07:22 【问题描述】:

我正在尝试通过 nomad 运行 docker 容器。该作业规范旨在运行带有 java docker 映像的 docker 容器。来自 localhost 路径的卷应该安装到 docker 容器上。该卷将包含一些 java 文件。容器应按照命令指定的方式编译 java 文件。

期望:java程序的编译应该完成,并且应该在容器和我的本地主机路径中创建一个类文件。

工作规范文件:

job "java" 
  datacenters = ["dc1"]
  type = "service"
  
  update 
    max_parallel = 1
    healthy_deadline = "3m"
    progress_deadline = "10m"
    auto_revert = false
    canary = 0
  

  migrate 
    max_parallel = 1
    health_check = "checks"
    min_healthy_time = "10s"
    healthy_deadline = "5m"
  

  group "compile" 
    count = 1
    
    service 
      name = "java-compile"
      tags = ["java", "compile"]
    
    
    restart 
      attempts = 2
      interval = "30m"
      delay = "15s"
      mode = "fail"
    

    ephemeral_disk 
      size = 300
    

    task "java" 
      driver = "docker"

      config 
        image = "adoptopenjdk/openjdk11"
        mount 
          type = "bind"
          target = "/java"
          source = "/home/ninan/nomad/java"
          readonly = false
          bind_options 
            propagation = "rshared"
          
        
        work_dir = "/java"
        command = "javac Hello.java"
      


      resources 
        cpu    = 500 # 500 MHz
        memory = 1024 # 256MB
      
    
  


目前它无法说出volumes are not enabled; cannot mount host path: "/home/ninan/nomad/java"

附上日志的相关部分:

    2021-08-18T19:09:54.818+0530 [INFO]  client.alloc_runner.task_runner.task_hook.logmon.nomad: opening fifo: alloc_id=f2774019-4135-28f8-9a91-24f6a7c0dbf8 task=java @module=logmon path=/tmp/NomadClient304008624/f2774019-4135-28f8-9a91-24f6a7c0dbf8/alloc/logs/.java.stdout.fifo timestamp=2021-08-18T19:09:54.818+0530
    2021-08-18T19:09:54.819+0530 [INFO]  client.alloc_runner.task_runner.task_hook.logmon.nomad: opening fifo: alloc_id=f2774019-4135-28f8-9a91-24f6a7c0dbf8 task=java @module=logmon path=/tmp/NomadClient304008624/f2774019-4135-28f8-9a91-24f6a7c0dbf8/alloc/logs/.java.stderr.fifo timestamp=2021-08-18T19:09:54.819+0530
    2021-08-18T19:09:55.310+0530 [WARN]  client.alloc_runner.runner_hook.alloc_health_watcher: error looking up Consul registrations for allocation: alloc_id=f2774019-4135-28f8-9a91-24f6a7c0dbf8 error="failed to retrieve services from consul: Get "http://127.0.0.1:8500/v1/agent/services": dial tcp 127.0.0.1:8500: connect: connection refused" alloc_id=f2774019-4135-28f8-9a91-24f6a7c0dbf8
    2021-08-18T19:10:08.094+0530 [ERROR] client.driver_mgr.docker: failed to create container configuration: driver=docker image_name=adoptopenjdk/openjdk11 image_id=sha256:af4af705169ddd5b5c49b64634bc7a09ac000f90ba8e5e49dd9d7cb61c5d2bb8 error="volumes are not enabled; cannot mount host path: "/home/ninan/nomad/java" "/tmp/NomadClient304008624/f2774019-4135-28f8-9a91-24f6a7c0dbf8""
    2021-08-18T19:10:08.094+0530 [ERROR] client.alloc_runner.task_runner: running driver failed: alloc_id=f2774019-4135-28f8-9a91-24f6a7c0dbf8 task=java error="Failed to create container configuration for image "adoptopenjdk/openjdk11" ("sha256:af4af705169ddd5b5c49b64634bc7a09ac000f90ba8e5e49dd9d7cb61c5d2bb8"): volumes are not enabled; cannot mount host path: "/home/ninan/nomad/java" "/tmp/NomadClient304008624/f2774019-4135-28f8-9a91-24f6a7c0dbf8""
    2021-08-18T19:10:08.095+0530 [INFO]  client.alloc_runner.task_runner: not restarting task: alloc_id=f2774019-4135-28f8-9a91-24f6a7c0dbf8 task=java reason="Error was unrecoverable"
    2021-08-18T19:10:08.095+0530 [INFO]  client.gc: marking allocation for GC: alloc_id=f2774019-4135-28f8-9a91-24f6a7c0dbf8

Nomad 服务器启动为 -

sudo nomad agent -dev -bind 0.0.0.0 -log-level INFO 

如何启用卷挂载?

【问题讨论】:

【参考方案1】:

您应该在 nomad 启动之前先创建卷路径,然后在您的 client.hcl 文件中添加以下配置:

host_volume "database-data" 
    path = "/srv/live/postgres-database/data/"
    read_only = false

然后在你的工作规范中, 在group 节中定义音量:

volume "database-data" 
     type      = "host"
     read_only = false
     source    = "database-data"

然后最后在task 节中添加以下内容,使用定义的卷:

volume_mount 
      volume      = "database-data"
      destination = "/var/lib/postgresql/data" #<-- in the container
      read_only   = false

更多详细信息,您可以使用https://www.nomadproject.io/docs/job-specification/volume

希望能帮到你

【讨论】:

以上是关于滑板nomad和prd那个好用的主要内容,如果未能解决你的问题,请参考以下文章

Python编辑器那个好用?

httpcanary那个版本好用

Mock平台测试开发实战01-开篇PRD和需求详细

java中处理JSON的开源工具都有些啥?那个比较好用

java开发工具除了eclipse之外,还有那些啊?有那个比较好用啊?

python编辑器那个比较好用?