sudo apt-get caiu durante a instalação do hbase

1

Eu tive problemas com a instalação do hbase e acabei em um buggy "sudo apt-get" agora. Está me dizendo que o JAVA_HOME não está definido enquanto está.

jalal@mona:~$ sudo apt-get -f install 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following extra packages will be installed:
hadoop-hbase
The following NEW packages will be installed:
hadoop-hbase
0 upgraded, 1 newly installed, 0 to remove and 18 not upgraded.
4 not fully installed or removed.
Need to get 0 B/30.6 MB of archives.
After this operation, 34.7 MB of additional disk space will be used.
Do you want to continue [Y/n]? y
Selecting previously unselected package hadoop-hbase.
(Reading database ... 264105 files and directories currently installed.)
Unpacking hadoop-hbase (from .../hadoop-hbase_0.90.6+84.89-1~maverick-    cdh3_all.deb) ...
Processing triggers for man-db ...
Setting up hadoop-hbase (0.90.6+84.89-1~maverick-cdh3) ...
Setting up hadoop-hbase-master (0.90.6+84.89-1~maverick-cdh3) ...
+======================================================================+
|      Error: JAVA_HOME is not set and Java could not be found         |
+----------------------------------------------------------------------+
| Please download the latest Sun JDK from the Sun Java web site        |
|       > http://java.sun.com/javase/downloads/ <                      |
|                                                                      |
| HBase requires Java 1.6 or later.                                    |
| NOTE: This script will find Sun Java whether you install using the   |
|       binary or the RPM based installer.                             |
+======================================================================+
invoke-rc.d: initscript hadoop-hbase-master, action "start" failed.
dpkg: error processing hadoop-hbase-master (--configure):
subprocess installed post-installation script returned error exit status 1
Setting up hadoop-hbase-regionserver (0.90.6+84.89-1~maverick-cdh3) ...
+======================================================================+
|      Error: JAVA_HOME is not set and Java could not be found         |
+----------------------------------------------------------------------+
| Please download the latest Sun JDK from the Sun Java web site        |
|       > http://java.sun.com/javase/downloads/ <                      |
|                                                                      |
| HBase requires Java 1.6 or later.                                    |
| NOTE: This script will find Sun Java whether you install using the   |
|       binary or the RPM based installer.                             |
+======================================================================+
invoke-rc.d: initscript hadoop-hbase-regionserver, action "start" failed.
dpkg: error processing hadoop-hbase-regionserver (--configure):
subprocess installed post-installation script returned error exit status 1
Setting up hadoop-hbase-rest (0.90.6+84.89-1~maverick-cdh3) ...
+======================================================================+
|      Error: JAVA_HOME is not set and Java could not be found         |
+----------------------------------------------------------------------+
| Please download the latest Sun JDK from the Sun Java web site        |
|       > http://java.sun.com/javase/downloads/ <                      |
|                                                                      |
| HBase requires Java 1.6 or later.                                    |
| NOTE: This script will find Sun Java whether you install using the   |
|       binary or the RPM based installer.                             |
+======================================================================+
invoke-rc.d: initscript hadoop-hbase-rest, action "start" failed.
dpkg: error processing hadoop-hbase-rest (--configure):
subprocess installed post-installation script returned error exit status 1
Setting up hadoop-hbase-thrift (0.90.6+84.89-1~maverick-cdh3) ...
+======================================================================+
|      Error: JAVA_HOME is not set and Java could not be found         |
+----------------------------------------------------------------------+
| Please download the latest Sun JDK from the Sun Java web site        |
|       > http://java.sun.com/javase/downloads/ <                      |
|                                                                      |
| HBase requires Java 1.6 or later.                                    |
| NOTE: This script will find Sun Java whether you install using the   |
|       binary or the RPM based installer.                             |
+======================================================================+
invoke-rc.d: initscript hadoop-hbase-thrift, action "start" failed.
dpkg: error processing hadoop-hbase-thrift (--configure):
subprocess installed post-installation script returned error exit status 1
No apport report written because MaxReports is reached already
Errors were encountered while processing:
hadoop-hbase-master
hadoop-hbase-regionserver
hadoop-hbase-rest
hadoop-hbase-thrift
E: Sub-process /usr/bin/dpkg returned an error code (1)

De acordo com

echo $(readlink -f /usr/bin/java | sed "s:bin/java::")

meu JAVA_HOME é

/usr/lib/jvm/java-6-openjdk-amd64/jre/

e aqui está ecoando:

jalal@mona:~$ echo $JAVA_HOME
/usr/lib/jvm/java-6-openjdk-amd64/jre/

Por favor, deixe-me saber como posso corrigir o sudo apt-get install e como é possível instalar o hbase usando sudo apt-get install ?

adicionando     %código% usando /usr/lib/jvm/java-6-openjdk-amd64/jre \ para:

for candidate in \  
   /usr/lib/jvm/java-6-sun \  
   /usr/lib/jvm/java-1.6.0-sun-1.6.0.*/jre \  
   /usr/lib/jvm/java-1.6.0-sun-1.6.0.* \  
   /usr/lib/j2sdk1.6-sun \  
   /usr/java/jdk1.6* \  
   /usr/java/jre1.6* \  
   /Library/Java/Home ; do  
if [ -e $candidate/bin/java ]; then  
    export JAVA_HOME=$candidate  
    break  
 fi  
done  

Parei de receber o erro sudo nano /usr/lib/hbase/bin/hbase-config.sh .

No entanto, agora eu tenho esse erro depois de JAVA_HOME not found :

pam_mount(spawn.c:128): error setting uid to 0  

Qualquer correção para o meu sudo apt-get install -f ?

    
por Mona Jalal 23.07.2013 / 03:09

1 resposta

0

Quando você usa o comando sudo , ele age como você fez su . A diferença é que sudo executa apenas um comando determinado e sai imediatamente. Mas todas as conseqüências da mudança de usuário estão presentes. Isso significa que, se você não configurou variáveis de ambiente para root user, elas estarão vazias. Você pode verificar isso em execução:

user@host:~$ su
Password:
root@host:/home/user$ echo $JAVA_HOME

root@host:/home/user$

Você pode configurar variáveis para root como você fez para user . Mas a maneira mais conveniente é configurá-los em /etc/environment file

$ cat /etc/environment
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"
JAVA_HOME="/usr/lib/jvm/default-java"
_JAVA_OPTIONS="-Dawt.useSystemAAFontSettings=on -Dswing.aatext=true"
    
por Danatela 23.07.2013 / 04:16