├── 4.0.2 └── launch-cluster.sh ├── 4.1.0 └── launch-cluster.sh ├── 5.0.0 └── launch-cluster.sh ├── 5.1.0 └── launch-cluster.sh ├── 5.2.0 └── launch-cluster.sh ├── README.md └── maprdb-json-devpreview └── launch-node.sh /4.0.2/launch-cluster.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | MAPRVER="4.0.2" 4 | # Docker Checks 5 | if [[ -z $(which docker) ]] ; then 6 | echo " docker could not be found on this server. Please install Docker version 1.6.0 or later." 7 | echo " If it is already installed Please update the PATH env variable." 8 | exit 9 | fi 10 | 11 | dv=$(docker --version | awk '{ print $3}' | sed 's/,//') 12 | if [[ $dv < 1.6.0 ]] ; then 13 | echo " Docker version installed on this server : $dv. Please install Docker version 1.6.0 or later." 14 | exit 15 | fi 16 | 17 | # sshpass Checks 18 | if [[ -z $(which sshpass) ]] ; then 19 | echo " sshpass could not be found on this server. Please install sshpass." 20 | echo " If it is already installed Please update the PATH env variable." 21 | exit 22 | fi 23 | 24 | # Usage Check. 25 | if [[ $# -ne 4 ]] 26 | then 27 | echo " Usage : $0 ClusterName NumberOfNodes MemSize-in-kB Path-to-DisklistFile" 28 | exit 29 | fi 30 | 31 | CLUSTERNAME=$1 32 | NUMBEROFNODES=$2 33 | MEMTOTAL=$3 34 | DISKLISTFILE=$4 35 | 36 | if [[ ! -f ${DISKLISTFILE} ]] 37 | then 38 | echo " Disklistile : ${DISKLISTFILE} doesn't exist" 39 | exit 40 | fi 41 | 42 | 43 | #declare -a disks=(`for i in /dev/sd[a-z]; do [[ $(sfdisk -l $i | wc -l) -eq 2 ]] && echo $i; done`) 44 | declare -a disks=(`cat ${DISKLISTFILE}`) 45 | 46 | if [[ ${#disks[@]} -eq 0 ]] 47 | then 48 | echo "There are no usable disks on this server." 49 | exit 50 | fi 51 | 52 | if [[ ${#disks[@]} -lt ${NUMBEROFNODES} ]] ; then 53 | echo " Not enough disks to run the requested configuration. " 54 | echo " This server has ${#disks[@]} disks : ${disks[@]}" 55 | echo " Each node requires a minimum of one disk. " 56 | exit 57 | fi 58 | 59 | if [[ ${NUMBEROFNODES} -eq 0 ]] ; then 60 | echo " Bye !" 61 | exit 62 | fi 63 | 64 | 65 | declare -a container_ids 66 | declare -a container_ips 67 | 68 | # Launch the Control Nodes 69 | cldbdisks=${disks[0]} 70 | function join { local IFS="$1"; shift; echo "$*"; } 71 | if [[ ${NUMBEROFNODES} -lt ${#disks[@]} ]] ; then 72 | cldbdisks=$(join , ${disks[0]} ${disks[@]:$NUMBEROFNODES}) 73 | fi 74 | 75 | cldb_cid=$(docker run -d --privileged -h ${CLUSTERNAME}c1 -e "DISKLIST=$cldbdisks" -e "CLUSTERNAME=${CLUSTERNAME}" -e "MEMTOTAL=${MEMTOTAL}" docker.io/maprtech/mapr-control-cent66:${MAPRVER}) 76 | container_ids[0]=$cldb_cid 77 | 78 | sleep 10 79 | cldbip=$(docker inspect --format '{{ .NetworkSettings.IPAddress }}' ${cldb_cid} ) 80 | container_ips[0]=$cldbip 81 | echo "Control Node IP : $cldbip Starting the cluster: https://${cldbip}:8443/ login:mapr password:mapr" 82 | 83 | sleep 20 84 | # Launch Data Nodes 85 | i=1 86 | while [[ $i -lt $NUMBEROFNODES ]] 87 | do 88 | data_cid=$(docker run -d --privileged -h ${CLUSTERNAME}d${i} -e "CLDBIP=${cldbip}" -e "DISKLIST=${disks[$i]}" -e "CLUSTERNAME=${CLUSTERNAME}" -e "MEMTOTAL=${MEMTOTAL}" docker.io/maprtech/mapr-data-cent66:${MAPRVER}) 89 | container_ids[$i]=$data_cid 90 | sleep 10 91 | dip=$(docker inspect --format '{{ .NetworkSettings.IPAddress }}' ${data_cid} ) 92 | container_ips[$i]=$dip 93 | echo -e "$dip\t${CLUSTERNAME}d${i}\t${CLUSTERNAME}d${i}" >> /tmp/hosts.$$ 94 | i=`expr $i + 1` 95 | done 96 | 97 | 98 | #Populate the /etc/hosts on all the nodes 99 | for ip in "${container_ips[@]}" 100 | do 101 | sshpass -p "mapr" scp -o LogLevel=quiet -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -r /tmp/hosts.$$ ${ip}:/tmp/hosts 102 | sshpass -p "mapr" ssh -o LogLevel=quiet -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no ${ip} 'cat /tmp/hosts >> /etc/hosts' 103 | done 104 | 105 | echo -n "Data Nodes : " 106 | join , ${container_ips[@]:1} 107 | -------------------------------------------------------------------------------- /4.1.0/launch-cluster.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | MAPRVER="4.1.0" 4 | # Docker Checks 5 | if [[ -z $(which docker) ]] ; then 6 | echo " docker could not be found on this server. Please install Docker version 1.6.0 or later." 7 | echo " If it is already installed Please update the PATH env variable." 8 | exit 9 | fi 10 | 11 | dv=$(docker --version | awk '{ print $3}' | sed 's/,//') 12 | if [[ $dv < 1.6.0 ]] ; then 13 | echo " Docker version installed on this server : $dv. Please install Docker version 1.6.0 or later." 14 | exit 15 | fi 16 | 17 | # sshpass Checks 18 | if [[ -z $(which sshpass) ]] ; then 19 | echo " sshpass could not be found on this server. Please install sshpass." 20 | echo " If it is already installed Please update the PATH env variable." 21 | exit 22 | fi 23 | 24 | # Usage Check. 25 | if [[ $# -ne 4 ]] 26 | then 27 | echo " Usage : $0 ClusterName NumberOfNodes MemSize-in-kB Path-to-DisklistFile" 28 | exit 29 | fi 30 | 31 | CLUSTERNAME=$1 32 | NUMBEROFNODES=$2 33 | MEMTOTAL=$3 34 | DISKLISTFILE=$4 35 | 36 | if [[ ! -f ${DISKLISTFILE} ]] 37 | then 38 | echo " Disklistile : ${DISKLISTFILE} doesn't exist" 39 | exit 40 | fi 41 | 42 | 43 | #declare -a disks=(`for i in /dev/sd[a-z]; do [[ $(sfdisk -l $i | wc -l) -eq 2 ]] && echo $i; done`) 44 | declare -a disks=(`cat ${DISKLISTFILE}`) 45 | 46 | if [[ ${#disks[@]} -eq 0 ]] 47 | then 48 | echo "There are no usable disks on this server." 49 | exit 50 | fi 51 | 52 | if [[ ${#disks[@]} -lt ${NUMBEROFNODES} ]] ; then 53 | echo " Not enough disks to run the requested configuration. " 54 | echo " This server has ${#disks[@]} disks : ${disks[@]}" 55 | echo " Each node requires a minimum of one disk. " 56 | exit 57 | fi 58 | 59 | if [[ ${NUMBEROFNODES} -eq 0 ]] ; then 60 | echo " Bye !" 61 | exit 62 | fi 63 | 64 | 65 | declare -a container_ids 66 | declare -a container_ips 67 | 68 | # Launch the Control Nodes 69 | cldbdisks=${disks[0]} 70 | function join { local IFS="$1"; shift; echo "$*"; } 71 | if [[ ${NUMBEROFNODES} -lt ${#disks[@]} ]] ; then 72 | cldbdisks=$(join , ${disks[0]} ${disks[@]:$NUMBEROFNODES}) 73 | fi 74 | 75 | cldb_cid=$(docker run -d --privileged -h ${CLUSTERNAME}c1 -e "DISKLIST=$cldbdisks" -e "CLUSTERNAME=${CLUSTERNAME}" -e "MEMTOTAL=${MEMTOTAL}" docker.io/maprtech/mapr-control-cent66:${MAPRVER}) 76 | container_ids[0]=$cldb_cid 77 | 78 | sleep 10 79 | cldbip=$(docker inspect --format '{{ .NetworkSettings.IPAddress }}' ${cldb_cid} ) 80 | container_ips[0]=$cldbip 81 | echo "Control Node IP : $cldbip Starting the cluster: https://${cldbip}:8443/ login:mapr password:mapr" 82 | 83 | sleep 20 84 | # Launch Data Nodes 85 | i=1 86 | while [[ $i -lt $NUMBEROFNODES ]] 87 | do 88 | data_cid=$(docker run -d --privileged -h ${CLUSTERNAME}d${i} -e "CLDBIP=${cldbip}" -e "DISKLIST=${disks[$i]}" -e "CLUSTERNAME=${CLUSTERNAME}" -e "MEMTOTAL=${MEMTOTAL}" docker.io/maprtech/mapr-data-cent66:${MAPRVER}) 89 | container_ids[$i]=$data_cid 90 | sleep 10 91 | dip=$(docker inspect --format '{{ .NetworkSettings.IPAddress }}' ${data_cid} ) 92 | container_ips[$i]=$dip 93 | echo -e "$dip\t${CLUSTERNAME}d${i}\t${CLUSTERNAME}d${i}" >> /tmp/hosts.$$ 94 | i=`expr $i + 1` 95 | done 96 | 97 | 98 | #Populate the /etc/hosts on all the nodes 99 | for ip in "${container_ips[@]}" 100 | do 101 | sshpass -p "mapr" scp -o LogLevel=quiet -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -r /tmp/hosts.$$ ${ip}:/tmp/hosts 102 | sshpass -p "mapr" ssh -o LogLevel=quiet -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no ${ip} 'cat /tmp/hosts >> /etc/hosts' 103 | done 104 | 105 | echo -n "Data Nodes : " 106 | join , ${container_ips[@]:1} 107 | -------------------------------------------------------------------------------- /5.0.0/launch-cluster.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | MAPRVER="5.0.0" 4 | # Docker Checks 5 | if [[ -z $(which docker) ]] ; then 6 | echo " docker could not be found on this server. Please install Docker version 1.6.0 or later." 7 | echo " If it is already installed Please update the PATH env variable." 8 | exit 9 | fi 10 | 11 | dv=$(docker --version | awk '{ print $3}' | sed 's/,//') 12 | if [[ $dv < 1.6.0 ]] ; then 13 | echo " Docker version installed on this server : $dv. Please install Docker version 1.6.0 or later." 14 | exit 15 | fi 16 | 17 | # sshpass Checks 18 | if [[ -z $(which sshpass) ]] ; then 19 | echo " sshpass could not be found on this server. Please install sshpass." 20 | echo " If it is already installed Please update the PATH env variable." 21 | exit 22 | fi 23 | 24 | # Usage Check. 25 | if [[ $# -ne 4 ]] 26 | then 27 | echo " Usage : $0 ClusterName NumberOfNodes MemSize-in-kB Path-to-DisklistFile" 28 | exit 29 | fi 30 | 31 | CLUSTERNAME=$1 32 | NUMBEROFNODES=$2 33 | MEMTOTAL=$3 34 | DISKLISTFILE=$4 35 | 36 | if [[ ! -f ${DISKLISTFILE} ]] 37 | then 38 | echo " Disklistile : ${DISKLISTFILE} doesn't exist" 39 | exit 40 | fi 41 | 42 | 43 | #declare -a disks=(`for i in /dev/sd[a-z]; do [[ $(sfdisk -l $i | wc -l) -eq 2 ]] && echo $i; done`) 44 | declare -a disks=(`cat ${DISKLISTFILE}`) 45 | 46 | if [[ ${#disks[@]} -eq 0 ]] 47 | then 48 | echo "There are no usable disks on this server." 49 | exit 50 | fi 51 | 52 | if [[ ${#disks[@]} -lt ${NUMBEROFNODES} ]] ; then 53 | echo " Not enough disks to run the requested configuration. " 54 | echo " This server has ${#disks[@]} disks : ${disks[@]}" 55 | echo " Each node requires a minimum of one disk. " 56 | exit 57 | fi 58 | 59 | if [[ ${NUMBEROFNODES} -eq 0 ]] ; then 60 | echo " Bye !" 61 | exit 62 | fi 63 | 64 | 65 | declare -a container_ids 66 | declare -a container_ips 67 | 68 | # Launch the Control Nodes 69 | cldbdisks=${disks[0]} 70 | function join { local IFS="$1"; shift; echo "$*"; } 71 | if [[ ${NUMBEROFNODES} -lt ${#disks[@]} ]] ; then 72 | cldbdisks=$(join , ${disks[0]} ${disks[@]:$NUMBEROFNODES}) 73 | fi 74 | 75 | cldb_cid=$(docker run -d --privileged -h ${CLUSTERNAME}c1 -e "DISKLIST=$cldbdisks" -e "CLUSTERNAME=${CLUSTERNAME}" -e "MEMTOTAL=${MEMTOTAL}" docker.io/maprtech/mapr-control-cent66:${MAPRVER}) 76 | container_ids[0]=$cldb_cid 77 | 78 | sleep 10 79 | cldbip=$(docker inspect --format '{{ .NetworkSettings.IPAddress }}' ${cldb_cid} ) 80 | container_ips[0]=$cldbip 81 | echo "Control Node IP : $cldbip Starting the cluster: https://${cldbip}:8443/ login:mapr password:mapr" 82 | 83 | sleep 20 84 | # Launch Data Nodes 85 | i=1 86 | while [[ $i -lt $NUMBEROFNODES ]] 87 | do 88 | data_cid=$(docker run -d --privileged -h ${CLUSTERNAME}d${i} -e "CLDBIP=${cldbip}" -e "DISKLIST=${disks[$i]}" -e "CLUSTERNAME=${CLUSTERNAME}" -e "MEMTOTAL=${MEMTOTAL}" docker.io/maprtech/mapr-data-cent66:${MAPRVER}) 89 | container_ids[$i]=$data_cid 90 | sleep 10 91 | dip=$(docker inspect --format '{{ .NetworkSettings.IPAddress }}' ${data_cid} ) 92 | container_ips[$i]=$dip 93 | echo -e "$dip\t${CLUSTERNAME}d${i}\t${CLUSTERNAME}d${i}" >> /tmp/hosts.$$ 94 | i=`expr $i + 1` 95 | done 96 | 97 | 98 | #Populate the /etc/hosts on all the nodes 99 | for ip in "${container_ips[@]}" 100 | do 101 | sshpass -p "mapr" scp -o LogLevel=quiet -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -r /tmp/hosts.$$ ${ip}:/tmp/hosts 102 | sshpass -p "mapr" ssh -o LogLevel=quiet -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no ${ip} 'cat /tmp/hosts >> /etc/hosts' 103 | done 104 | 105 | echo -n "Data Nodes : " 106 | join , ${container_ips[@]:1} 107 | -------------------------------------------------------------------------------- /5.1.0/launch-cluster.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | MAPRVER="5.1.0" 4 | # Docker Checks 5 | if [[ -z $(which docker) ]] ; then 6 | echo " docker could not be found on this server. Please install Docker version 1.6.0 or later." 7 | echo " If it is already installed Please update the PATH env variable." 8 | exit 9 | fi 10 | 11 | dv=$(docker --version | awk '{ print $3}' | sed 's/,//') 12 | if [[ $dv < 1.6.0 ]] ; then 13 | echo " Docker version installed on this server : $dv. Please install Docker version 1.6.0 or later." 14 | exit 15 | fi 16 | 17 | # Usage Check. 18 | if [[ $# -ne 4 ]] 19 | then 20 | echo " Usage : $0 ClusterName NumberOfNodes MemSize-in-kB Path-to-DisklistFile" 21 | exit 22 | fi 23 | 24 | CLUSTERNAME=$1 25 | NUMBEROFNODES=$2 26 | MEMTOTAL=$3 27 | DISKLISTFILE=$4 28 | 29 | if [[ ! -f ${DISKLISTFILE} ]] 30 | then 31 | echo " Disklistile : ${DISKLISTFILE} doesn't exist" 32 | exit 33 | fi 34 | 35 | 36 | #declare -a disks=(`for i in /dev/sd[a-z]; do [[ $(sfdisk -l $i | wc -l) -eq 2 ]] && echo $i; done`) 37 | declare -a disks=(`cat ${DISKLISTFILE}`) 38 | 39 | if [[ ${#disks[@]} -eq 0 ]] 40 | then 41 | echo "There are no usable disks on this server." 42 | exit 43 | fi 44 | 45 | if [[ ${#disks[@]} -lt ${NUMBEROFNODES} ]] ; then 46 | echo " Not enough disks to run the requested configuration. " 47 | echo " This server has ${#disks[@]} disks : ${disks[@]}" 48 | echo " Each node requires a minimum of one disk. " 49 | exit 50 | fi 51 | 52 | if [[ ${NUMBEROFNODES} -eq 0 ]] ; then 53 | echo " Bye !" 54 | exit 55 | fi 56 | 57 | 58 | declare -a container_ids 59 | declare -a container_ips 60 | 61 | # Launch the Control Nodes 62 | cldbdisks=${disks[0]} 63 | function join { local IFS="$1"; shift; echo "$*"; } 64 | if [[ ${NUMBEROFNODES} -lt ${#disks[@]} ]] ; then 65 | cldbdisks=$(join , ${disks[0]} ${disks[@]:$NUMBEROFNODES}) 66 | fi 67 | 68 | cldb_cid=$(docker run -d --privileged -h ${CLUSTERNAME}c1 -e "DISKLIST=$cldbdisks" -e "CLUSTERNAME=${CLUSTERNAME}" -e "MEMTOTAL=${MEMTOTAL}" docker.io/maprtech/mapr-control-cent67:${MAPRVER}) 69 | container_ids[0]=$cldb_cid 70 | 71 | sleep 10 72 | cldbip=$(docker inspect --format '{{ .NetworkSettings.IPAddress }}' ${cldb_cid} ) 73 | container_ips[0]=$cldbip 74 | echo "Control Node IP : $cldbip Starting the cluster: https://${cldbip}:8443/ login:mapr password:mapr" 75 | 76 | sleep 20 77 | # Launch Data Nodes 78 | i=1 79 | while [[ $i -lt $NUMBEROFNODES ]] 80 | do 81 | data_cid=$(docker run -d --privileged -h ${CLUSTERNAME}d${i} -e "CLDBIP=${cldbip}" -e "DISKLIST=${disks[$i]}" -e "CLUSTERNAME=${CLUSTERNAME}" -e "MEMTOTAL=${MEMTOTAL}" docker.io/maprtech/mapr-data-cent67:${MAPRVER}) 82 | container_ids[$i]=$data_cid 83 | sleep 10 84 | dip=$(docker inspect --format '{{ .NetworkSettings.IPAddress }}' ${data_cid} ) 85 | container_ips[$i]=$dip 86 | echo -e "$dip\t${CLUSTERNAME}d${i}.mapr.io\t${CLUSTERNAME}d${i}" >> /tmp/hosts.$$ 87 | i=`expr $i + 1` 88 | done 89 | 90 | 91 | #Populate the /etc/hosts on all the nodes 92 | for ip in "${container_ips[@]}" 93 | do 94 | sshpass -p "mapr" scp -o LogLevel=quiet -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -r /tmp/hosts.$$ ${ip}:/tmp/hosts 95 | sshpass -p "mapr" ssh -o LogLevel=quiet -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no ${ip} 'cat /tmp/hosts >> /etc/hosts' 96 | done 97 | 98 | # For Spark 99 | sleep 60 100 | sshpass -p "mapr" ssh -o LogLevel=quiet -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no ${cldbip} 'hadoop fs -mkdir /apps/spark; hadoop fs -chmod 777 /apps/spark' 101 | 102 | echo -n "Data Nodes : " 103 | join , ${container_ips[@]:1} 104 | -------------------------------------------------------------------------------- /5.2.0/launch-cluster.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | MAPRVER="5.2.0" 4 | # Docker Checks 5 | if [[ -z $(which docker) ]] ; then 6 | echo " docker could not be found on this server. Please install Docker version 1.6.0 or later." 7 | echo " If it is already installed Please update the PATH env variable." 8 | exit 9 | fi 10 | 11 | dv=$(docker --version | awk '{ print $3}' | sed 's/,//') 12 | if [[ $dv < 1.6.0 ]] ; then 13 | echo " Docker version installed on this server : $dv. Please install Docker version 1.6.0 or later." 14 | exit 15 | fi 16 | 17 | # Usage Check. 18 | if [[ $# -ne 4 ]] 19 | then 20 | echo " Usage : $0 ClusterName NumberOfNodes MemSize-in-kB Path-to-DisklistFile" 21 | exit 22 | fi 23 | 24 | CLUSTERNAME=$1 25 | NUMBEROFNODES=$2 26 | MEMTOTAL=$3 27 | DISKLISTFILE=$4 28 | 29 | if [[ ! -f ${DISKLISTFILE} ]] 30 | then 31 | echo " Disklistile : ${DISKLISTFILE} doesn't exist" 32 | exit 33 | fi 34 | 35 | 36 | #declare -a disks=(`for i in /dev/sd[a-z]; do [[ $(sfdisk -l $i | wc -l) -eq 2 ]] && echo $i; done`) 37 | declare -a disks=(`cat ${DISKLISTFILE}`) 38 | 39 | if [[ ${#disks[@]} -eq 0 ]] 40 | then 41 | echo "There are no usable disks on this server." 42 | exit 43 | fi 44 | 45 | if [[ ${#disks[@]} -lt ${NUMBEROFNODES} ]] ; then 46 | echo " Not enough disks to run the requested configuration. " 47 | echo " This server has ${#disks[@]} disks : ${disks[@]}" 48 | echo " Each node requires a minimum of one disk. " 49 | exit 50 | fi 51 | 52 | if [[ ${NUMBEROFNODES} -eq 0 ]] ; then 53 | echo " Bye !" 54 | exit 55 | fi 56 | 57 | 58 | declare -a container_ids 59 | declare -a container_ips 60 | 61 | # Launch the Control Nodes 62 | cldbdisks=${disks[0]} 63 | function join { local IFS="$1"; shift; echo "$*"; } 64 | if [[ ${NUMBEROFNODES} -lt ${#disks[@]} ]] ; then 65 | cldbdisks=$(join , ${disks[0]} ${disks[@]:$NUMBEROFNODES}) 66 | fi 67 | 68 | cldb_cid=$(docker run -d --privileged -h ${CLUSTERNAME}c1 -e "DISKLIST=$cldbdisks" -e "CLUSTERNAME=${CLUSTERNAME}" -e "MEMTOTAL=${MEMTOTAL}" docker.io/maprtech/mapr-control-cent67:${MAPRVER}) 69 | container_ids[0]=$cldb_cid 70 | 71 | sleep 10 72 | cldbip=$(docker inspect --format '{{ .NetworkSettings.IPAddress }}' ${cldb_cid} ) 73 | container_ips[0]=$cldbip 74 | echo "Control Node IP : $cldbip Starting the cluster: https://${cldbip}:8443/ login:mapr password:mapr" 75 | 76 | sleep 20 77 | # Launch Data Nodes 78 | i=1 79 | while [[ $i -lt $NUMBEROFNODES ]] 80 | do 81 | data_cid=$(docker run -d --privileged -h ${CLUSTERNAME}d${i} -e "CLDBIP=${cldbip}" -e "DISKLIST=${disks[$i]}" -e "CLUSTERNAME=${CLUSTERNAME}" -e "MEMTOTAL=${MEMTOTAL}" docker.io/maprtech/mapr-data-cent67:${MAPRVER}) 82 | container_ids[$i]=$data_cid 83 | sleep 10 84 | dip=$(docker inspect --format '{{ .NetworkSettings.IPAddress }}' ${data_cid} ) 85 | container_ips[$i]=$dip 86 | echo -e "$dip\t${CLUSTERNAME}d${i}.mapr.io\t${CLUSTERNAME}d${i}" >> /tmp/hosts.$$ 87 | i=`expr $i + 1` 88 | done 89 | 90 | 91 | #Populate the /etc/hosts on all the nodes 92 | for ip in "${container_ips[@]}" 93 | do 94 | sshpass -p "mapr" scp -o LogLevel=quiet -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -r /tmp/hosts.$$ ${ip}:/tmp/hosts 95 | sshpass -p "mapr" ssh -o LogLevel=quiet -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no ${ip} 'cat /tmp/hosts >> /etc/hosts' 96 | done 97 | 98 | # For Spark 99 | sleep 60 100 | sshpass -p "mapr" ssh -o LogLevel=quiet -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no ${cldbip} 'hadoop fs -mkdir /apps/spark; hadoop fs -chmod 777 /apps/spark' 101 | 102 | echo -n "Data Nodes : " 103 | join , ${container_ips[@]:1} 104 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | MapR Docker Multi-Container Cluster set-up README.md 2 | ==================================================== 3 | 4 | 5 | Docker Requirements and set-up: 6 | ------------------------------- 7 | 1. Docker v1.6.0 or later is required to run this set-up script. 8 | 9 | 2. Docker Network : Docker containers MapR cluster require public IPs. Please work with your IT to get a routable IP network range for the docker bridge. 10 | - Configure a Network brige with an IP from the routable IP range. 11 | - Add the following options to the docker daemon : '-b --fixed-cidr=cidr-or-routable-range' 12 | Eg: '-b br0 --fixed-cidr=10.10.101.16/29' - This makes docker to allocate the IPs 10.10.101.17 - 10.10.101.22 (6 IPs). 13 | 14 | 3. (optional) Docker Disk options: Please add the following options to the docker daemon : '--storage-opt dm.basesize=30G --storage-opt dm.loopdatasize=200G' 15 | 16 | 4. Restart the docker daemon with the above options. 17 | 18 | Container Requirement: 19 | ---------------------- 20 | Each container in the cluster requires at least one disk. Please make sure enough number of free disks are there in the system. 21 | Create a disk list file with one disk/partition per line. 22 | Eg: 23 | # cat /tmp/disklist.txt 24 | /dev/sdb 25 | /dev/sdc 26 | /dev/sdd 27 | /dev/sde 28 | /dev/sdf 29 | # 30 | 31 | Script : launch-cluster.sh 32 | 33 | Go to the dir where the script is downloaded to and run: 34 | Usage : ./launch-cluster.sh ClusterName NumberOfNodes MemSize-in-kB Path-to-DisklistFile 35 | Eg: ./launch-cluster.sh demo 3 24576000 /tmp/diskfile.txt 36 | This will launch 3 nodes with 24GB mem for each containers and creates a cluster with 3 nodes. 37 | -------------------------------------------------------------------------------- /maprdb-json-devpreview/launch-node.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | declare -a container_ids 4 | declare -a container_ips 5 | 6 | # Launch the Control Nodes 7 | 8 | cldb_cid=$(docker run -d --privileged -h maprdemo docker.io/maprtech/maprdb-json-devpreview:34670) 9 | container_ids[0]=$cldb_cid 10 | 11 | cldbip=$(docker inspect --format '{{ .NetworkSettings.IPAddress }}' ${cldb_cid} ) 12 | container_ips[0]=$cldbip 13 | echo "Control Node IP : $cldbip Starting the cluster: https://${cldbip}:8443/ login:mapr password:mapr" 14 | echo "sshd is enabled" 15 | --------------------------------------------------------------------------------