Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
dd6e475
Merge pull request #2 from apache/trunk
childsb May 20, 2013
ea21b3c
Merging HCFS work into trunk.
May 20, 2013
05db574
add hcfs service and hcfs_service check to the ambari agent
childsb May 20, 2013
7fab8a8
replace python 2.6 dep with more generic form
childsb May 21, 2013
f125d0d
Add hcfs dependencies for RoleCommandOrder
tmckayus May 21, 2013
77fce34
Add HDP 1.3.1 stack version
tmckayus May 21, 2013
01443f3
Moving the hcfs pp files to the manifests directory, also tweaking a
May 22, 2013
8390058
Change python2.6 to python
tmckayus May 23, 2013
049f36c
Get rid of python2.6 depds in the pom files and in code
tmckayus May 23, 2013
0c132de
Add files for agent so that site-packages is not referenced directly
tmckayus May 23, 2013
0d9bf90
Preventing duplicate creation of the mapred_user by checking for its
May 23, 2013
91b1494
Merge branch 'trunk' of https://github.com/roofmonkey/ambari into trunk
May 23, 2013
07cbe99
only add the mapreduce user if it wasn't already.
childsb May 23, 2013
22584d1
Fix up test in RoleCommandOrder to look for HCFS test in cluster serv…
tmckayus May 24, 2013
61c5ba9
Merge branch 'trunk' of https://github.com/roofmonkey/ambari into trunk
tmckayus May 24, 2013
ed2cbb7
Merge pull request #3 from apache/trunk
childsb May 24, 2013
81972c6
ambari-server start now accepts --debug option to enable remote
May 30, 2013
d04977c
Adding metainfo.xml for the 1.3.1 stack with active set to true.
May 31, 2013
645aec5
trailing slash caused hadoop install to fail
childsb Jun 1, 2013
a7a29d2
Fix for duplication of fs.default.name config that will break HDFS
Jun 3, 2013
b00206c
Add a unit test for the dynamic RoleCommandOrder support for HCFS
Jun 7, 2013
92ef929
Small update to the way fs.default.name gets set for HCFS. This now
Jun 11, 2013
59de60b
Change to NOT include the HCFS-specific configs in core-site.xml when
Jun 13, 2013
1346b35
Adding fs.glusterfs.getfattrcmd to core-site.xml for HCFS installs.
Jun 18, 2013
c788368
Removed Hadoop 2.0 references
Jun 25, 2013
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 3 additions & 26 deletions ambari-agent/conf/unix/ambari-agent
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ AMBARI_AGENT=ambari-agent
PIDFILE=/var/run/ambari-agent/$AMBARI_AGENT.pid
OUTFILE=/var/log/ambari-agent/ambari-agent.out
LOGFILE=/var/log/ambari-agent/ambari-agent.log
AGENT_SCRIPT=/usr/lib/python2.6/site-packages/ambari_agent/main.py
AGENT_SCRIPT=/usr/sbin/ambari-agent.py
OK=1
NOTOK=0

Expand Down Expand Up @@ -65,27 +65,8 @@ export AMBARI_PASSPHRASE=$RESOLVED_AMBARI_PASSPHRASE

#echo $AMBARI_PASSPHRASE

# check for version
check_python_version ()
{
echo "Verifying Python version compatibility..."
majversion=`$PYTHON -V 2>&1 | awk '{print $2}' | cut -d'.' -f1`
minversion=`$PYTHON -V 2>&1 | awk '{print $2}' | cut -d'.' -f2`
numversion=$(( 10 * $majversion + $minversion))
if (( $numversion < 26 )); then
echo "ERROR: Found Python version $majversion.$minversion. Ambari Agent requires Python version > 2.6"
return $NOTOK
fi
echo "Using python " $PYTHON
return $OK
}

