Code Monkey home page Code Monkey logo

maprdcos's Introduction

Running MapR on DCOS


This repo allows a (non-standard DCOS) install of MapR running in Docker on a DCOS cluster.

Prereqs


This assumes some things about your cluster

  • DCOS is running and properly configured
  • The nodes with the MapR Fileservers will be run have some attached storage (MapR prefers unformatted, direct attached disks. These will be dedicated to MapR on the nodes)
  • The nodes have a couple of local users configured
    • zetaadm - UID 2500 (the UID can be changed, it just has to be the same on all nodes)
    • mapr - UID 2000 (the UID can be changed, it just has to be the same on all nodes)
    • There is script included here that will install the users for you (It adds them to the sudoers group and also updates a SSH key for zetaadm user) (0_zeta_user_prep.sh)
  • Docker is installed on all node (This should be done as prereq for the DCOS install)
    • For this, we recommend making your life easier by setting up some insecure registries upfront. We want to get a cert store going, however at this time, we only have insecure registries.
    • To do this: on each node, create a file at for docker systemd overrides (this can be done prior to installing Docker):
    • $ sudo mkdir -p /etc/systemd/system/docker.service.d && sudo touch /etc/systemd/system/docker.service.d/override.conf
    • In that file it it should read:
[Service]
ExecStart=
ExecStart=/user/bin/docker daemon --storage-driver=overlay --insecure-registry=maprdocker-mapr-shared.marathon.slave.mesos:5000 --insecure-registry=dockerregv2-shared.marathon.slave.mesos:5005 -h fd://
  • I did this on a non-standard Ubuntu 16.04 install of DCOS. Everything worked, but this is not supported by Mesosphere at this time.
    • The only thing I updated was a systemd conf file - systemd - edit /etc/systemd/system.conf - set DefaultTasksMax=infinity
    • and updated some links prior to DCOS install: Use Ubuntu at your own risk, however I found CentOS/RH annoying trying to use Overlay FS in Docker
    • Ubuntu Fixes:
    • sudo ln -s /bin/mkdir /usr/bin/mkdir
    • sudo ln -s /bin/ln /usr/bin/ln
    • sudo ln -s /bin/tar /usr/bin/tar
  • In addition to the changes for Ubuntu above, I added a few packages to every node/master. This was in order to help this mapr install
    • sudo apt-get install bc nfs-common syslinux

Current Issues:


  • This is untested. More work needs to be done to ensure production load capabilities
  • MapR does some work to ulimits and other system settings. We need feedback to ensure optimal performance
  • Runnnig a mapr-client on the physical node where the server container is running doesn't work. Some odd bugs right now I am tracking down.
    • This means the mapr-fuse client won't work as it relies on the mapr-client. use loopback-nfs instead, that is working on all nodes
  • ??? Please report new ones to issues!

Install Steps

Create Users


MapR and this install needs some users created on all nodes. I recommend installing these users on all nodes, including masters. Use the script 0_zeta_user_prep.sh

Note there is another repo that does this step as well. That's why the script is labeled 0_ ... you MAY NOT NEED IT

https://github.com/JohnOmernik/dcosprep

If you use this, or you manually do the steps in script 0, just skip it

