Ver Fonte

AMBARI-4842. Update falcon install scripts to recent changes (Eugene Chekanskiy via dlysnichenko)

Lisnichenko Dmitro há 11 anos atrás
pai
commit
01b4d27f2d

+ 2 - 2
ambari-server/src/main/resources/stacks/HDP/2.0.6/services/NAGIOS/package/templates/hadoop-services.cfg.j2

@@ -658,7 +658,7 @@ define service {
 {% if hostgroup_defs['falcon-server'] %}
 define service {
         hostgroup_name          falcon-server
-        service_description     FALCON::Falcon Server status
+        service_description     FALCON::Falcon Server process
         servicegroups           FALCON
         check_command           check_tcp_wrapper!{{ falcon_port }}!-w 1 -c 1
         normal_check_interval   1
@@ -667,7 +667,7 @@ define service {
 }
 define service {
         hostgroup_name          falcon-server
-        service_description     FALCON::Falcon Web UI status
+        service_description     FALCON::Falcon Server Web UI
         servicegroups           FALCON
         check_command           check_webui!falconserver!{{ falcon_port }}
         normal_check_interval   1

+ 42 - 20
ambari-server/src/main/resources/stacks/HDP/2.1.1/services/FALCON/configuration/oozie-site.xml

@@ -18,18 +18,6 @@
 -->
 
 <configuration>
-  <property>
-    <name>oozie.service.ProxyUserService.proxyuser.falcon.hosts</name>
-    <value>*</value>
-    <description>Falcon proxyuser hosts</description>
-  </property>
-
-  <property>
-    <name>oozie.service.ProxyUserService.proxyuser.falcon.groups</name>
-    <value>*</value>
-    <description>Falcon proxyuser groups</description>
-  </property>
-
   <property>
     <name>oozie.service.ELService.ext.functions.coord-job-submit-instances</name>
     <value>
@@ -44,7 +32,11 @@
       latest=org.apache.oozie.coord.CoordELFunctions#ph2_coord_latest_echo,
       future=org.apache.oozie.coord.CoordELFunctions#ph2_coord_future_echo
     </value>
-    <description>Falcon</description>
+    <description>
+      EL functions declarations, separated by commas, format is [PREFIX:]NAME=CLASS#METHOD.
+      This property is a convenience property to add extensions to the built in executors without having to
+      include all the built in ones.
+    </description>
   </property>
 
   <property>
@@ -62,7 +54,11 @@
       formatTime=org.apache.oozie.coord.CoordELFunctions#ph2_coord_formatTime,
       user=org.apache.oozie.coord.CoordELFunctions#coord_user
     </value>
-    <description>Falcon</description>
+    <description>
+      EL functions declarations, separated by commas, format is [PREFIX:]NAME=CLASS#METHOD.
+      This property is a convenience property to add extensions to the built in executors without having to
+      include all the built in ones.
+    </description>
   </property>
 
   <property>
@@ -80,7 +76,11 @@
       formatTime=org.apache.oozie.coord.CoordELFunctions#ph2_coord_formatTime,
       user=org.apache.oozie.coord.CoordELFunctions#coord_user
     </value>
-    <description>Falcon</description>
+    <description>
+      EL functions declarations, separated by commas, format is [PREFIX:]NAME=CLASS#METHOD.
+      This property is a convenience property to add extensions to the built in executors without having to
+      include all the built in ones.
+    </description>
   </property>
 
   <property>
@@ -99,7 +99,11 @@
       dateOffset=org.apache.oozie.coord.CoordELFunctions#ph1_coord_dateOffset_echo,
       user=org.apache.oozie.coord.CoordELFunctions#coord_user
     </value>
-    <description>Falcon</description>
+    <description>
+      EL constant declarations, separated by commas, format is [PREFIX:]NAME=CLASS#CONSTANT.
+      This property is a convenience property to add extensions to the built in executors without having to
+      include all the built in ones.
+    </description>
   </property>
 
   <property>
@@ -120,7 +124,11 @@
       formatTime=org.apache.oozie.coord.CoordELFunctions#ph3_coord_formatTime,
       user=org.apache.oozie.coord.CoordELFunctions#coord_user
     </value>
-    <description>Falcon</description>
+    <description>
+      EL functions declarations, separated by commas, format is [PREFIX:]NAME=CLASS#METHOD.
+      This property is a convenience property to add extensions to the built in executors without having to
+      include all the built in ones.
+    </description>
   </property>
 
   <property>
@@ -129,7 +137,9 @@
       instanceTime=org.apache.oozie.coord.CoordELFunctions#ph1_coord_nominalTime_echo_fixed,
       user=org.apache.oozie.coord.CoordELFunctions#coord_user
     </value>
-    <description>Falcon</description>
+    <description>
+      EL functions declarations, separated by commas, format is [PREFIX:]NAME=CLASS#METHOD.
+    </description>
   </property>
 
   <property>
@@ -138,8 +148,20 @@
       instanceTime=org.apache.oozie.coord.CoordELFunctions#ph2_coord_nominalTime,
       user=org.apache.oozie.coord.CoordELFunctions#coord_user
     </value>
-    <description>Falcon</description>
+    <description>
+      EL functions declarations, separated by commas, format is [PREFIX:]NAME=CLASS#METHOD.
+    </description>
   </property>
+  <!--web ui should add following properties to oozie site accordingly to FALCON_USER-->
+  <!--<property>-->
+    <!--<name>oozie.service.ProxyUserService.proxyuser.#FALCON_USER#.hosts</name>-->
+    <!--<value>*</value>-->
+    <!--<description>Falcon proxyuser hosts</description>-->
+  <!--</property>-->
 
-
+  <!--<property>-->
+    <!--<name>oozie.service.ProxyUserService.proxyuser.#FALCON_USER#.groups</name>-->
+    <!--<value>*</value>-->
+    <!--<description>Falcon proxyuser groups</description>-->
+  <!--</property>-->
 </configuration>

+ 10 - 1
ambari-server/src/main/resources/stacks/HDP/2.1.1/services/FALCON/package/scripts/falcon.py

@@ -27,6 +27,9 @@ def falcon(type, action = None):
   Directory(params.falcon_log_dir,
             owner=params.falcon_user
   )
+  Directory(params.falcon_webapp_dir,
+            owner=params.falcon_user
+  )
   if type == 'client':
     if action == 'config':
       File(params.falcon_conf_dir + '/client.properties',
@@ -36,10 +39,16 @@ def falcon(type, action = None):
     if action == 'config':
       if params.store_uri[0:4] == "hdfs":
         params.HdfsDirectory(params.store_uri,
-                             action="create",
+                             action="create_delayed",
                              owner=params.falcon_user,
                              mode=0755
         )
+      params.HdfsDirectory(params.flacon_apps_dir,
+                           action="create_delayed",
+                           owner=params.falcon_user,
+                           mode=0777#TODO change to proper mode
+      )
+      params.HdfsDirectory(None, action="create")
       Directory(params.falcon_local_dir,
                 owner=params.falcon_user,
                 recursive=True

+ 2 - 1
ambari-server/src/main/resources/stacks/HDP/2.1.1/services/FALCON/package/scripts/params.py

@@ -43,7 +43,8 @@ falcon_runtime_properties = config['configurations']['falcon-runtime.properties'
 falcon_startup_properties = config['configurations']['falcon-startup.properties']
 http_keytab = falcon_startup_properties['*.falcon.http.authentication.kerberos.keytab']
 http_principal = falcon_startup_properties['*.falcon.http.authentication.kerberos.principal']
-
+falcon_webapp_dir = '/var/lib/falcon/webapp'
+flacon_apps_dir = '/apps/falcon'
 #for create_hdfs_directory
 _authentication = config['configurations']['core-site']['hadoop.security.authentication']
 security_enabled = ( not is_empty(_authentication) and _authentication == 'kerberos')

+ 3 - 0
ambari-server/src/test/python/stacks/2.1.1/FALCON/test_falcon_client.py

@@ -34,6 +34,9 @@ class TestFalconClient(RMFTestCase):
     self.assertResourceCalled('Directory', '/var/log/falcon',
                               owner = 'falcon',
                               )
+    self.assertResourceCalled('Directory', '/var/lib/falcon/webapp',
+                              owner = 'falcon',
+                              )
     self.assertResourceCalled('File', '/etc/falcon/conf/client.properties',
                               content=Template('client.properties.j2'),
                               mode=0644, )

+ 28 - 1
ambari-server/src/test/python/stacks/2.1.1/FALCON/test_falcon_server.py

@@ -36,6 +36,9 @@ class TestFalconServer(RMFTestCase):
     self.assertResourceCalled('Directory', '/var/log/falcon',
                               owner = 'falcon',
                               )
+    self.assertResourceCalled('Directory', '/var/lib/falcon/webapp',
+                              owner = 'falcon',
+                              )
     self.assertResourceCalled('Execute',
                               'env JAVA_HOME=/usr/jdk64/jdk1.7.0_45 FALCON_LOG_DIR=/var/log/falcon FALCON_PID_DIR=/var/run/falcon FALCON_DATA_DIR=/hadoop/falcon/activemq /usr/lib/falcon/bin/falcon-start -port 15000',
                               user='falcon', )
@@ -53,6 +56,9 @@ class TestFalconServer(RMFTestCase):
     self.assertResourceCalled('Directory', '/var/log/falcon',
                               owner = 'falcon',
                               )
+    self.assertResourceCalled('Directory', '/var/lib/falcon/webapp',
+                              owner = 'falcon',
+                              )
     self.assertResourceCalled('Execute',
                           'env JAVA_HOME=/usr/jdk64/jdk1.7.0_45 FALCON_LOG_DIR=/var/log/falcon FALCON_PID_DIR=/var/run/falcon FALCON_DATA_DIR=/hadoop/falcon/activemq /usr/lib/falcon/bin/falcon-stop',
                           user='falcon', )
@@ -77,9 +83,30 @@ class TestFalconServer(RMFTestCase):
     self.assertResourceCalled('Directory', '/var/log/falcon',
                               owner = 'falcon',
                               )
+    self.assertResourceCalled('Directory', '/var/lib/falcon/webapp',
+                              owner = 'falcon',
+                              )
+    self.assertResourceCalled('HdfsDirectory', '/apps/falcon',
+                              action=['create_delayed'],
+                              conf_dir='/etc/hadoop/conf',
+                              hdfs_user='hdfs',
+                              keytab=UnknownConfigurationMock(),
+                              kinit_path_local='/usr/bin/kinit',
+                              mode=0777,
+                              owner='falcon',
+                              security_enabled=False
+                              )
+    self.assertResourceCalled('HdfsDirectory', None,
+                              action=['create'],
+                              conf_dir='/etc/hadoop/conf',
+                              hdfs_user='hdfs',
+                              keytab=UnknownConfigurationMock(),
+                              kinit_path_local='/usr/bin/kinit',
+                              security_enabled=False
+                              )
     self.assertResourceCalled('Directory', '/hadoop/falcon',
                               owner = 'falcon',
-                              recursive = True,
+                              recursive = True
                               )
     self.assertResourceCalled('Directory', '/hadoop/falcon/activemq',
                               owner = 'falcon',