<commit_before># Copyright 2014 Google Inc. All Rights Reserved.
#
# 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.

# Basic installation of Ambari from public repos, followed by starting
# ambari-agent and if running on the master, also the ambari-server.

# SELinux gets in the way of many applications
setenforce 0
sed -i 's/\(^[^#]*\)SELINUX=enforcing/\1SELINUX=permissive/' /etc/selinux/config

# Disable iptables
chkconfig iptables off
service iptables stop

# install jdk
yum install -y java7-devel

# Get Repo
curl -O http://public-repo-1.hortonworks.com/ambari/centos6/1.x/updates/${AMBARI_VERSION}/ambari.repo
cp ambari.repo /etc/yum.repos.d/

JAVA_HOME=$(dirname $(dirname $(readlink -e /usr/bin/javac)))
yum install -y ambari-agent
sed -i "s/^.*hostname=localhost/hostname=${MASTER_HOSTNAME}/" \
    /etc/ambari-agent/conf/ambari-agent.ini
service ambari-agent start

if [[ $(hostname) == ${MASTER_HOSTNAME} ]]; then
  yum install -y ambari-server
  service ambari-server stop
  ambari-server setup -j ${JAVA_HOME} -s
  if ! nohup bash -c "service ambari-server start 2>&1 > /dev/null"; then
    echo 'Ambari Server failed to start' >&2
    exit 1
  fi
fi<commit_msg>Fixed #2 - Set JAVA_HOME to JDK<commit_after># Copyright 2014 Google Inc. All Rights Reserved.
#
# 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.

# Basic installation of Ambari from public repos, followed by starting
# ambari-agent and if running on the master, also the ambari-server.

# SELinux gets in the way of many applications
setenforce 0
sed -i 's/\(^[^#]*\)SELINUX=enforcing/\1SELINUX=permissive/' /etc/selinux/config

# Disable iptables
chkconfig iptables off
service iptables stop

# install jdk
yum install -y java7-devel

# Get Repo
curl -O http://public-repo-1.hortonworks.com/ambari/centos6/1.x/updates/${AMBARI_VERSION}/ambari.repo
cp ambari.repo /etc/yum.repos.d/

JAVA_HOME=$(dirname $(dirname $(readlink -e $(which javac))))
yum install -y ambari-agent
sed -i "s/^.*hostname=localhost/hostname=${MASTER_HOSTNAME}/" \
    /etc/ambari-agent/conf/ambari-agent.ini
service ambari-agent start

if [[ $(hostname) == ${MASTER_HOSTNAME} ]]; then
  yum install -y ambari-server
  service ambari-server stop
  ambari-server setup -j ${JAVA_HOME} -s
  if ! nohup bash -c "service ambari-server start 2>&1 > /dev/null"; then
    echo 'Ambari Server failed to start' >&2
    exit 1
  fi
fi
{'fraction_non_alphanumeric': 0.10688836104513064, 'fraction_numerical': 0.010985748218527316, 'mean_word_length': 4.028358208955224, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3199073', 'n_tokens_mistral': 1126, 'n_tokens_neox': 1066, 'n_words': 393}