Some Notes:

  • The script will take a list of nodes and will ask for the password for mapr and zetaaadm and then sync passwords
  • The user the script runs as MUST have ssh and sudo permissions on all nodes
  • It will create (if one doesn't exist) a ssh key for use on the nodes
  • If ran after initial creation it can be used to sync passwords.

*NOTE: We store the user credentials in plain text in a file at /home/zetaadm/creds/ - We do lock down this directory but be aware - We can discuss options more in an ISSUE

Cluster Conf (cluster.conf)


This is where the initial configuration of your cluster comes from. It is created by running through the script: 1_create_cluster.conf.sh Some Notes:

  • Right now the IUSER is hardcoded to by zetaadm. This is on purpose. If you think you know what you are doing, and want to take a risk, you can change it yourself.
  • There is a manual step we could improve on. We have to include the docker registry for bootstrap in the docker daemon startup. It's specified in the script.
  • More Docs are needed on this, but I tried to include in the script and comments.

Install Docker Registry


I like to run my docker registry ON MapRFS, however, there is no MapRFS when I am installing MapR, thus I create a "bootstrap" Docker Registry to host the MapR Docker images" This is done in 2_install_docker_reg.sh Some Notes:

  • This will only have local storage
  • We need (todo) to move images from local boot strap to cluster wide registry
  • This will be run as mapr/maprdocker

Build Zookeeper Image


There are two docker images that need to be built. The first is the Zookeeper image. This is done in 3_build_zk_docker.sh Some Notes:

  • This should be pretty basic
  • It will pull ubuntu:latest prior (if you don't have this)
  • This docker build does display the credentials for the mapr user and zetaadm user. I will work on an issue to discuss the best way to handle this

Run Zookeeper


Once built, the Zookeepers will be started. This happens here: 4_run_zk_docker.sh Some Notes:

  • As will all things, each individual ZK will be given it's own marathon application. For ZK it will be under mapr/zks/. The instance will be both unique and tied to a host so you can't scale beyond one instance
  • Local storage will be used for zkdata and logs. This will be in the MAPR_INST variable. Since we want things to run on the same node, this works well
  • We should look at moving the conf directory to be local storage. It will make updating the conf easier down the line (add todo)

Build MapR Docker Image


We need to build the mapr docker image. This is done in 5_build_mapr_docker.sh Some Notes:

  • This is a large image. (2.15 GB) We may try to make this smaller, but it shoudn't matter much.

Run MapR Docker


Where the cluster gets built. 6_run_mapr_docker.sh to read conf and then run install_mapr_node.sh on each node Some Notes:

  • Will base install the nodes in inodes in the conf.
  • You can add more ndoes with the install_mapr_node.sh script
  • Will show the disk for each node, you need to confirm or change.
  • Local storage is used on each node for logs, conf, and roles
  • Each instance will get it's own marathon app under mapr/cldbs or mapr/stdnodes
  • You will need to license your own mapr follow the links to do so.

Fuse Client Install/Uninstall


fuse_install.sh and fuse_remove.sh to add or remove a fuse_client. Some Notes:

  • It will mount at /mapr/$CLUSTERNAME
  • It's licensed, only 10 are allowed with base M3 license
  • Ask your mapr Rep for more license if needed
  • Will not work with physical nodes that are hosting docker containers. Working on that bug. Use loopback nfs instead.

Loopback-nfs Client Install/Uninstall


loop_install.sh and loop_remove.sh will add or remove a loopback nfs client.

  • It will mount at /mapr/$CLUSTERNAME
  • It's licensed, only 10 are allowed with base M3 license
  • Ask your mapr Rep for more license if needed

destroy_node.sh and destroy_zk.sh


These scripts remove the local storage to start from scratch. Some Notes:

  • Does stop and destroy the app in marathon as well.
  • If it fails try the fully qualified name (it has to be what ever is in the cldb, zk, initial node string)

maprdcos's People

Contributors

johnomernik avatar rvictory avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

maprdcos's Issues

mapr user needs MapR-FS directory

Should create the /user/mapr directory in MapR-FS, otherwise certain features of the MapR Control System (when logged in as the MapR user) don't work, specifically MapR Tables.

MapR Loopback NFS Does not work

Due to an issue with shared memory, the NFS Loopback doesn't work at this time. Currently working with MapR.

Alternatives: If using M3 (community) MapR, start NFS on a node, and have all individual nodes mount NFS there.

Allow user to specify MapR license key?

More of an idea than an issue, but it would be nice to be able to specify a license key and/or specify MapR credentials to have the cluster spin up licensed out of the box.

Mount NFS in MapR Client Docker Image

Not an issue, but an idea, I think we should mount up the cluster via NFS in the MapR Client build. Shouldn't be hard to do, but I think the "right" way to do it is to add the loopback or fuse client script to the image and run it, instead of hard coding in the image build script. Thoughts?

MapR FUSE Client Doesn't work on Physical Nodes

Due to a currently being investigated bug, the MapR FUSE client doesn't work. However, if you wish to install the FUSE client, the Hadoop client will work on every node at this point. Just the fuse Filesystem will not work.

Alternative: start NFS on a node, and mount /mapr from all agents to that NFS server.

Clearly document community vs. enterprise MapR differences

The build scripts obviously work for both the community and enterprise MapR versions, however it's easy for a community user to do things that the community edition doesn't support (multiple CLDBs, multiple NFS nodes, etc.). We should clearly document areas/decisions that are impacted and perhaps have a question that asks which version is being installed and change the questions accordingly.

Create docker containers for running scripts - Including container builds

To increase compatibility, create docker containers to run the various scripts in this repo, including the scripts that build the containers (Docker in Docker). This is to help increase cross platform compatibility. The idea here is the ability to run this on any base OS running DC/OS.

The one challenge here will be the scripts that operate directly on the OS. I.e. the MapR packages for FUSE or NFS Loop back. Some OSes may not be able to run these on the host OS.

Alternatives would be to used licensed MapR and use the native NFS client.

Discuss Secure Method for Handling Credentials

Because the credentials used in the user prep script have to saved for use in the docker containers (or do they?) We store them in a directory in /home/zetaadm/creds We lock this directory down, but it's still scary to have credentials there.

Some points:

  • Should we clean up at some point?
  • Should we encrypt them and use a key?
  • Where would we keep that key?
    • Perhaps and RSA key that required a passphrase to be entered every time the credentials are used?
  • Other options?

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.