-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #56 from continuuity/feature/jobtracker-support
Feature/jobtracker support
- Loading branch information
Showing
5 changed files
with
141 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# | ||
# Cookbook Name:: hadoop | ||
# Recipe:: hadoop_mapreduce_jobtracker | ||
# | ||
# Copyright (C) 2013-2014 Continuuity, Inc. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
|
||
include_recipe 'hadoop::default' | ||
|
||
# TODO: check for these and set them up | ||
# mapreduce.cluster.local.dir = #{hadoop_tmp_dir}/mapred/local | ||
# mapreduce.jobtracker.system.dir = #{hadoop_tmp_dir}/mapred/system | ||
# mapreduce.jobtracker.staging.root.dir = #{hadoop_tmp_dir}/mapred/staging | ||
# mapreduce.cluster.temp.dir = #{hadoop_tmp_dir}/mapred/temp | ||
|
||
# Only CDH supports a JobTracker package | ||
package 'hadoop-0.20-mapreduce-jobtracker' do | ||
action :install | ||
only_if { node['hadoop']['distribution'] == 'cdh' } | ||
end | ||
|
||
service 'hadoop-0.20-mapreduce-jobtracker' do | ||
status_command 'service hadoop-0.20-mapreduce-jobtracker status' | ||
supports [:restart => true, :reload => false, :status => true] | ||
action :nothing | ||
only_if { node['hadoop']['distribution'] == 'cdh' } | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# | ||
# Cookbook Name:: hadoop | ||
# Recipe:: hadoop_mapreduce_tasktracker | ||
# | ||
# Copyright (C) 2013-2014 Continuuity, Inc. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
|
||
include_recipe 'hadoop::default' | ||
|
||
# Only CDH supports a TaskTracker package | ||
package 'hadoop-0.20-mapreduce-tasktracker' do | ||
action :install | ||
only_if { node['hadoop']['distribution'] == 'cdh' } | ||
end | ||
|
||
service 'hadoop-0.20-mapreduce-tasktracker' do | ||
status_command 'service hadoop-0.20-mapreduce-tasktracker status' | ||
supports [:restart => true, :reload => false, :status => true] | ||
action :nothing | ||
only_if { node['hadoop']['distribution'] == 'cdh' } | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
require 'spec_helper' | ||
|
||
describe 'hadoop::hadoop_mapreduce_jobtracker' do | ||
context 'on Centos 6.4 with CDH' do | ||
let(:chef_run) do | ||
ChefSpec::Runner.new(platform: 'centos', version: 6.4) do |node| | ||
node.automatic['domain'] = 'example.com' | ||
node.override['hadoop']['distribution'] = 'cdh' | ||
stub_command('update-alternatives --display hadoop-conf | grep best | awk \'{print $5}\' | grep /etc/hadoop/conf.chef').and_return(false) | ||
end.converge(described_recipe) | ||
end | ||
|
||
it 'installs hadoop-0.20-mapreduce-jobtracker package' do | ||
expect(chef_run).to install_package('hadoop-0.20-mapreduce-jobtracker') | ||
end | ||
|
||
it 'creates hadoop-0.20-mapreduce-jobtracker service resource, but does not run it' do | ||
expect(chef_run).to_not start_service('hadoop-0.20-mapreduce-jobtracker') | ||
end | ||
end | ||
|
||
context 'on Centos 6.4 with HDP' do | ||
let(:chef_run) do | ||
ChefSpec::Runner.new(platform: 'centos', version: 6.4) do |node| | ||
node.automatic['domain'] = 'example.com' | ||
stub_command('update-alternatives --display hadoop-conf | grep best | awk \'{print $5}\' | grep /etc/hadoop/conf.chef').and_return(false) | ||
end.converge(described_recipe) | ||
end | ||
|
||
it 'does not install hadoop-0.20-mapreduce-jobtracker package' do | ||
expect(chef_run).not_to install_package('hadoop-0.20-mapreduce-jobtracker') | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
require 'spec_helper' | ||
|
||
describe 'hadoop::hadoop_mapreduce_tasktracker' do | ||
context 'on Centos 6.4 with CDH' do | ||
let(:chef_run) do | ||
ChefSpec::Runner.new(platform: 'centos', version: 6.4) do |node| | ||
node.automatic['domain'] = 'example.com' | ||
node.override['hadoop']['distribution'] = 'cdh' | ||
stub_command('update-alternatives --display hadoop-conf | grep best | awk \'{print $5}\' | grep /etc/hadoop/conf.chef').and_return(false) | ||
end.converge(described_recipe) | ||
end | ||
|
||
it 'installs hadoop-0.20-mapreduce-tasktracker package' do | ||
expect(chef_run).to install_package('hadoop-0.20-mapreduce-tasktracker') | ||
end | ||
|
||
it 'creates hadoop-0.20-mapreduce-tasktracker service resource, but does not run it' do | ||
expect(chef_run).to_not start_service('hadoop-0.20-mapreduce-tasktracker') | ||
end | ||
end | ||
|
||
context 'on Centos 6.4 with HDP' do | ||
let(:chef_run) do | ||
ChefSpec::Runner.new(platform: 'centos', version: 6.4) do |node| | ||
node.automatic['domain'] = 'example.com' | ||
stub_command('update-alternatives --display hadoop-conf | grep best | awk \'{print $5}\' | grep /etc/hadoop/conf.chef').and_return(false) | ||
end.converge(described_recipe) | ||
end | ||
|
||
it 'does not install hadoop-0.20-mapreduce-tasktracker package' do | ||
expect(chef_run).not_to install_package('hadoop-0.20-mapreduce-tasktracker') | ||
end | ||
end | ||
end |