scala初期化

5674 ワード

hive (default)> create database ecdata WITH DBPROPERTIES ('creator' = 'June', 'date' = '2014-06-01');
OK
Time taken: 0.089 seconds
hive (default)> show databases;                                                                      
OK
default
ecdata
hivedb
Time taken: 0.074 seconds, Fetched: 3 row(s)
hive (default)> DESCRIBE DATABASE ecdata;
OK
ecdata		hdfs://name01:9000/user/hive/warehouse/ecdata.db	
Time taken: 0.046 seconds, Fetched: 1 row(s)
hive (default)> DESCRIBE DATABASE extend ecdata;
FAILED: ParseException line 1:25 extraneous input 'ecdata' expecting EOF near ''
hive (default)> DESCRIBE DATABASE extended ecdata;
OK
ecdata		hdfs://name01:9000/user/hive/warehouse/ecdata.db	{date=2014-06-01, creator=June}
Time taken: 0.057 seconds, Fetched: 1 row(s)
hive (default)> use ecdata;
OK
Time taken: 0.033 seconds
hive (ecdata)>


  hive.metastore.uris
  
  Thrift uri for the remote metastore. Used by metastore client to connect to remote metastore.



  javax.jdo.option.ConnectionURL
  jdbc:derby:;databaseName=metastore_db;create=true
  JDBC connect string for a JDBC metastore



  javax.jdo.option.ConnectionDriverName
  org.apache.derby.jdbc.EmbeddedDriver
  Driver class name for a JDBC metastore



[root@name01 mnt]# ls -ltr
total 3
dr-xr-xr-x 1 root root 4192 Jun 10  2016 hgfs
[root@name01 mnt]# cd  hgfs/
[root@name01 hgfs]# ls -ltr
total 6
drwxrwxrwx 1 root root 12288 Nov 14  2015 bh_bigdata
drwxrwxrwx 1 root root     0 Mar 10 03:12 share
drwxrwxrwx 1 root root     0 Jun  9 17:00 hadoop_sty
[root@name01 hgfs]# pwd
/mnt/hgfs
[root@name01 hgfs]# 


echo $JAVA_HOME
echo $HADOOP_HOME
echo $SCALA_HOME
echo $SPARK_HOME

/usr/local/hadoop/etc/hadoop

[root@name01 home]# scala -version
bash: scala: command not found
[root@name01 home]# pwd
/home
[root@name01 home]# souce etc/profile
bash: souce: command not found
[root@name01 home]# source etc/profile
bash: etc/profile: No such file or directory
[root@name01 home]# source /etc/profile
[root@name01 home]# scala -version
Scala code runner version 2.9.3 -- Copyright 2002-2011, LAMP/EPFL
[root@name01 home]# 

[root@name01 share]# cd /mnt/
[root@name01 mnt]# ls -ltr
total 3
dr-xr-xr-x 1 root root 4192 Jun 10  2016 hgfs
[root@name01 mnt]# cd  hgfs/
[root@name01 hgfs]# ls -ltr
total 6
drwxrwxrwx 1 root root 12288 Nov 14  2015 bh_bigdata
drwxrwxrwx 1 root root     0 Mar 10 03:12 share
drwxrwxrwx 1 root root     0 Jun  9 17:00 hadoop_sty
[root@name01 hgfs]# pwd
/mnt/hgfs
[root@name01 hgfs]# cd hadoop_sty/
[root@name01 hadoop_sty]# ls
hive
[root@name01 hadoop_sty]# cd  hive/
[root@name01 hive]# ls -ltr
total 202532
-rwxrwxrwx 1 root root  27588352 Jan 19 17:53 Hive    pdf   .pdf
-rwxrwxrwx 1 root root  81288181 Jun  9 17:17 hive-0.12.0.tar.gz
-rwxrwxrwx 1 root root  24699008 Jun 10 08:22 scala-2.9.3.tgz
-rwxrwxrwx 1 root root  38288081 Jun 10 10:20 scala-sources-2.9.3.tgz
-rwxrwxrwx 1 root root 242920179 Jun 10 10:25 spark-1.4.0-bin-hadoop2.3.tgz
[root@name01 hive]# pwd
/mnt/hgfs/hadoop_sty/hive
[root@name01 hive]# cp s* /usr/local/spark
[root@name01 hive]# vi vi /etc/profile
2 files to edit
[root@name01 hive]# pwd
/mnt/hgfs/hadoop_sty/hive
[root@name01 hive]# cd /home/
[root@name01 home]# ls
hadoop

#
export SCALA_HOME=/usr/local/spark/scala-2.9.3
export PATH=.:$SCALA_HOME/bin:$PATH

export SPARK_HOME=/usr/local/spark/spark-1.4.0
export PATH=.:$SPARK_HOME/bin:$SPARK_HOME/sbin:$PATH




[root@name01 home]# sourse /etc/profile
bash: sourse: command not found
[root@name01 home]# source /etc/profile
[root@name01 home]# echo $JAVA_HOME
/usr/local/jdk
[root@name01 home]# echo $HADOOP_HOME
/usr/local/hadoop
[root@name01 home]# echo $SCALA_HOME
/usr/local/spark/scala-2.9.3
[root@name01 home]# echo $SPARK_HOME
/usr/local/spark/spark-1.4.0
[root@name01 home]# 
[root@name01 home]# 
[root@name01 home]# echo $JAVA_HOME
/usr/local/jdk
[root@name01 home]# echo $HADOOP_HOME
/usr/local/hadoop
[root@name01 home]# echo $SCALA_HOME
/usr/local/spark/scala-2.9.3
[root@name01 home]# echo $SPARK_HOME
/usr/local/spark/spark-1.4.0
[root@name01 home]# 
[root@name01 home]# other window  need 'source /etc/profile'
bash: other: command not found
[root@name01 home]# scala
Welcome to Scala version 2.9.3 (Java HotSpot(TM) Client VM, Java 1.8.0_20).
Type in expressions to have them evaluated.
Type :help for more information.

scala> [init] error: error while loading AnnotatedElement, class file '/usr/local/jdk/jre/lib/rt.jar(java/lang/reflect/AnnotatedElement.class)' is broken
(bad constant pool tag 18 at byte 76)

[1]+  Stopped                 scala
[root@name01 home]# scala
Welcome to Scala version 2.9.3 (Java HotSpot(TM) Client VM, Java 1.8.0_20).
Type in expressions to have them evaluated.
Type :help for more information.

scala> [init] error: error while loading AnnotatedElement, class file '/usr/local/jdk/jre/lib/rt.jar(java/lang/reflect/AnnotatedElement.class)' is broken
(bad constant pool tag 18 at byte 76)
5~*

scala> 

scala> 5*9

scala> 5*9
res1: Int = 45

scala> 5*9
res2: Int = 45

scala> 5*9
res3: Int = 45

scala> 5*9
res4: Int = 45

scala> exit;
warning: there were 1 deprecation warnings; re-run with -deprecation for details
[root@name01 home]# scala -version
Scala code runner version 2.9.3 -- Copyright 2002-2011, LAMP/EPFL
[root@name01 home]# pwd
/home
[root@name01 home]#