3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Chronosでcronの代替をする (CentOS)

Last updated at Posted at 2014-11-01

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

Requirements

  • JDK
  • Apache Mesos

Installation

  • Mesosphereレポジトリをインストール

    rpm -Uvh http://repos.mesosphere.io/el/6/noarch/RPMS/mesosphere-el-repo-6-2.noarch.rpm
    
  • Mesosをインストール

    yum install mesos
    
  • JDKをインストール

    yum install java-1.7.0
    
  • chronosをインストール

    yum install chronos
    
  • zookeeperをインストール

    Clouderaのレポジトリをインストール。

    yum install http://archive.cloudera.com/cdh4/one-click-install/redhat/6/x86_64/cloudera-cdh-4-0.x86_64.rpm
    

    zookeeper、zookeeper-serverをインストール。

    yum install zookeeper zookeeper-server
    
  • zookeeperを起動

    zookeeper初期化

    service zookeeper-server init 
    
    service zookeeper-server start
    
  • mesosを起動

    start mesos-master
    start mesos-slave
    

    ジョブはスレーブプロセスで実行されるので必ずslaveも起動すること

  • chronosを起動

    start chronos
    
  • 動作確認

    mesosのヘルスチェック

    curl -i 10.0.0.1:5050/master/health
    

    chronos

    http://example.com:4400
    

    にアクセスし確認。

気になった点

  • UTCのみ対応。

JSTなど別のタイムゾーンに対応する予定はないとのこと。

  • yumレポジトリのchronos最新版でdockerコンテナを使おうとしても使えない。
 curl -L -H 'Content-Type: application/json' -X POST -d '{ "schedule": "R\/2014-10-23T17:22:00Z\/PT2M", "name": "dockerjob",   "container": {   "type": "DOCKER",   "image": "libmesos/ubuntu"  }, "cpus": "0.5", "mem": "512", "uris": [], "command": "while sleep 10; do date =u %T; done"}' localhost:4400/scheduler/iso8601
curl -L -X GET localhost:4400/scheduler/jobs | jq .

[
  {
    "schedule": "R/2014-10-23T08:14:17.000Z/PT1M",
    "runAsUser": "root",
    "highPriority": false,
    "uris": [],
    "errorsSinceLastSuccess": 0,
    "async": false,
    "owner": "shayashibara@trifort.jp",
    "retries": 2,
    "executorFlags": "",
    "executor": "",
    "epsilon": "PT30M",
    "command": "echo 123",
    "name": "test",
    "successCount": 46,
    "errorCount": 0,
    "lastSuccess": "2014-10-23T08:13:22.027Z",
    "lastError": "",
    "cpus": 0.1,
    "disk": 256,
    "mem": 128,
    "disabled": false
  },
  {
    "schedule": "R/2014-10-23T08:15:00.000Z/PT2M",
    "runAsUser": "root",
    "highPriority": false,
    "uris": [],
    "errorsSinceLastSuccess": 0,
    "async": false,
    "owner": "shayashibara@trifort.jp",
    "retries": 2,
    "executorFlags": "",
    "executor": "",
    "epsilon": "PT60S",
    "command": "while sleep 10; do date =u %T; done",
    "name": "dockerjob",
    "successCount": 0,
    "errorCount": 0,
    "lastSuccess": "",
    "lastError": "",
    "cpus": 0.1,
    "disk": 256,
    "mem": 128,
    "disabled": false
  }
]

container欄がない。

  • Web UIでFontawesome用のリソースが404になってしまうためアイコンが表示されない
3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?