<?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: BDR using CM API in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/BDR-usinf-CM-API/m-p/49250#M48939</link>
    <description>&lt;P&gt;I've solved half of the question. I can start bdr jobs but haven't figured out how to stop them yet.&lt;/P&gt;&lt;P&gt;I'm using the cloudera api and curl to start the jobs via a bash script. I have a python script I'm developing for use in the future.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Like -&lt;/P&gt;&lt;P&gt;curl -X POST -u user:password \&lt;BR /&gt;'http://server:7180/api/v9/clusters/Cluster%201/services/hive/replications/jobnumber/run'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried using the hadoop and mapred commands to kill a job but this made the job lose it's mind and didn't kill it gracefully. This caused an error in the cloudera manager and I had to set null in the jobs log to get it to die.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Like -&lt;/P&gt;&lt;P&gt;hadoop job -kill "$mapred_jobid"&lt;/P&gt;</description>
    <pubDate>Tue, 10 Jan 2017 13:40:52 GMT</pubDate>
    <dc:creator>DanielWhite</dc:creator>
    <dc:date>2017-01-10T13:40:52Z</dc:date>
    <item>
      <title>BDR usinf CM API</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/BDR-usinf-CM-API/m-p/48565#M48936</link>
      <description>&lt;P&gt;I'm new to cloudera and am trying to automatically start and stop replication jobs. We're replicating from prod to our DR site.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can someone share examples of python or java code that shows how to call the cm api to start and stop replication jobs?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help is appreciated.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Dec 2016 14:01:50 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/BDR-usinf-CM-API/m-p/48565#M48936</guid>
      <dc:creator>DanielWhite</dc:creator>
      <dc:date>2016-12-15T14:01:50Z</dc:date>
    </item>
    <item>
      <title>Re: BDR using CM API</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/BDR-usinf-CM-API/m-p/49243#M48937</link>
      <description />
      <pubDate>Tue, 10 Jan 2017 13:12:09 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/BDR-usinf-CM-API/m-p/49243#M48937</guid>
      <dc:creator>DanielWhite</dc:creator>
      <dc:date>2017-01-10T13:12:09Z</dc:date>
    </item>
    <item>
      <title>Re: BDR using CM API</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/BDR-usinf-CM-API/m-p/49246#M48938</link>
      <description>&lt;P&gt;Thank you for marking your issue as solved&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/19932"&gt;@DanielWhite&lt;/a&gt;. Can you advise what the solution was?&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jan 2017 13:22:51 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/BDR-usinf-CM-API/m-p/49246#M48938</guid>
      <dc:creator>cjervis</dc:creator>
      <dc:date>2017-01-10T13:22:51Z</dc:date>
    </item>
    <item>
      <title>Re: BDR using CM API</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/BDR-usinf-CM-API/m-p/49250#M48939</link>
      <description>&lt;P&gt;I've solved half of the question. I can start bdr jobs but haven't figured out how to stop them yet.&lt;/P&gt;&lt;P&gt;I'm using the cloudera api and curl to start the jobs via a bash script. I have a python script I'm developing for use in the future.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Like -&lt;/P&gt;&lt;P&gt;curl -X POST -u user:password \&lt;BR /&gt;'http://server:7180/api/v9/clusters/Cluster%201/services/hive/replications/jobnumber/run'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried using the hadoop and mapred commands to kill a job but this made the job lose it's mind and didn't kill it gracefully. This caused an error in the cloudera manager and I had to set null in the jobs log to get it to die.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Like -&lt;/P&gt;&lt;P&gt;hadoop job -kill "$mapred_jobid"&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jan 2017 13:40:52 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/BDR-usinf-CM-API/m-p/49250#M48939</guid>
      <dc:creator>DanielWhite</dc:creator>
      <dc:date>2017-01-10T13:40:52Z</dc:date>
    </item>
    <item>
      <title>Re: BDR using CM API</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/BDR-usinf-CM-API/m-p/50240#M48940</link>
      <description>&lt;P&gt;I solved the stop bdr jobs. This is done with the command api. Once a bdr job is started it gets a unique command id. Its runs using this id rather then the job number that we see in CM. The following is how I'm stopping the jobs&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Firstly, get the command id by using the status api -&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;command_id=`curl -u admin:password "http://servername:7180/api/v9/clusters/C&lt;BR /&gt;luster%201/services/"$i"/replications" | grep -A 1 '"active" : true' | awk '{print $3}' | aw&lt;BR /&gt;k -F '/' '{print $4}' | sed '/^\s*$/d'`&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Second, stop the job using the command abort api -&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;curl -X POST -u admin:password \&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "http://servername:7180/api/v9/commands/"$command_id"/abort"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;</description>
      <pubDate>Wed, 01 Feb 2017 13:51:59 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/BDR-usinf-CM-API/m-p/50240#M48940</guid>
      <dc:creator>DanielWhite</dc:creator>
      <dc:date>2017-02-01T13:51:59Z</dc:date>
    </item>
    <item>
      <title>Re: BDR using CM API</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/BDR-usinf-CM-API/m-p/69237#M48941</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;i am trying in the same way but its not showing any replication schedules .&lt;BR /&gt;&lt;BR /&gt;hostname:/$ curl -su &amp;lt;user&amp;gt; https://hostname:7183/api/v1/clusters/cluster%20/services/hdfs/replications/&lt;BR /&gt;Enter host password for user 'user':&lt;BR /&gt;hostname:/$&lt;BR /&gt;&lt;BR /&gt;Please advise .&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jun 2018 10:09:13 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/BDR-usinf-CM-API/m-p/69237#M48941</guid>
      <dc:creator>sorabhj412</dc:creator>
      <dc:date>2018-06-20T10:09:13Z</dc:date>
    </item>
    <item>
      <title>Re: BDR using CM API</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/BDR-usinf-CM-API/m-p/69249#M48942</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/27663"&gt;@sorabhj412&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As described here, the "replications" api call is only available starting with API v11:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://cloudera.github.io/cm_api/apidocs/v19/path__clusters_-clusterName-_services_-serviceName-_replications.html" target="_blank"&gt;https://cloudera.github.io/cm_api/apidocs/v19/path__clusters_-clusterName-_services_-serviceName-_replications.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You should be able to get this to work if you change your URL to v11 or as high as your CM supports:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;https://hostname:7183/api/v11/clusters/cluster/services/hdfs/replications/&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To see what the max version of the API your Cloudera Manager supports, run:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;curl -su &amp;lt;user&amp;gt; https://hostname:7183/api/version&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NOTE: you also seem to have a space character after your "cluster" cluster name:&amp;nbsp; "clusters/cluster%20/"&amp;nbsp; I believe that may also cause you problems.&amp;nbsp; To see what cluster name you have, check with:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;curl -su &amp;lt;user&amp;gt; https://hostname:7183/api/v11/clusters&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jun 2018 16:42:39 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/BDR-usinf-CM-API/m-p/69249#M48942</guid>
      <dc:creator>bgooley</dc:creator>
      <dc:date>2018-06-20T16:42:39Z</dc:date>
    </item>
    <item>
      <title>Re: BDR using CM API</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/BDR-usinf-CM-API/m-p/69253#M48943</link>
      <description>&lt;P&gt;Try the following -&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;$i = hive or hdfs&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;curl -u username:password "http://hostname:7180/api/v13/clusters/Cluster%201/services/"$i"/replications"&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jun 2018 17:26:47 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/BDR-usinf-CM-API/m-p/69253#M48943</guid>
      <dc:creator>DanielWhite</dc:creator>
      <dc:date>2018-06-20T17:26:47Z</dc:date>
    </item>
    <item>
      <title>Re: BDR using CM API</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/BDR-usinf-CM-API/m-p/69270#M48944</link>
      <description>&lt;P&gt;Hi Daniel,&lt;/P&gt;&lt;P&gt;Thanks , I tried your suggestion and the commands looks working . but it’s not showing any output even after 60mins .&lt;/P&gt;&lt;P&gt;Below command just keep running .&lt;/P&gt;&lt;P&gt;I am looking for a way to get BDR Job history from command line . please help.&lt;/P&gt;&lt;P&gt;cloudera-scm@gbrpsr000004835 PROD $ curl -su &amp;lt;user&amp;gt; -X GET&amp;nbsp; 'https://&amp;lt;localhost&amp;gt;:7183/api/v15/clusters/Cluster%DR'/services/hdfs/replications&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jun 2018 05:26:58 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/BDR-usinf-CM-API/m-p/69270#M48944</guid>
      <dc:creator>sorabhj412</dc:creator>
      <dc:date>2018-06-21T05:26:58Z</dc:date>
    </item>
    <item>
      <title>Re: BDR using CM API</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/BDR-usinf-CM-API/m-p/291179#M48945</link>
      <description>&lt;P&gt;I've same the issue, but i got the BDR job history back after waited for 4 hours. The BDR job history file is very large. Is anyway to filter out only extract the job from yesterday?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Scott&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Mar 2020 14:55:42 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/BDR-usinf-CM-API/m-p/291179#M48945</guid>
      <dc:creator>scottwong</dc:creator>
      <dc:date>2020-03-05T14:55:42Z</dc:date>
    </item>
    <item>
      <title>Re: BDR using CM API</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/BDR-usinf-CM-API/m-p/291210#M48946</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/24444"&gt;@scottwong&lt;/a&gt;,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The thread you've posted your question to was marked 'Solved' quite a while ago and hasn't had any activity recently. You would have a better chance of receiving a satisfactory resolution by &lt;A href="https://community.cloudera.com/t5/forums/postpage/board-id/Questions" target="_blank" rel="noopener"&gt;posting a new question&lt;/A&gt;. This will also provide the opportunity to provide details specific to what you are attempting to do that could aid other community members in providing a more tailored answer to your issue.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Mar 2020 20:20:29 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/BDR-usinf-CM-API/m-p/291210#M48946</guid>
      <dc:creator>ask_bill_brooks</dc:creator>
      <dc:date>2020-03-05T20:20:29Z</dc:date>
    </item>
  </channel>
</rss>

