You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bigtop.apache.org by rv...@apache.org on 2017/03/25 02:26:51 UTC

bigtop git commit: BIGTOP-2705. provide puppet deployment code for Ambari

Repository: bigtop
Updated Branches:
  refs/heads/master 31fa70d73 -> da1ccfda1


BIGTOP-2705. provide puppet deployment code for Ambari


Project: http://git-wip-us.apache.org/repos/asf/bigtop/repo
Commit: http://git-wip-us.apache.org/repos/asf/bigtop/commit/da1ccfda
Tree: http://git-wip-us.apache.org/repos/asf/bigtop/tree/da1ccfda
Diff: http://git-wip-us.apache.org/repos/asf/bigtop/diff/da1ccfda

Branch: refs/heads/master
Commit: da1ccfda158c05289e39a003919a886cbe062da9
Parents: 31fa70d
Author: Roman Shaposhnik <rv...@apache.org>
Authored: Mon Mar 20 15:48:40 2017 -0700
Committer: Roman Shaposhnik <rv...@apache.org>
Committed: Fri Mar 24 19:26:42 2017 -0700

----------------------------------------------------------------------
 .../puppet/hieradata/bigtop/cluster.yaml        |  2 +
 bigtop-deploy/puppet/hieradata/site.yaml        |  1 +
 bigtop-deploy/puppet/manifests/cluster.pp       |  7 +-
 .../puppet/modules/ambari/manifests/init.pp     | 68 +++++++++++++++++++
 .../modules/ambari/templates/ambari-agent.ini   | 70 ++++++++++++++++++++
 5 files changed, 147 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/bigtop/blob/da1ccfda/bigtop-deploy/puppet/hieradata/bigtop/cluster.yaml
----------------------------------------------------------------------
diff --git a/bigtop-deploy/puppet/hieradata/bigtop/cluster.yaml b/bigtop-deploy/puppet/hieradata/bigtop/cluster.yaml
index 00cb044..d116763 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')}"

http://git-wip-us.apache.org/repos/asf/bigtop/blob/da1ccfda/bigtop-deploy/puppet/hieradata/site.yaml
----------------------------------------------------------------------
diff --git a/bigtop-deploy/puppet/hieradata/site.yaml b/bigtop-deploy/puppet/hieradata/site.yaml
index 7ee434d..f18aa9c 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
 

http://git-wip-us.apache.org/repos/asf/bigtop/blob/da1ccfda/bigtop-deploy/puppet/manifests/cluster.pp
----------------------------------------------------------------------
diff --git a/bigtop-deploy/puppet/manifests/cluster.pp b/bigtop-deploy/puppet/manifests/cluster.pp
index 1313082..56b6fbf 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:

http://git-wip-us.apache.org/repos/asf/bigtop/blob/da1ccfda/bigtop-deploy/puppet/modules/ambari/manifests/init.pp
----------------------------------------------------------------------
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 0000000..839f73c
--- /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,
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/bigtop/blob/da1ccfda/bigtop-deploy/puppet/modules/ambari/templates/ambari-agent.ini
----------------------------------------------------------------------
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 0000000..e86c355
--- /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