This tool facilitates the setup of MapR clusters using Puppet. Starting from a fresh installed OS. It downloads & installs puppet and then runs 'puppet apply' (aka. puppet master-less mode) to do the setup. There is no need for any puppet infrastructure in place in advance.
The purpose is to provide a tool such that one can setup & configure an unsecure or MapR-SASL/Kerberos secured MapR cluster in the way he/she wants in a few steps. And once the configuration has been added into puppet hiera, the same/similar cluster can be setup with one command mc up
.
This tool development is in progress. Not all ecosystem components have been added. You are welcome to contribute via pull requests :)
- Download or
git clone
this tool to a directory on your workstation - Decide your cluster name and create the subdirectory:
hieradata/<clustername>
- Review the variables in
hieradata/default.yaml
(e.g., cluster name, MapR core and MEP version, etc.) and override them inhieradata/<clustername>/cluster.yaml
- You can set variables in
hieradata/default.yaml
directly if you manage only one cluster with this tool
- You can set variables in
- For each node in your cluster, create
hieradata/<clustername>/<nodefqdn>.yaml
, add the profiles/roles you want to have on that node - For a secure cluster, generate the needed files and database on node70 (10.10.70.70):
- Add your cluster nodes into /etc/hosts on node70
cd /root/intputfiles
- For MapR SASL secured cluster, generate cldb key files:
/root/SetupMapRCluster/utils/create_cldb_keyfile.sh <clustername> <dnsdomain> node1 node2 ...
- For Kerberos secured cluster, generate kerberos keytab files
cd /root/intputfiles
/root/SetupMapRCluster/utils/create_principal_keytab.sh <clustername> <dnsdomain> node1 node2 ...
- To use the mysql server on node70 for hive metastore, run:
/root/SetupMapRCluster/utils/create_hive_meta.sh <clustername> <hivemeta_node>
- Copy
node70:/root/intputfiles/<clustername>
toinputfiles/
- Copy the entire prepared directory to each individual node
- To install puppet and puppet modules, run under
root
or an account which can sudo to root:mc init
- To install configure and start the MapR cluster, run under
root
or an account which can sudo to root:mc setup
- Or combine both steps above with:
mc up
Include the following into the corresponding module, for example for module profile::mapr::ecosystem::httpfs:
$file = "/opt/mapr/httpfs/httpfs-1.0/etc/hadoop/httpfs-site.xml"
package { ... }
->
profile::hadoop::xmlconf_property {
# add a property
"property_name1": file=>$file, value =>"value1", description=>"description1", ensure=>"present";
# shorthand
"property_name2": file=>$file, value =>"value2";
# remove a property
"property_name3": file=>$file, ensure=>"absent";
}
How to solve "shell-init: error retrieving current directory ... unhandled exception: boost::filesystem::current_path: No such file or directory"?
You may see the following error when run 'mc setup'/'mc up':
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
2017-12-04 16:46:09.627479 FATAL puppetlabs.facter - unhandled exception: boost::filesystem::current_path: No such file or directory
terminate called after throwing an instance of 'boost::filesystem::filesystem_error'
what(): boost::filesystem::current_path: No such file or directory
The reason is that the working directory where you run mc has been removed in a different shell session or by a different app. Change to any existing directory should solve the issue.
- This tool now supports only CentOS/RedHat.
- To setup a kerberized cluster, this tool uses node70 as the KDC. This works only in our UCS env. To do the setup in a cloud env, one can setup a simliar node like node70 with this tool, referring to hieradata/nodes/node70.ucslocal.yaml.
- Add more ecosystem components and their configurations