hi, Jonathan

It’s likely to be the cause. The problem is all at importing ambari_commons 
package. 
I modified three source file(ranger_functions.py, ranger_functions_v2.py, 
script.py) in all agent to skip it.

Thanks, liren

> On Apr 2, 2016, at 9:58 PM, Jonathan Hurley <[email protected]> wrote:
> 
> You're probably running into 
> https://issues.apache.org/jira/browse/AMBARI-15617 
> <https://issues.apache.org/jira/browse/AMBARI-15617>
> 
> Check to make sure that /var/lib/ambari-agent/tmp does not have 
> "ambari_commons" as a directory/symlink inside of it. If it does, you should 
> remove it. It's probably adding an older version of the common library to 
> your python path.
> 
>> On Mar 30, 2016, at 9:43 PM, li liren <[email protected] 
>> <mailto:[email protected]>> wrote:
>> 
>> Hi, Alejandro
>> I use ambari-2.2.1
>> 
>> Thanks, liren
>> 
>> 
>> On Thu, Mar 31, 2016, 2:06 AM Alejandro Fernandez 
>> <[email protected] <mailto:[email protected]>> wrote:
>> Which version of Ambari are you on?
>> I suspect it's because you have to remove
>> from resource_management.libraries.functions import *
>> And then start importing modules by name.
>> Thanks,Alejandro
>> From: li liren <[email protected] <mailto:[email protected]>>
>> Reply-To: "[email protected] <mailto:[email protected]>" 
>> <[email protected] <mailto:[email protected]>>
>> Date: Wednesday, March 30, 2016 at 1:45 AM
>> To: "[email protected] <mailto:[email protected]>" 
>> <[email protected] <mailto:[email protected]>>
>> Subject: Failed on: Pre Upgrade HDFS when Rolling Upgrade from HDP-2.2.6.0 
>> to HDP-2.4.0.0
>> 
>> hi, all
>> I encount a problem when Rolling Upgrade from HDP-2.2.6.0 to HDP-2.4.0.0.
>> Failed on: Pre Upgrade HDFS Stage, the error like follows:
>> 2016-03-30 16:17:20,789 - Task. Type: EXECUTE, Script: scripts/namenode.py - 
>> Function: prepare_rolling_upgrade
>> Traceback (most recent call last):
>>   File 
>> "/var/lib/ambari-agent/cache/common-services/HDFS/2.1.0.2.0/package/scripts/namenode.py",
>>  line 28, in <module>
>>     from resource_management import Script
>>   File "/usr/lib/python2.6/site-packages/resource_management/__init__.py", 
>> line 23, in <module>
>>     from resource_management.libraries import *
>>   File 
>> "/usr/lib/python2.6/site-packages/resource_management/libraries/__init__.py",
>>  line 23, in <module>
>>     from resource_management.libraries.functions import *
>>   File 
>> "/usr/lib/python2.6/site-packages/resource_management/libraries/functions/__init__.py",
>>  line 25, in <module>
>>     from resource_management.libraries.functions.default import *
>>   File 
>> "/usr/lib/python2.6/site-packages/resource_management/libraries/functions/default.py",
>>  line 24, in <module>
>>     from resource_management.libraries.script import Script
>>   File 
>> "/usr/lib/python2.6/site-packages/resource_management/libraries/script/__init__.py",
>>  line 23, in <module>
>>     from resource_management.libraries.script.script import *
>>   File 
>> "/usr/lib/python2.6/site-packages/resource_management/libraries/script/script.py",
>>  line 32, in <module>
>>     from ambari_commons.constants import UPGRADE_TYPE_NON_ROLLING, 
>> UPGRADE_TYPE_ROLLING
>> ImportError: cannot import name UPGRADE_TYPE_NON_ROLLING
>> 
>> what should I do, or check something?
>> 
>> Best Regards.
>> 
>> 
>> 
> 

Reply via email to