|
@@ -18,28 +18,43 @@
|
|
|
# under the License.
|
|
|
#
|
|
|
#
|
|
|
-class hdp-hbase::hbase::service_check()
|
|
|
+class hdp-hbase::hbase::service_check()
|
|
|
{
|
|
|
$smoke_test_user = $hdp::params::smokeuser
|
|
|
|
|
|
$output_file = "/apps/hbase/data/ambarismoketest"
|
|
|
$conf_dir = $hdp::params::hbase_conf_dir
|
|
|
|
|
|
- $test_cmd = "fs -test -e ${output_file}"
|
|
|
-
|
|
|
+ $test_cmd = "fs -test -e ${output_file}"
|
|
|
+ $serviceCheckData = hdp_unique_id_and_date()
|
|
|
+
|
|
|
anchor { 'hdp-hbase::hbase::service_check::begin':}
|
|
|
|
|
|
- file { '/tmp/hbaseSmoke.sh':
|
|
|
+ $hbase_servicecheck_file = '/tmp/hbase-smoke.sh'
|
|
|
+
|
|
|
+ file { '/tmp/hbaseSmokeVerify.sh':
|
|
|
ensure => present,
|
|
|
- source => "puppet:///modules/hdp-hbase/hbaseSmoke.sh",
|
|
|
+ source => "puppet:///modules/hdp-hbase/hbaseSmokeVerify.sh",
|
|
|
mode => '0755',
|
|
|
}
|
|
|
|
|
|
- exec { '/tmp/hbaseSmoke.sh':
|
|
|
- command => "su - ${smoke_test_user} -c 'hbase --config $conf_dir shell /tmp/hbaseSmoke.sh'",
|
|
|
+ file { $hbase_servicecheck_file:
|
|
|
+ mode => '0755',
|
|
|
+ content => template('hdp-hbase/hbase-smoke.sh.erb'),
|
|
|
+ }
|
|
|
+
|
|
|
+ exec { $hbase_servicecheck_file:
|
|
|
+ command => "su - ${smoke_test_user} -c 'hbase --config $conf_dir shell $hbase_servicecheck_file'",
|
|
|
+ tries => 3,
|
|
|
+ try_sleep => 5,
|
|
|
+ path => '/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin',
|
|
|
+ logoutput => "true"
|
|
|
+ }
|
|
|
+
|
|
|
+ exec { '/tmp/hbaseSmokeVerify.sh':
|
|
|
+ command => "su - ${smoke_test_user} -c '/tmp/hbaseSmokeVerify.sh $conf_dir ${serviceCheckData}'",
|
|
|
tries => 3,
|
|
|
try_sleep => 5,
|
|
|
- require => File['/tmp/hbaseSmoke.sh'],
|
|
|
path => '/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin',
|
|
|
notify => Hdp-hadoop::Exec-hadoop['hbase::service_check::test'],
|
|
|
logoutput => "true"
|
|
@@ -48,9 +63,13 @@ class hdp-hbase::hbase::service_check()
|
|
|
hdp-hadoop::exec-hadoop { 'hbase::service_check::test':
|
|
|
command => $test_cmd,
|
|
|
refreshonly => true,
|
|
|
- require => Exec['/tmp/hbaseSmoke.sh'],
|
|
|
+ require => Exec['/tmp/hbaseSmokeVerify.sh'],
|
|
|
before => Anchor['hdp-hbase::hbase::service_check::end'] #TODO: remove after testing
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
+ Anchor['hdp-hbase::hbase::service_check::begin'] -> File['/tmp/hbaseSmokeVerify.sh']
|
|
|
+ File[$hbase_servicecheck_file] -> Exec[$hbase_servicecheck_file] -> Exec['/tmp/hbaseSmokeVerify.sh']
|
|
|
+ -> Anchor['hdp-hbase::hbase::service_check::end']
|
|
|
+
|
|
|
anchor{ 'hdp-hbase::hbase::service_check::end':}
|
|
|
-}
|
|
|
+}
|