aboutsummaryrefslogtreecommitdiff
path: root/bigtop-deploy
diff options
context:
space:
mode:
authorRoman Shaposhnik <rvs@apache.org>2017-03-20 15:48:40 -0700
committerRoman Shaposhnik <rvs@apache.org>2017-03-24 19:26:42 -0700
commitda1ccfda158c05289e39a003919a886cbe062da9 (patch)
tree68f7a6a47304bd0a15fb22297ed4b09723779c0d /bigtop-deploy
parent31fa70d73af117407f00cf2ba473a76074f472ba (diff)
BIGTOP-2705. provide puppet deployment code for Ambari
Diffstat (limited to 'bigtop-deploy')
-rw-r--r--bigtop-deploy/puppet/hieradata/bigtop/cluster.yaml2
-rw-r--r--bigtop-deploy/puppet/hieradata/site.yaml1
-rw-r--r--bigtop-deploy/puppet/manifests/cluster.pp7
-rw-r--r--bigtop-deploy/puppet/modules/ambari/manifests/init.pp68
-rw-r--r--bigtop-deploy/puppet/modules/ambari/templates/ambari-agent.ini70
5 files changed, 147 insertions, 1 deletions
diff --git a/bigtop-deploy/puppet/hieradata/bigtop/cluster.yaml b/bigtop-deploy/puppet/hieradata/bigtop/cluster.yaml
index 00cb044f..d116763d 100644
--- a/bigtop-deploy/puppet/hieradata/bigtop/cluster.yaml
+++ b/bigtop-deploy/puppet/hieradata/bigtop/cluster.yaml
@@ -225,3 +225,5 @@ gpdb::common::gp_home: "/usr/lib/gpdb"
gpdb::common::db_base_dir: "/data_gp"
gpdb::common::master_db_port: "5432"
gpdb::common::segment_db_port_prefix: "4000"
+
+ambari::agent::server_host: "%{hiera('bigtop::hadoop_head_node')}"
diff --git a/bigtop-deploy/puppet/hieradata/site.yaml b/bigtop-deploy/puppet/hieradata/site.yaml
index 7ee434d7..f18aa9c7 100644
--- a/bigtop-deploy/puppet/hieradata/site.yaml
+++ b/bigtop-deploy/puppet/hieradata/site.yaml
@@ -38,6 +38,7 @@ hadoop::hadoop_storage_dirs:
# - zookeeper
# - ycsb
# - gpdb
+# - ambari
#bigtop::roles_enabled: false
diff --git a/bigtop-deploy/puppet/manifests/cluster.pp b/bigtop-deploy/puppet/manifests/cluster.pp
index 1313082b..56b6fbf4 100644
--- a/bigtop-deploy/puppet/manifests/cluster.pp
+++ b/bigtop-deploy/puppet/manifests/cluster.pp
@@ -144,6 +144,10 @@ $roles_map = {
},
kafka => {
master => ["kafka-server"],
+ },
+ ambari => {
+ master => ["ambari-server"],
+ worker => ["ambari-agent"],
}
}
@@ -215,7 +219,8 @@ class node_with_roles ($roles = hiera("bigtop::roles")) inherits hadoop_cluster_
"kerberos",
"zeppelin",
"kafka",
- "gpdb"
+ "gpdb",
+ "ambari",
]
deploy_module { $modules:
diff --git a/bigtop-deploy/puppet/modules/ambari/manifests/init.pp b/bigtop-deploy/puppet/modules/ambari/manifests/init.pp
new file mode 100644
index 00000000..839f73c7
--- /dev/null
+++ b/bigtop-deploy/puppet/modules/ambari/manifests/init.pp
@@ -0,0 +1,68 @@
+# 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 ambari {
+
+ class deploy ($roles) {
+ if ("ambari-server" in $roles) {
+ include ambari::server
+ }
+
+ if ("ambari-agent" in $roles) {
+ include ambari::agent
+ }
+ }
+
+ class server {
+ package { "ambari-server":
+ ensure => latest,
+ }
+
+ exec {
+ "server setup":
+ command => "/usr/sbin/ambari-server setup -s",
+ require => [ Package["ambari-server"] ]
+ }
+
+ # FIXME: this is currently a workaround for 2.5
+ file { ["/var/lib/ambari-server/resources/stacks/Bigtop", "/var/lib/ambari-server/resources/stacks/Bigtop/1.2.0"]:
+ ensure => 'directory',
+ require => [ Package["ambari-server"] ]
+ }
+
+ service { "ambari-server":
+ ensure => running,
+ require => [ Package["ambari-server"], Exec["server setup"], File["/var/lib/ambari-server/resources/stacks/Bigtop/1.2.0"] ],
+ hasrestart => true,
+ hasstatus => true,
+ }
+ }
+
+ class agent($server_host = "localhost") {
+ package { "ambari-agent":
+ ensure => latest,
+ }
+
+ file {
+ "/etc/ambari-agent/conf/ambari-agent.ini":
+ content => template('ambari/ambari-agent.ini'),
+ require => [Package["ambari-agent"]],
+ }
+
+ service { "ambari-agent":
+ ensure => running,
+ require => [ Package["ambari-agent"], File["/etc/ambari-agent/conf/ambari-agent.ini"] ],
+ hasrestart => true,
+ hasstatus => true,
+ }
+ }
+}
diff --git a/bigtop-deploy/puppet/modules/ambari/templates/ambari-agent.ini b/bigtop-deploy/puppet/modules/ambari/templates/ambari-agent.ini
new file mode 100644
index 00000000..e86c3559
--- /dev/null
+++ b/bigtop-deploy/puppet/modules/ambari/templates/ambari-agent.ini
@@ -0,0 +1,70 @@
+# 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
+
+[server]
+hostname=<%= @server_host %>
+url_port=8440
+secured_url_port=8441
+connect_retry_delay=10
+max_reconnect_retry_delay=30
+
+
+[agent]
+logdir=/var/log/ambari-agent
+piddir=/var/run/ambari-agent
+prefix=/var/lib/ambari-agent/data
+;loglevel=(DEBUG/INFO)
+loglevel=INFO
+data_cleanup_interval=86400
+data_cleanup_max_age=2592000
+data_cleanup_max_size_MB = 100
+ping_port=8670
+cache_dir=/var/lib/ambari-agent/cache
+tolerate_download_failures=true
+run_as_user=root
+parallel_execution=0
+alert_grace_period=5
+status_command_timeout=5
+alert_kinit_timeout=14400000
+system_resource_overrides=/etc/resource_overrides
+; memory_threshold_soft_mb=400
+; memory_threshold_hard_mb=1000
+; ignore_mount_points=/mnt/custom1,/mnt/custom2
+
+[security]
+keysdir=/var/lib/ambari-agent/keys
+server_crt=ca.crt
+passphrase_env_var_name=AMBARI_PASSPHRASE
+ssl_verify_cert=0
+credential_lib_dir=/var/lib/ambari-agent/cred/lib
+credential_conf_dir=/var/lib/ambari-agent/cred/conf
+credential_shell_cmd=org.apache.hadoop.security.alias.CredentialShell
+
+[services]
+pidLookupPath=/var/run/
+
+[heartbeat]
+state_interval_seconds=60
+dirs=/etc/hadoop,/etc/hadoop/conf,/etc/hbase,/etc/hcatalog,/etc/hive,/etc/oozie,
+ /etc/sqoop,
+ /var/run/hadoop,/var/run/zookeeper,/var/run/hbase,/var/run/templeton,/var/run/oozie,
+ /var/log/hadoop,/var/log/zookeeper,/var/log/hbase,/var/run/templeton,/var/log/hive
+; 0 - unlimited
+log_lines_count=300
+idle_interval_min=1
+idle_interval_max=10
+
+
+[logging]
+syslog_enabled=0