Skip to main content
cdfuser
Silver ⭐️
October 18, 2019
Solved

how to recover after master /user/bin was deleted?

Hi, guys

My master's /usr/bin was deleted, and i have copy other slave's /usr/bin to the master.

but when i type spark-shell, it occur this error:

spark-shell errorspark-shell error

but when i type /opt/cloudera/parcels/CDH/bin/spark-shell, it works fine.

Seems the commands in /user/bin directory should be soft link to/ opt/cloudera/parcels/CDH , is there any way to recover it?

 

thanks a lot.

CLDR
CLDRAnswer
Gold ⭐️
October 18, 2019

Hi ,

 

      I would suggest to do the following:-

 

           1. Login to slave's /usr/bin.

           2. Type the following command to check to which utility the spark-shell is linked.

                      ls -al spark*

                  It will print the following  depending on your configuration.

                     

lrwxrwxrwx 1 root root 29 Oct 18 01:03 spark-shell -> /etc/alternatives/spark-shell

lrwxrwxrwx 1 root root 30 Sep 30 03:11 spark-submit -> /etc/alternatives/spark-submit

lrwxrwxrwx 1 root root 30 Sep 30 03:11 spark2-shell -> /etc/alternatives/spark2-shell

lrwxrwxrwx 1 root root 31 Sep 30 03:11 spark2-submit -> /etc/alternatives/spark2-submit

 

        3. Login to master shell /usr/bin:

                    ln -s  /etc/alternatives/spark-shell spark-shell

              The above command will create a link to the executable. Change the path "/etc/alternatives/spark-shell" as per your slave's configuration

 

              Please remember to login as root user.

              Let me know if it works.

 

Thanks,

Ganesh

2 replies

CLDR
Gold ⭐️
CLDRAnswer
Gold ⭐️
October 18, 2019

Hi ,

 

      I would suggest to do the following:-

 

           1. Login to slave's /usr/bin.

           2. Type the following command to check to which utility the spark-shell is linked.

                      ls -al spark*

                  It will print the following  depending on your configuration.

                     

lrwxrwxrwx 1 root root 29 Oct 18 01:03 spark-shell -> /etc/alternatives/spark-shell

lrwxrwxrwx 1 root root 30 Sep 30 03:11 spark-submit -> /etc/alternatives/spark-submit

lrwxrwxrwx 1 root root 30 Sep 30 03:11 spark2-shell -> /etc/alternatives/spark2-shell

lrwxrwxrwx 1 root root 31 Sep 30 03:11 spark2-submit -> /etc/alternatives/spark2-submit

 

        3. Login to master shell /usr/bin:

                    ln -s  /etc/alternatives/spark-shell spark-shell

              The above command will create a link to the executable. Change the path "/etc/alternatives/spark-shell" as per your slave's configuration

 

              Please remember to login as root user.

              Let me know if it works.

 

Thanks,

Ganesh

Translate
cdfuser
cdfuserAuthor
Silver ⭐️
October 18, 2019

Thanks @CLDR 

Your solution works!

 

I have try the mehod:

1. tar the slave's /usr/bin which must contain the soft link.

2. copy tar.gz to the master,  and it works fine!

 

Thanks a lot!

Translate