abajwa-hw / ambari-nifi-service

Demo Ambari service to deploy/manage NiFi on HDP - Deprecated
75 stars 60 forks source link

pid file #7

Open oluies opened 8 years ago

oluies commented 8 years ago

I got this during a restart shoulnt the "pid" file be stored under "/var" ?

stderr: 
Traceback (most recent call last):
  File "/var/lib/ambari-agent/cache/stacks/HDP/2.4/services/NIFI/package/scripts/master.py", line 210, in <module>
    Master().execute()
  File "/usr/lib/python2.6/site-packages/resource_management/libraries/script/script.py", line 219, in execute
    method(env)
  File "/var/lib/ambari-agent/cache/stacks/HDP/2.4/services/NIFI/package/scripts/master.py", line 185, in start
    Execute('cat '+params.bin_dir+'/nifi.pid'+" | grep pid | sed 's/pid=\(\.*\)/\\1/' > " + status_params.nifi_pid_file)
  File "/usr/lib/python2.6/site-packages/resource_management/core/base.py", line 154, in __init__
    self.env.run()
  File "/usr/lib/python2.6/site-packages/resource_management/core/environment.py", line 158, in run
    self.run_action(resource, action)
  File "/usr/lib/python2.6/site-packages/resource_management/core/environment.py", line 121, in run_action
    provider_action()
  File "/usr/lib/python2.6/site-packages/resource_management/core/providers/system.py", line 238, in action_run
    tries=self.resource.tries, try_sleep=self.resource.try_sleep)
  File "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line 70, in inner
    result = function(command, **kwargs)
  File "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line 92, in checked_call
    tries=tries, try_sleep=try_sleep)
  File "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line 140, in _call_wrapper
    result = _call(command, **kwargs_copy)
  File "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line 291, in _call
    raise Fail(err_msg)
resource_management.core.exceptions.Fail: Execution of 'cat /opt/nifi-0.5.1.1.1.2.0-32/bin/nifi.pid | grep pid | sed 's/pid=\(\.*\)/\1/' > /var/run/nifi/nifi.pid' returned 1. /bin/bash: /var/run/nifi/nifi.pid: No such file or directory
grep: write error: Broken pipe
 stdout:
