FAQ
Hey Anthony,

Moving this to scm-users@ so you find your API answers. Restarting an
instance is certainly possible. The commands posted by Patai won't
work out of the box.

On Wed, Feb 6, 2013 at 7:37 PM, Anthony Acquanita
wrote:
I'll try it. I so totally regret using Cloudera Manager.



On Feb 5, 8:16 pm, Patai Sangbutsarakum wrote:
Hope this would help,

What I need to do is a rolling restart of every datanode. I need to> stop mapred,

bin/stop-mapred.sh
stop hdfs,
bin/stop-dfs.sh
start hdfs,
bin/start-dfs.sh

;;; I want to add my extra step here.
I always check if nn leaves safemode before i start map-red
bin/hadoop dfsadmin -safemode get
until it said 'Safemode is OFF' then i preceed.
start mapred
bin/start-mapred.sh

On Tue, Feb 5, 2013 at 2:59 PM, Anthony Acquanita







wrote:
What I need to do is a rolling restart of every datanode. I need to
stop mapred, stop hdfs, start hdfs, start mapred. I've added 8 drives
to each server, updated and pushed the config via Cloudera Manager.
I'm not sitting at the UI and pressing buttons for two days and I
can't find anything that restarts just one instances roles via API.
** From what I gleaned from a few months usage of Cloudera Manager is
that /etc/init.d/hadoop-* does not work right. The config files are
in /var/run/cloudera-scm-agent and are different than the /etc/hadoop
one.
--
--



--
Harsh J

