I have updated with above query and restated the ambari-server.

ambari=> UPDATE host_version SET state = 'CURRENT' WHERE repo_version_id =
2;
UPDATE 5

ambari=> select * from host_version;
 id | repo_version_id |   state   | host_id
----+-----------------+-----------+---------
  1 |               1 | INSTALLED |      1
  2 |               1 | INSTALLED |      2
  3 |               1 | INSTALLED |      3
 4  |               1 | INSTALLED |      4
 5  |               1 | INSTALLED |      5
 6 |               2 | CURRENT   |      6
7 |               2 | CURRENT   |      7
 8 |               2 | CURRENT   |      8
 9 |               2 | CURRENT   |      9
 10 |               2 | CURRENT   |      10


After restating Ambari server I have verified in *Stack & Versions* page.


Stack tab: I can able to see the all services with x.x.x.2.3 version.

*Versions *tab: still i can able to see two versions.

Please check attached screenshot.

Regards,
Shaik M

On 5 November 2015 at 07:24, Alejandro Fernandez <[email protected]
> wrote:

> UPDATE cluster_version SET state = 'CURRENT' WHERE repo_version_id = 2;
> UPDATE host_version SET state = 'CURRENT' WHERE repo_version_id = 2;
>
> From: Shaik M <[email protected]>
> Date: Wednesday, November 4, 2015 at 3:12 PM
> To: Alejandro Fernandez <[email protected]>
> Subject: Re: Ambari+HDP Upgrade: OUT_OF_SYNC is not allowed to transition
> directly into CURRENT
>
> Hi Fernandez,
>
> During upgrade I didn't try to add any services. And all host components
> are newer version 2.3.2.0-2950.
>
> ambari=> SELECT h.host_name, hcs.service_name, hcs.component_name,
> hcs.version FROM hostcomponentstate hcs JOIN hosts h ON hcs.host_id =
> h.host_id where hcs.version NOT IN ('2.3.2.0-2950', 'UNKNOWN');
>  host_name | service_name | component_name | version
> -----------+--------------+----------------+---------
> (0 rows)
>
> ambari=> SELECT repo_version_id, version, display_name FROM repo_version;
>  repo_version_id |   version    | display_name
> -----------------+--------------+---------------
>                1 | 2.2.4.2-2    | HDP-2.2.4.2-2
>                2 | 2.3.2.0-2950 | HDP-2.3.2.0
> (2 rows)
>
> ambari=> select * from host_version;
>  id | repo_version_id |  state   | host_id
> ----+-----------------+----------+---------
>   1 |               1 | CURRENT  |       5
>   7 |               2 | UPGRADED |       1
>   6 |               2 | UPGRADED |       5
>   2 |               1 | CURRENT  |       1
>   3 |               1 | CURRENT  |       2
>   4 |               1 | CURRENT  |       3
>   5 |               1 | CURRENT  |       4
>   8 |               2 | UPGRADED |       3
>   9 |               2 | UPGRADED |       4
>  10 |               2 | UPGRADED |       2
> (10 rows)
>
> ambari=> UPDATE host_version SET state = 'INSTALLED' WHERE state =
> 'CURRENT';
> UPDATE 20
> ambari=> UPDATE host_version SET state = 'CURRENT' WHERE repo_version_id =
> 2 and state = 'INSTALLED';
> UPDATE 0
>
> For above query nothing returning, because all host status is 'UPGRADED".
>
> Please suggest how can proceed further.
>
> Thanks,
> Shaik
>
> On 5 November 2015 at 00:26, Alejandro Fernandez <
> [email protected]> wrote:
>
>> Were there any attempts to add services or hosts to the cluster during
>> the middle of Rolling Upgrade?
>>
>> Sounds like you may have to force the version by editing the DB.
>>
>>
>> Stop ambari server
>>
>>
>> First, make sure all host components are on the newer version.
>>
>> If not, you may need to run hdp-select set all 2.3.2.0-2950
>> and restart services or refresh configs. You can use the /#/experimental
>> flag for opsDuringRollingUpgrade
>>
>>
>> -- This should be empty
>>
>> SELECT h.host_name, hcs.service_name, hcs.component_name, hcs.version
>> FROM hostcomponentstate hcs JOIN hosts h ON hcs.host_id = h.host_id where
>> hcs.version NOT IN ('2.3.2.0-2950', 'UNKNOWN');
>>
>> ​
>>
>> SELECT repo_version_id, version, display_name FROM repo_version;
>>
>>
>> UPDATE host_version SET state = 'INSTALLED' WHERE state = 'CURRENT';
>>
>> UPDATE host_version SET state = 'CURRENT' WHERE repo_version_id = <id for
>> 2.3.2.0 version> and state = 'INSTALLED';
>>
>>
>> UPDATE cluster_version SET state = 'INSTALLED' WHERE state = 'CURRENT';
>>
>> UPDATE cluster_version SET state = 'CURRENT' WHERE repo_version_id = <id
>> for 2.3.2.0 version> and state = 'INSTALLED';
>>
>>
>> UPDATE hostcomponentstate set upgrade_state = 'NONE';
>>
>>
>> Start ambari server
>>
>>
>> Thanks,
>>
>> Alejandro
>>
>>
>> ------------------------------
>> *From:* Shaik M <[email protected]>
>> *Sent:* Tuesday, November 03, 2015 11:48 PM
>> *To:* [email protected]
>> *Subject:* Ambari+HDP Upgrade: OUT_OF_SYNC is not allowed to transition
>> directly into CURRENT
>>
>> Hi,
>>
>> I started upgrade for one of my environment from Amabri 1.7/ HDP 2.2 to
>> Ambari 2.1.2 & HDP 2.3.2.0-2950.
>>
>> During the upgrade everything went well without any issues. During last
>> step *Finalize Upgrade - Save Cluster State *getting below error.
>>
>> Stderr
>>
>> =======
>>
>> The cluster stack version state OUT_OF_SYNC is not allowed to transition 
>> directly into CURRENT
>>
>> I have verified upgrade status with Amabri API. All nodes are showing 
>> upgraded state. Output of the url attached.
>>
>> http://mst05.corp.com:8080/api/v1/clusters/PRODBDP/stack_versions/2
>>
>> Please help to resolve this issue.
>>
>> Thanks,
>> Shaik
>>
>
>

Reply via email to