case "$1" in
start)
check_python_version
if [ "$?" -eq "$NOTOK" ]; then
exit -1
fi
echo "Checking for previously running Ambari Agent..."
if [ -f $PIDFILE ]; then
PID=`cat $PIDFILE`
Expand All @@ -101,7 +82,7 @@ case "$1" in
fi
fi
echo "Starting ambari-agent"
nohup $PYTHON $AGENT_SCRIPT > $OUTFILE 2>&1 &
nohup $AGENT_SCRIPT > $OUTFILE 2>&1 &
sleep 2
PID=$!
echo "Verifying $AMBARI_AGENT process status..."
Expand Down Expand Up @@ -138,10 +119,6 @@ case "$1" in
fi
;;
stop)
check_python_version
if [ "$?" -eq "$NOTOK" ]; then
exit -1
fi
if [ -f $PIDFILE ]; then
PID=`cat $PIDFILE`
echo "Found $AMBARI_AGENT PID: $PID"
Expand All @@ -151,7 +128,7 @@ case "$1" in
tput sgr0
else
echo "Stopping $AMBARI_AGENT"
$PYTHON $AGENT_SCRIPT stop
$AGENT_SCRIPT stop
fi
echo "Removing PID file at $PIDFILE"
rm -f $PIDFILE
Expand Down
20 changes: 14 additions & 6 deletions ambari-agent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
<description>Ambari Agent</description>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<python.ver>2.6</python.ver>
<python.exec>python2</python.exec>
<python.requires>python &gt;= ${python.ver}</python.requires>
<final.name>${project.artifactId}-${project.version}</final.name>
<package.release>1</package.release>
<package.prefix>/usr</package.prefix>
Expand All @@ -39,10 +42,9 @@
<skipTests>false</skipTests>
<facter.tar>http://downloads.puppetlabs.com/facter/facter-1.6.10.tar.gz</facter.tar>
<puppet.tar>http://downloads.puppetlabs.com/puppet/puppet-2.7.9.tar.gz</puppet.tar>
<install.dir>/usr/lib/python2.6/site-packages/ambari_agent</install.dir>
<agent.install.dir>/usr/lib/python${python.ver}/site-packages/ambari_agent</agent.install.dir>
<ruby.tar>http://public-repo-1.hortonworks.com/HDP-UTILS-1.1.0.15/repos/centos6/ruby-1.8.7-p370.tar.gz</ruby.tar>
<lib.dir>/usr/lib/ambari-agent/lib</lib.dir>
<python.ver>python &gt;= 2.6</python.ver>
</properties>
<profiles>
<profile>
Expand Down Expand Up @@ -89,7 +91,7 @@
<executions>
<execution>
<configuration>
<executable>python2.6</executable>
<executable>python</executable>
<workingDirectory>src/test/python</workingDirectory>
<arguments>
<argument>unitTests.py</argument>
Expand All @@ -107,7 +109,7 @@
</execution>
<execution>
<configuration>
<executable>python2.6</executable>
<executable>python</executable>
<workingDirectory>target/ambari-agent-${project.version}</workingDirectory>
<arguments>
<argument>${project.basedir}/src/main/python/setup.py</argument>
Expand Down Expand Up @@ -146,7 +148,7 @@
<requires>
<require>openssl</require>
<require>zlib</require>
<require>${python.ver}</require>
<require>${python.requires}</require>
</requires>
<postinstallScriptlet>
<scriptFile>src/main/package/rpm/postinstall.sh</scriptFile>
Expand All @@ -165,7 +167,7 @@
<autoRequires>false</autoRequires>
<mappings>
<mapping>
<directory>${install.dir}</directory>
<directory>${agent.install.dir}</directory>
<sources>
<source>
<location>${project.build.directory}/${project.artifactId}-${project.version}/ambari_agent</location>
Expand Down Expand Up @@ -236,6 +238,12 @@
<source>
<location>conf/unix/ambari-agent</location>
</source>
<source>
<location>src/main/python/ambari-agent.py</location>
</source>
<source>
<location>src/main/python/ambari-machine</location>
</source>
</sources>
</mapping>
<mapping>
Expand Down
36 changes: 36 additions & 0 deletions ambari-agent/src/main/puppet/modules/hdp-hadoop/manifests/hcfs.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you 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.
#
#
class hdp-hadoop::hcfs_client(
$service_state = $hdp::params::cluster_client_state,
$opts = {}
) inherits hdp-hadoop::params
{
$hdp::params::service_exists['hdp-hadoop::hcfs_client'] = true
Hdp-hadoop::Common<||>{service_states +> $service_state}
Hdp-hadoop::Package<||>{include_64_bit => true}
Hdp-hadoop::Configfile<||>{sizes +> 64}

if ($service_state == 'no_op') {
} elsif ($service_state in ['running','stopped','installed_and_configured','uninstalled']) {
#adds package, users and directories, and common hadoop configs
include hdp-hadoop::initialize
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you 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.
#
#
class hdp-hadoop::hcfs_service_check(
$service_state = $hdp::params::cluster_client_state
) inherits hdp-hadoop::params
{
$hdp::params::service_exists['hdp-hadoop::hcfs'] = true
}
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@
hdp::user{ $hdfs_user:
groups => [$hdp::params::user_group]
}
if ($hdfs_user != $mapred_user) {
if ( !defined(hdp::user[$mapred_user]) ) {
hdp::user { $mapred_user:
groups => [$hdp::params::user_group]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
$dtnode_heapsize = hdp_default("dtnode_heapsize","1024m")
$ttnode_heapsize = hdp_default("ttnode_heapsize","1024m")

$hadoop_heapsize = hdp_default("hadoop_heapsize","1024m")
$hadoop_heapsize = hdp_default("hadoop_heapsize","1024")

$hdfs_log_dir_prefix = hdp_default("hdfs_log_dir_prefix","/var/log/hadoop")

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python2.6
#!/usr/bin/env python

'''
Licensed to the Apache Software Foundation (ASF) under one
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@
$dfs_data_dir = hdp_default("hdfs-site/dfs.data.dir","/tmp/hadoop-hdfs/dfs/data")

### artifact dir
$artifact_dir = hdp_default("artifact_dir","/tmp/HDP-artifacts/")
$artifact_dir = hdp_default("artifact_dir","/tmp/HDP-artifacts")

### artifacts download url ##
$apache_artifacts_download_url = hdp_default("apache_artifacts_download_url","")
Expand Down
8 changes: 8 additions & 0 deletions ambari-agent/src/main/python/ambari-agent.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env python2
from ambari_agent import main as agent_main

def main():
return agent_main.main()

if __name__ == "__main__":
main()
11 changes: 11 additions & 0 deletions ambari-agent/src/main/python/ambari-machine
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env python2
import sys
from ambari_agent import machine as agent_machine

def main():
# Not sure why machine.py passes sys.argv explicitly
# since it's globally available but we'll keep that convention
return agent_machine.main(sys.argv)

if __name__ == "__main__":
main()
2 changes: 1 addition & 1 deletion ambari-agent/src/main/python/ambari_agent/ActionQueue.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python2.6
#!/usr/bin/env python

'''
Licensed to the Apache Software Foundation (ASF) under one
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python2.6
#!/usr/bin/env python

'''
Licensed to the Apache Software Foundation (ASF) under one
Expand Down
10 changes: 8 additions & 2 deletions ambari-agent/src/main/python/ambari_agent/AmbariConfig.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python2.6
#!/usr/bin/env python

'''
Licensed to the Apache Software Foundation (ASF) under one
Expand Down Expand Up @@ -55,7 +55,7 @@
[heartbeat]
state_interval = 6
dirs=/etc/hadoop,/etc/hadoop/conf,/var/run/hadoop,/var/log/hadoop
rpms=hadoop,openssl,wget,net-snmp,ntpd,ruby,ganglia,nagios
rpms=glusterfs,openssl,wget,net-snmp,ntpd,ruby,ganglia,nagios,glusterfs
"""
s = StringIO.StringIO(content)
config.readfp(s)
Expand All @@ -77,6 +77,9 @@
]

rolesToClass = {
'HCFS': 'hdp-hadoop::hcfs',
'HCFS_CLIENT': 'hdp-hadoop::hcfs_client',
'HCFS_SERVICE_CHECK': 'hdp-hadoop::hcfs_service_check',
'NAMENODE': 'hdp-hadoop::namenode',
'DATANODE': 'hdp-hadoop::datanode',
'SECONDARY_NAMENODE': 'hdp-hadoop::snamenode',
Expand Down Expand Up @@ -136,6 +139,7 @@
}

servicesToPidNames = {
'HCFS' : 'glusterd.pid',
'NAMENODE': 'hadoop-{USER}-namenode.pid$',
'SECONDARY_NAMENODE': 'hadoop-{USER}-secondarynamenode.pid$',
'DATANODE': 'hadoop-{USER}-datanode.pid$',
Expand Down Expand Up @@ -164,6 +168,8 @@
linuxUserPattern = '[A-Za-z0-9_-]*[$]?'

pidPathesVars = [
{'var' : 'hcfs_pid_dir_prefix',
'defaultValue' : '/var/run'},
{'var' : 'hadoop_pid_dir_prefix',
'defaultValue' : '/var/run/hadoop'},
{'var' : 'hadoop_pid_dir_prefix',
Expand Down
2 changes: 1 addition & 1 deletion ambari-agent/src/main/python/ambari_agent/Controller.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python2.6
#!/usr/bin/env python

'''
Licensed to the Apache Software Foundation (ASF) under one
Expand Down
2 changes: 1 addition & 1 deletion ambari-agent/src/main/python/ambari_agent/Hardware.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python2.6
#!/usr/bin/env python

'''
Licensed to the Apache Software Foundation (ASF) under one
Expand Down
2 changes: 1 addition & 1 deletion ambari-agent/src/main/python/ambari_agent/Heartbeat.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python2.6
#!/usr/bin/env python

'''
Licensed to the Apache Software Foundation (ASF) under one
Expand Down
2 changes: 1 addition & 1 deletion ambari-agent/src/main/python/ambari_agent/HostInfo.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python2.6
#!/usr/bin/env python

'''
Licensed to the Apache Software Foundation (ASF) under one
Expand Down
2 changes: 1 addition & 1 deletion ambari-agent/src/main/python/ambari_agent/LiveStatus.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python2.6
#!/usr/bin/env python

'''
Licensed to the Apache Software Foundation (ASF) under one
Expand Down
2 changes: 1 addition & 1 deletion ambari-agent/src/main/python/ambari_agent/ProcessHelper.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python2.6
#!/usr/bin/env python

'''
Licensed to the Apache Software Foundation (ASF) under one
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python2.6
#!/usr/bin/env python

'''
Licensed to the Apache Software Foundation (ASF) under one
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python2.6
#!/usr/bin/env python

'''
Licensed to the Apache Software Foundation (ASF) under one
Expand Down
2 changes: 1 addition & 1 deletion ambari-agent/src/main/python/ambari_agent/Register.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python2.6
#!/usr/bin/env python

'''
Licensed to the Apache Software Foundation (ASF) under one
Expand Down
2 changes: 1 addition & 1 deletion ambari-agent/src/main/python/ambari_agent/RepoInstaller.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python2.6
#!/usr/bin/env python

'''
Licensed to the Apache Software Foundation (ASF) under one
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python2.6
#!/usr/bin/env python

'''
Licensed to the Apache Software Foundation (ASF) under one
Expand Down
2 changes: 1 addition & 1 deletion ambari-agent/src/main/python/ambari_agent/StatusCheck.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python2.6
#!/usr/bin/env python

'''
Licensed to the Apache Software Foundation (ASF) under one
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python2.6
#!/usr/bin/env python

'''
Licensed to the Apache Software Foundation (ASF) under one
Expand Down
2 changes: 1 addition & 1 deletion ambari-agent/src/main/python/ambari_agent/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python2.6
#!/usr/bin/env python
"""
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
Expand Down
Loading