Giter VIP home page Giter VIP logo

cn-core's Introduction

/!\ This project is not maintained anymore. It was an experiment that never made it into ceph-nano. /!\

cn-core

cn-core replaces the demo.sh scenario of the ceph-container project for a faster bootstrap time, better test coverage and error handling.

cn-core init

See it in action:

[root@37c246814969 tmp]# ./cn-core init
2019/01/14 10:57:29 init: no daemon was selected. Deploying mon, mgr, osd, rgw, dash.
2019/01/14 10:57:29 init mon: run prerequisites
2019/01/14 10:57:29 init mon: writing monitor initial keyring
2019/01/14 10:57:29 init mon: writing ceph configuration file
2019/01/14 10:57:29 init mon: generating monitor map
2019/01/14 10:57:29 init mon: populating monitor store
2019/01/14 10:57:29 init mon: running monitor
2019/01/14 10:57:29 init mgr: run prerequisites
2019/01/14 10:57:29 init mgr: fetching admin keyring
2019/01/14 10:57:29 init mgr: generating manager keyring
2019/01/14 10:57:29 init mgr: running manager
2019/01/14 10:57:29 init osd: run prerequisites
2019/01/14 10:57:29 init osd: generating osd keyring
2019/01/14 10:57:30 init osd: populating osd store
2019/01/14 10:57:31 init osd: running osd
2019/01/14 10:57:33 init rgw: run prerequisites
2019/01/14 10:57:33 init rgw: generating rgw keyring
2019/01/14 10:57:33 init rgw: running rgw on port 8000
2019/01/14 10:57:33 init rgw: creating rgw user
2019/01/14 10:57:41 init dashboard: run prerequisites
2019/01/14 10:57:41 init dashboard: running dashboard on port 5000
2019/01/14 10:57:41 init ceph: running ceph health watcher

Or for daemon in particular cn-core init --daemon mon.

Full CLI example:

$ cn-core init -h
Init a Ceph cluster

Usage:
  cn-core init [flags]

Examples:
cn-core init
cn-core init --daemon mon


Flags:
  -d, --daemon string            Specify which daemon to bootstrap. Valid choices are: mon, mgr, osd, rgw, dash, health.
      --rgw-port string          Specify binding port for Rados Gateway. (default "8000")
      --dash-port string         Specify binding port for Sree dashboard. (default "5000")
      --dash-exposed-ip string   Specify binding port for Sree dashboard.
  -h, --help

cn-core's People

Contributors

kshithijiyer avatar leseb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cn-core's Issues

Daemon startup wrong args

ceph        40  0.5  0.1 571984 125820 ?       Ssl  13:52   1:06 ceph-mon --setuser ceph --setgroup ceph -i ceph-nano-coree-faa32aebf00b --mon-data /var/lib/ceph/mon/ceph-ceph-nano-coree-faa32aebf00b --public-addr 127.0.0.1:3300
ceph       144  0.7  0.2 753936 149424 ?       Ssl  13:52   1:23 ceph-mgr --setuser ceph --setgroup -i ceph-nano-coree-faa32aebf00b
ceph       349  0.3  0.1 850272 69172 ?        Ssl  13:52   0:38 ceph-osd --setuser ceph --setgroup -i 0

mgr and osd are incorrect as they don't have the --setgroup flag set.
Also the osd mkfs does not have these flags.

Ability to connect multiple nanos

The idea is to be able to expend from one to many. Meaning that under the hood we have to configure the rgw replication. As a result you will have multiple gateways running configured to replicate in an active-active fashion.

ceph-volume support

Convert this:

function bootstrap_osd {
  if [[ -n "$OSD_DEVICE" ]]; then
    if [[ -b "$OSD_DEVICE" ]]; then
      if [ -n "$BLUESTORE_BLOCK_SIZE" ]; then
        size=$(parse_size "$BLUESTORE_BLOCK_SIZE")
        if ! grep -qE "bluestore_block_size = $size" /etc/ceph/"${CLUSTER}".conf; then
          echo "bluestore_block_size = $size" >> /etc/ceph/"${CLUSTER}".conf
        fi
      fi
    else
      log "Invalid $OSD_DEVICE, only block device is supported"
      exit 1
    fi
  fi

  if [ ! -e "$OSD_PATH"/keyring ]; then
    if ! grep -qE "osd data = $OSD_PATH" /etc/ceph/"${CLUSTER}".conf; then
      echo "osd data = $OSD_PATH" >> /etc/ceph/"${CLUSTER}".conf
      echo "osd objectstore = bluestore" >> /etc/ceph/"${CLUSTER}".conf
    fi

    # bootstrap OSD
    mkdir -p "$OSD_PATH"
    chown --verbose -R ceph. "$OSD_PATH"

    # if $OSD_DEVICE exists we deploy with ceph-volume
    if [[ -n "$OSD_DEVICE" ]]; then
      ceph-volume lvm prepare --data "$OSD_DEVICE"
    else
      # we go for a 'manual' bootstrap
      ceph "${CLI_OPTS[@]}" auth get-or-create osd."$OSD_ID" mon 'allow profile osd' osd 'allow *' mgr 'allow profile osd' -o "$OSD_PATH"/keyring
      ceph-osd --conf /etc/ceph/"${CLUSTER}".conf --osd-data "$OSD_PATH" --mkfs -i "$OSD_ID"
    fi
  fi

  # activate OSD
  if [[ -n "$OSD_DEVICE" ]]; then
    OSD_FSID="$(ceph-volume lvm list --format json | python -c "import sys, json; print(json.load(sys.stdin)[\"$OSD_ID\"][0][\"tags\"][\"ceph.osd_fsid\"])")"
    ceph-volume lvm activate --no-systemd --bluestore "${OSD_ID}" "${OSD_FSID}"
  fi

When OSD_DEVICE exists then run ceph-volume.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.