Search Discussions

  • Philip Zeyliger at Feb 6, 2013 at 5:08 pm
    Hi Anthony,

    Sorry to hear that you're having trouble with CM.

    In CM 4.5 (there's a beta available now), we have a new rolling upgrade
    functionality which very carefully restarts roles one by one.

    In the meanwhile, restarting roles with the API isn't too bad: use
    http://cloudera.github.com/cm_api/apidocs/v2/path__clusters_-clusterName-_services_-serviceName-_roleCommands_restart.html
    and
    specify the rolename. Here's how to do it manually in curl:

    $curl -vv -X POST -u user:pass -H "Content-Type:application/json" -d'{
    "items": ["hdfs1-DATANODE-e10807898f873ff955f01f5644f33408"] }' '
    http://cmhost.testing.cloudera.com:7180/api/v2/clusters/Cluster%201%20-%20CDH4/services/hdfs1/roleCommands/restart
    '
    * About to connect() to theseus01.sf.cloudera.com port 7180 (#0)
    * Trying 172.29.122.19... connected
    * Connected to theseus01.sf.cloudera.com (172.29.122.19) port 7180 (#0)
    * Server auth using Basic with user 'admin'
    POST
    /api/v2/clusters/Cluster%201%20-%20CDH4/services/hdfs1/roleCommands/restart
    HTTP/1.1
    Authorization: Basic xxxxx=
    User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/
    3.13.1.0 zlib/1.2.3 libidn/1.18 libssh2/1.2.2
    Host: xxx.cloudera.com:7180
    Accept: */*
    Content-Type:application/json
    Content-Length: 64
    < HTTP/1.1 200 OK
    < Expires: Thu, 01-Jan-1970 00:00:00 GMT
    < Set-Cookie: CLOUDERA_MANAGER_SESSIONID=xxx;Path=/
    < Content-Type: application/json; charset=UTF-8
    < Date: Wed, 06 Feb 2013 17:04:11 GMT
    < Content-Length: 416
    < Server: Jetty(6.1.26.cloudera.2)
    <
    {
    "errors" : [ ],
    "items" : [ {
    "id" : 523,
    "name" : "Restart",
    "startTime" : "2013-02-06T17:04:11.042Z",
    "active" : true,
    "serviceRef" : {
    "clusterName" : "Cluster 1 - CDH4",
    "serviceName" : "hdfs1"
    },
    "roleRef" : {
    "clusterName" : "Cluster 1 - CDH4",
    "serviceName" : "hdfs1",
    "roleName" : "hdfs1-DATANODE-e10807898f873ff955f01f5644f33408"
    }
    } ]

    You can also use the shell from https://github.com/cloudera/cm_api:

    [0]p0427:\:python(23553)$../env/bin/cmps -H xxx.cloudera.com
    Enter Username: xxx
    Enter Password:
    Welcome to the Cloudera Manager Console
    Select a cluster using 'show clusters' and 'use'
    cloudera> show clusters
    +------------------+
    CLUSTER NAME |
    +------------------+
    Cluster 1 - CDH4 |
    +------------------+
    cloudera> use Cluster 1 - CDH4
    Connected to Cluster 1 - CDH4
    Cluster 1 - CDH4> roles hdfs1
    +-------------------+------------------------+----------------------------------------------------------+----------+--------+------------+
    ROLE TYPE | HOST | ROLE NAME
    STATE | HEALTH | CONFIG |
    +-------------------+------------------------+----------------------------------------------------------+----------+--------+------------+
    DATANODE | x1.cloudera.com |
    hdfs1-DATANODE-e10807898f873ff955f01f5644f33408 | STARTING | GOOD
    UP TO DATE |
    DATANODE | x2.cloudera.com |
    hdfs1-DATANODE-ad93a6051476cbca09ab677eabcae968 | STARTED | GOOD
    UP TO DATE |
    DATANODE | x3.cloudera.com |
    hdfs1-DATANODE-d5ca9be7ca9e0513e90c20ee6c4642ba | STARTED | GOOD
    UP TO DATE |
    DATANODE | x4.cloudera.com |
    hdfs1-DATANODE-00818bbf220ac7535920723084cfc004 | STARTED | GOOD
    UP TO DATE |
    DATANODE | x5.cloudera.com |
    hdfs1-DATANODE-4a822775c3e00b72cab549fe531e1405 | STARTED | GOOD
    UP TO DATE |
    DATANODE | x6.cloudera.com |
    hdfs1-DATANODE-844d5ddf2638e8a61dacee64c8e0c24e | STARTED | GOOD
    UP TO DATE |
    DATANODE | x7.cloudera.com |
    hdfs1-DATANODE-0af0f6ed76576d2ebee97943afdd0111 | STARTED | BAD
    UP TO DATE |
    NAMENODE | x8.cloudera.com |
    hdfs1-NAMENODE-e10807898f873ff955f01f5644f33408 | STARTED | GOOD
    UP TO DATE |
    SECONDARYNAMENODE | p0428.mtv.cloudera.com |
    hdfs1-SECONDARYNAMENODE-e10807898f873ff955f01f5644f33408 | STARTED | GOOD
    UP TO DATE |
    +-------------------+------------------------+----------------------------------------------------------+----------+--------+------------+
    Cluster 1 - CDH4> restart_role
    hdfs1-DATANODE-e10807898f873ff955f01f5644f33408
    Restarting Role

    Hope this helps,

    -- Philip




    On Wed, Feb 6, 2013 at 8:14 AM, Harsh J wrote:

    Hey Anthony,

    Moving this to scm-users@ so you find your API answers. Restarting an
    instance is certainly possible. The commands posted by Patai won't
    work out of the box.

    On Wed, Feb 6, 2013 at 7:37 PM, Anthony Acquanita
    wrote:
    I'll try it. I so totally regret using Cloudera Manager.




    On Feb 5, 8:16 pm, Patai Sangbutsarakum <silvianhad...@gmail.com>
    wrote:
    Hope this would help,

    What I need to do is a rolling restart of every datanode. I need to>
    stop mapred,
    bin/stop-mapred.sh
    stop hdfs,
    bin/stop-dfs.sh
    start hdfs,
    bin/start-dfs.sh

    ;;; I want to add my extra step here.
    I always check if nn leaves safemode before i start map-red
    bin/hadoop dfsadmin -safemode get
    until it said 'Safemode is OFF' then i preceed.
    start mapred
    bin/start-mapred.sh

    On Tue, Feb 5, 2013 at 2:59 PM, Anthony Acquanita







    wrote:
    What I need to do is a rolling restart of every datanode. I need to
    stop mapred, stop hdfs, start hdfs, start mapred. I've added 8 drives
    to each server, updated and pushed the config via Cloudera Manager.
    I'm not sitting at the UI and pressing buttons for two days and I
    can't find anything that restarts just one instances roles via API.
    ** From what I gleaned from a few months usage of Cloudera Manager is
    that /etc/init.d/hadoop-* does not work right. The config files are
    in /var/run/cloudera-scm-agent and are different than the /etc/hadoop
    one.
    --
    --



    --
    Harsh J
  • Philip Zeyliger at Feb 6, 2013 at 5:23 pm
    Hi Anthony,

    Yes, the configs in /var/run/cloudera-scm-agent/process/* are the ones that
    the daemons use, and the ones in /etc/hadoop/conf are client configuration
    files. The right way to do restarts is via the API (the client and the
    curl command are doing exactly the same thing under the covers) or the UI.

    CM tries to solve a common problem we saw with Hadoop configurations: that
    of configs getting out of date. That's ultimately why we have the
    configs squirreled away in a place that's obviously "private": we wanted to
    separate client and server configs, and be able to always send the entire
    configs when a process is being started or stopped.

    Cheers,

    -- Philip
    On Wed, Feb 6, 2013 at 9:15 AM, Anthony Acquanita wrote:

    Sweet this is what I need...restart_role
    hdfs1-DATANODE-e10807898f873ff955f01f5644f33408

    Can you confirm that the way CM deploys the config that it's really the
    only way to restart the services ( API via curl, API via cli client or CM
    gui ) and that the /etc/hadoop/xx_configfiles_xx are just client config
    files?

    Thanks.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupscm-users @
categorieshadoop
postedFeb 6, '13 at 4:14p
activeFeb 6, '13 at 5:23p
posts3
users2
websitecloudera.com
irc#hadoop

2 users in discussion

Philip Zeyliger: 2 posts Harsh J: 1 post

People

Translate

site design / logo © 2022 Grokbase