2016-04-22 10:21:06,528 - The hadoop conf dir /usr/hdp/current/hadoop-client/conf exists, will call conf-select on it for version 2.4.0.0-169
2016-04-22 10:21:06,528 - Checking if need to create versioned conf dir /etc/hadoop/2.4.0.0-169/0
2016-04-22 10:21:06,528 - call['conf-select create-conf-dir --package hadoop --stack-version 2.4.0.0-169 --conf-version 0'] {'logoutput': False, 'sudo': True, 'quiet': False, 'stderr': -1}
2016-04-22 10:21:06,557 - call returned (1, '/etc/hadoop/2.4.0.0-169/0 exist already', '')
2016-04-22 10:21:06,557 - checked_call['conf-select set-conf-dir --package hadoop --stack-version 2.4.0.0-169 --conf-version 0'] {'logoutput': False, 'sudo': True, 'quiet': False}
2016-04-22 10:21:06,587 - checked_call returned (0, '/usr/hdp/2.4.0.0-169/hadoop/conf -> /etc/hadoop/2.4.0.0-169/0')
2016-04-22 10:21:06,587 - Ensuring that hadoop has the correct symlink structure
2016-04-22 10:21:06,588 - Using hadoop conf dir: /usr/hdp/current/hadoop-client/conf
2016-04-22 10:21:06,870 - The hadoop conf dir /usr/hdp/current/hadoop-client/conf exists, will call conf-select on it for version 2.4.0.0-169
2016-04-22 10:21:06,870 - Checking if need to create versioned conf dir /etc/hadoop/2.4.0.0-169/0
2016-04-22 10:21:06,870 - call['conf-select create-conf-dir --package hadoop --stack-version 2.4.0.0-169 --conf-version 0'] {'logoutput': False, 'sudo': True, 'quiet': False, 'stderr': -1}
2016-04-22 10:21:06,898 - call returned (1, '/etc/hadoop/2.4.0.0-169/0 exist already', '')
2016-04-22 10:21:06,899 - checked_call['conf-select set-conf-dir --package hadoop --stack-version 2.4.0.0-169 --conf-version 0'] {'logoutput': False, 'sudo': True, 'quiet': False}
2016-04-22 10:21:06,927 - checked_call returned (0, '/usr/hdp/2.4.0.0-169/hadoop/conf -> /etc/hadoop/2.4.0.0-169/0')
2016-04-22 10:21:06,927 - Ensuring that hadoop has the correct symlink structure
2016-04-22 10:21:06,927 - Using hadoop conf dir: /usr/hdp/current/hadoop-client/conf
2016-04-22 10:21:06,929 - Group['spark'] {}
2016-04-22 10:21:06,930 - Group['zeppelin'] {}
2016-04-22 10:21:06,930 - Group['hadoop'] {}
2016-04-22 10:21:06,930 - Group['nifi'] {}
2016-04-22 10:21:06,931 - Group['users'] {}
2016-04-22 10:21:06,931 - Group['knox'] {}
2016-04-22 10:21:06,931 - User['hive'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': [u'hadoop']}
2016-04-22 10:21:06,932 - User['storm'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': [u'hadoop']}
2016-04-22 10:21:06,932 - User['zookeeper'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': [u'hadoop']}
2016-04-22 10:21:06,933 - User['atlas'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': [u'hadoop']}
2016-04-22 10:21:06,934 - User['oozie'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': [u'users']}
2016-04-22 10:21:06,934 - User['ams'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': [u'hadoop']}
2016-04-22 10:21:06,935 - User['falcon'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': [u'users']}
2016-04-22 10:21:06,936 - User['tez'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': [u'users']}
2016-04-22 10:21:06,936 - User['zeppelin'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': [u'hadoop']}
2016-04-22 10:21:06,937 - User['nifi'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': [u'hadoop']}
2016-04-22 10:21:06,938 - User['accumulo'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': [u'hadoop']}
2016-04-22 10:21:06,938 - User['mahout'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': [u'hadoop']}
2016-04-22 10:21:06,939 - User['spark'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': [u'hadoop']}
2016-04-22 10:21:06,940 - User['ambari-qa'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': [u'users']}
2016-04-22 10:21:06,940 - User['flume'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': [u'hadoop']}
2016-04-22 10:21:06,941 - User['kafka'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': [u'hadoop']}
2016-04-22 10:21:06,941 - User['hdfs'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': [u'hadoop']}
2016-04-22 10:21:06,942 - User['sqoop'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': [u'hadoop']}
2016-04-22 10:21:06,943 - User['yarn'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': [u'hadoop']}
2016-04-22 10:21:06,943 - User['hbase'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': [u'hadoop']}
2016-04-22 10:21:06,944 - User['hcat'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': [u'hadoop']}
2016-04-22 10:21:06,945 - User['mapred'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': [u'hadoop']}
2016-04-22 10:21:06,945 - User['knox'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': [u'hadoop']}
2016-04-22 10:21:06,946 - File['/var/lib/ambari-agent/tmp/changeUid.sh'] {'content': StaticFile('changeToSecureUid.sh'), 'mode': 0555}
2016-04-22 10:21:06,947 - Execute['/var/lib/ambari-agent/tmp/changeUid.sh ambari-qa /tmp/hadoop-ambari-qa,/tmp/hsperfdata_ambari-qa,/home/ambari-qa,/tmp/ambari-qa,/tmp/sqoop-ambari-qa'] {'not_if': '(test $(id -u ambari-qa) -gt 1000) || (false)'}
2016-04-22 10:21:06,953 - Skipping Execute['/var/lib/ambari-agent/tmp/changeUid.sh ambari-qa /tmp/hadoop-ambari-qa,/tmp/hsperfdata_ambari-qa,/home/ambari-qa,/tmp/ambari-qa,/tmp/sqoop-ambari-qa'] due to not_if
2016-04-22 10:21:06,953 - Directory['/tmp/hbase-hbase'] {'owner': 'hbase', 'recursive': True, 'mode': 0775, 'cd_access': 'a'}
2016-04-22 10:21:06,954 - File['/var/lib/ambari-agent/tmp/changeUid.sh'] {'content': StaticFile('changeToSecureUid.sh'), 'mode': 0555}
2016-04-22 10:21:06,955 - Execute['/var/lib/ambari-agent/tmp/changeUid.sh hbase /home/hbase,/tmp/hbase,/usr/bin/hbase,/var/log/hbase,/tmp/hbase-hbase'] {'not_if': '(test $(id -u hbase) -gt 1000) || (false)'}
2016-04-22 10:21:06,960 - Skipping Execute['/var/lib/ambari-agent/tmp/changeUid.sh hbase /home/hbase,/tmp/hbase,/usr/bin/hbase,/var/log/hbase,/tmp/hbase-hbase'] due to not_if
2016-04-22 10:21:06,961 - Group['hdfs'] {}
2016-04-22 10:21:06,961 - User['hdfs'] {'fetch_nonlocal_groups': True, 'groups': [u'hadoop', u'hdfs']}
2016-04-22 10:21:06,962 - Directory['/etc/hadoop'] {'mode': 0755}
2016-04-22 10:21:06,979 - File['/usr/hdp/current/hadoop-client/conf/hadoop-env.sh'] {'content': InlineTemplate(...), 'owner': 'hdfs', 'group': 'hadoop'}
2016-04-22 10:21:06,979 - Directory['/var/lib/ambari-agent/tmp/hadoop_java_io_tmpdir'] {'owner': 'hdfs', 'group': 'hadoop', 'mode': 0777}
2016-04-22 10:21:06,996 - Execute[('setenforce', '0')] {'not_if': '(! which getenforce ) || (which getenforce && getenforce | grep -q Disabled)', 'sudo': True, 'only_if': 'test -f /selinux/enforce'}
2016-04-22 10:21:07,003 - Skipping Execute[('setenforce', '0')] due to not_if
2016-04-22 10:21:07,004 - Directory['/var/log/hadoop'] {'owner': 'root', 'mode': 0775, 'group': 'hadoop', 'recursive': True, 'cd_access': 'a'}
2016-04-22 10:21:07,006 - Directory['/var/run/hadoop'] {'owner': 'root', 'group': 'root', 'recursive': True, 'cd_access': 'a'}
2016-04-22 10:21:07,006 - Directory['/tmp/hadoop-hdfs'] {'owner': 'hdfs', 'recursive': True, 'cd_access': 'a'}
2016-04-22 10:21:07,011 - File['/usr/hdp/current/hadoop-client/conf/commons-logging.properties'] {'content': Template('commons-logging.properties.j2'), 'owner': 'hdfs'}
2016-04-22 10:21:07,013 - File['/usr/hdp/current/hadoop-client/conf/health_check'] {'content': Template('health_check.j2'), 'owner': 'hdfs'}
2016-04-22 10:21:07,014 - File['/usr/hdp/current/hadoop-client/conf/log4j.properties'] {'content': ..., 'owner': 'hdfs', 'group': 'hadoop', 'mode': 0644}
2016-04-22 10:21:07,026 - File['/usr/hdp/current/hadoop-client/conf/hadoop-metrics2.properties'] {'content': Template('hadoop-metrics2.properties.j2'), 'owner': 'hdfs'}
2016-04-22 10:21:07,027 - File['/usr/hdp/current/hadoop-client/conf/task-log4j.properties'] {'content': StaticFile('task-log4j.properties'), 'mode': 0755}
2016-04-22 10:21:07,032 - File['/etc/hadoop/conf/topology_mappings.data'] {'owner': 'hdfs', 'content': Template('topology_mappings.data.j2'), 'only_if': 'test -d /etc/hadoop/conf', 'group': 'hadoop'}
2016-04-22 10:21:07,036 - File['/etc/hadoop/conf/topology_script.py'] {'content': StaticFile('topology_script.py'), 'only_if': 'test -d /etc/hadoop/conf', 'mode': 0755}
2016-04-22 10:21:07,338 - File['/opt/nifi-0.5.1.1.1.2.0-32/conf/nifi.properties'] {'owner': 'nifi', 'content': InlineTemplate(...), 'group': 'nifi'}
2016-04-22 10:21:07,343 - File['/opt/nifi-0.5.1.1.1.2.0-32/conf/bootstrap.conf'] {'owner': 'nifi', 'content': InlineTemplate(...), 'group': 'nifi'}
2016-04-22 10:21:07,348 - File['/opt/nifi-0.5.1.1.1.2.0-32/conf/logback.xml'] {'owner': 'nifi', 'content': InlineTemplate(...), 'group': 'nifi'}
2016-04-22 10:21:07,349 - Execute['echo pid file /var/run/nifi/nifi.pid'] {}
2016-04-22 10:21:07,352 - Execute['echo JAVA_HOME=/usr/jdk64/jdk1.8.0_60'] {}
2016-04-22 10:21:07,356 - Execute['export JAVA_HOME=/usr/jdk64/jdk1.8.0_60;/opt/nifi-0.5.1.1.1.2.0-32/bin/nifi.sh start >> /var/log/nifi/nifi-setup.log'] {'user': 'nifi'}
2016-04-22 10:21:12,364 - Execute['cat /opt/nifi-0.5.1.1.1.2.0-32/bin/nifi.pid | grep pid | sed 's/pid=\(\.*\)/\1/' > /var/run/nifi/nifi.pid'] {}
oluies commented 8 years ago

workaround

$ sudo mkdir /var/run/nifi/ $ sudo chown nifi:nifi /var/run/nifi/

abajwa-hw commented 8 years ago

Thats odd...the pid dir gets created fine for me. This is the code that creates the pid and log dirs: https://github.com/abajwa-hw/ambari-nifi-service/blob/master/package/scripts/master.py#L50-L54

Did your nifi log dir get created (under /var/log/nifi)?

oluies commented 8 years ago

This is after reboot

SKYPE: orjan_lundberg

CesarCapillas commented 7 years ago

Another walkaround:

$ sudo vim /usr/lib/tmpfiles.d/nifi.conf

d /var/run/nifi 0755 nifi nifi -

This creates nifi directory under /var/run after reboot. Then, no problems results when creating the pid file.

Regards. --C.