<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: cloudera manager database lost in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/cloudera-manager-database-lost/m-p/32538#M7365</link>
    <description>Please see &lt;A href="http://community.cloudera.com/t5/Cloudera-Manager-Installation/Moving-CM-Services-to-a-new-node/m-p/32476" target="_blank"&gt;http://community.cloudera.com/t5/Cloudera-Manager-Installation/Moving-CM-Services-to-a-new-node/m-p/32476&lt;/A&gt;</description>
    <pubDate>Thu, 01 Oct 2015 11:11:39 GMT</pubDate>
    <dc:creator>Harsh J</dc:creator>
    <dc:date>2015-10-01T11:11:39Z</dc:date>
    <item>
      <title>cloudera manager database lost</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/cloudera-manager-database-lost/m-p/31989#M7364</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; yesterday, I found my cloudera manager machine was format by my &lt;SPAN class="con"&gt;colleague&lt;/SPAN&gt;, I used cloudera manager manage two cluster for production use,&lt;/P&gt;&lt;P&gt;, and I did not back up my scm database before. I try to recover my scm database , I think I can restore&amp;nbsp; hosts,roles roles_config_groups table, however&lt;/P&gt;&lt;P&gt;&amp;nbsp;I found it's very hard to restore config table.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;so ,I have two questions:&lt;/P&gt;&lt;P&gt;1 is there any way to recovery my scm database,especially configs and client_configs table?&lt;/P&gt;&lt;P&gt;2 if I can not recovery my cloudera manager, how can I manager my cluster maually ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;any documentation will be helpful. please help, thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I use cdh manager 5.3.1 , and cdh 2.5.0 .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Sep 2022 09:41:18 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/cloudera-manager-database-lost/m-p/31989#M7364</guid>
      <dc:creator>dape</dc:creator>
      <dc:date>2022-09-16T09:41:18Z</dc:date>
    </item>
    <item>
      <title>Re: cloudera manager database lost</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/cloudera-manager-database-lost/m-p/32538#M7365</link>
      <description>Please see &lt;A href="http://community.cloudera.com/t5/Cloudera-Manager-Installation/Moving-CM-Services-to-a-new-node/m-p/32476" target="_blank"&gt;http://community.cloudera.com/t5/Cloudera-Manager-Installation/Moving-CM-Services-to-a-new-node/m-p/32476&lt;/A&gt;</description>
      <pubDate>Thu, 01 Oct 2015 11:11:39 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/cloudera-manager-database-lost/m-p/32538#M7365</guid>
      <dc:creator>Harsh J</dc:creator>
      <dc:date>2015-10-01T11:11:39Z</dc:date>
    </item>
    <item>
      <title>Re: cloudera manager database lost</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/cloudera-manager-database-lost/m-p/33410#M7366</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Finally, I get it done, so ,I post my steps&amp;nbsp; ,maybe it will be helpful for someone like me who happen to&amp;nbsp; have the same problem.&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I use cdh5.3.1,the main steps is : At first ,I recreate a new cdh manager, and reconfigure all parameters and roles in this new cdh manager, t&lt;BR /&gt;&lt;BR /&gt;hen add all process_id in processes table in scm db, and then modify /etc/cloudera-scm-agent/config.ini&amp;nbsp; server_host to this new manager&lt;BR /&gt;&lt;BR /&gt;and restart all agent .&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;At first, we should backup ,prepare for the worst.&lt;BR /&gt;&lt;BR /&gt;1 cdh provided two ways to backup,backup database or backup config to&amp;nbsp; a json file&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;1.1 backup database :&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;A href="http://www.cloudera.com/content/www/en-us/documentation/enterprise/5-2-x/topics/cm_ag_backup_dbs.html" target="_blank"&gt;http://www.cloudera.com/content/www/en-us/documentation/enterprise/5-2-x/topics/cm_ag_backup_dbs.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; for example:&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; backup :&lt;BR /&gt;&amp;nbsp;&amp;nbsp; pg_dump -h localhost -p 7432 -U scm -W -F c -b -v -f "scm_db.db" scm&lt;BR /&gt;&amp;nbsp;&amp;nbsp; restore:&lt;BR /&gt;&amp;nbsp;&amp;nbsp; pg_restore&amp;nbsp; -p 7432 -U scm -W -d scm -v scm_db.db&lt;BR /&gt;&amp;nbsp;1.2 write config to a json file&lt;BR /&gt;&amp;nbsp; &lt;A href="http://www.cloudera.com/content/www/en-us/documentation/enterprise/5-3-x/topics/cm_intro_api.html#xd_583c10bfdbd326ba--7f25092b-13fba2465e5--7f20" target="_blank"&gt;http://www.cloudera.com/content/www/en-us/documentation/enterprise/5-3-x/topics/cm_intro_api.html#xd_583c10bfdbd326ba--7f25092b-13fba2465e5--7f20&lt;/A&gt;&lt;BR /&gt;&amp;nbsp; for example:&lt;BR /&gt;&amp;nbsp;&amp;nbsp; export:&lt;BR /&gt;&amp;nbsp;&amp;nbsp; curl -u admin:admin "http://localhost:8888/api/v9/cm/deployment" &amp;gt; ~/cmf_config.json&lt;BR /&gt;&amp;nbsp;&amp;nbsp; import:&lt;BR /&gt;&amp;nbsp;&amp;nbsp; curl --upload-file ～/cmf_config.json -u admin:admin http://localhost:8888/api/v9/cm/deployment?deleteCurrentDeployment=true&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;If we did not backup and lost our database,well,it is hard to restore, however ,it can be done.&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;The following is my steps:&lt;BR /&gt;&amp;nbsp; 1 Reinstall a new cdh manager on another machine with different host name.&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp; 2 Export a json configuration file from another currently working cdh manager with same cdh manager version.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; This cdh manager should include all service(such as hdfs,yarn,hbase,hdfs HA ,etc).&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp; 3 Run a script on all machine to get hostid and hostname, the hostid is in a file:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /var/lib/cloudera-scm-agent/uuid&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp; 4 Modify the json file from step 2,do the following:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4.1 Delele all hosts in this json file and add all hosts's hostid and hostname from step 3.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4.2 Delete all roles in clusters's services.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4.3 Modify cluster name to old cluster id. you can get the old cluster id from hdfs namenode http webpage&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if you do not remember you old cluster id.&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp; 5 Import the new json file into the new create cdh manager.&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp; 6 Reconfigure all service's parameter and add all instance to service as before.(you should not use host&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; template cause the agent is not report this new cmf server,however, you can add instances from service ).&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp; 7 If you have hdfs HA enabled, you have to export json file and add hdfs ha roles in that file, and import to&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; it again.&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp; 8 If you do not want to stop all the services, you have to do the following steps to get all process_id from&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; all hosts, however ,if you can stop services, you can jump to step 11;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp; 9 Run the following script on all hosts to get process_id and services name.&lt;BR /&gt;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;grep "spawned:.*with pid" /var/log/cloudera-scm-agent/supervisord.log&amp;nbsp; |awk -vhost=$HOSTNAME '{ idx=index($5,"-"); name=substr($5,idx+1,length($5)-idx-1);pid=substr($5,2,idx-2);cc[name]=pid;}END{a=host;for (b in cc){ a=a"\t"b"\t"cc[b]} print a}'&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; 10&amp;nbsp; Parese that file and insert a record in scm database'&amp;nbsp; processes table , before we insert to processes table, you have to insert another record in commands&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; table to get a new command_id .( this step is hard).&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; 11 Modify all /etc/cloudera-scm-agent/config.ini&amp;nbsp; server_host to new cdh manager , kill cmf listener and restart all cmf agent.&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; Everything should be fine , the agent will report to new cdh server ,and the cdh server will return the same process_id to agent, so the running process&lt;/P&gt;&lt;P&gt;will not be killed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Oct 2015 08:14:53 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/cloudera-manager-database-lost/m-p/33410#M7366</guid>
      <dc:creator>dape</dc:creator>
      <dc:date>2015-10-26T08:14:53Z</dc:date>
    </item>
  </channel>
</rss>

