我在Ubuntu 16.04上运行Hadoop 2.7.3,MySQL 5.7.17和Hive 2.1.1.
当我运行./hive时,我不断收到以下警告和异常:
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/server/hive/lib/log4j-slf4j-impl-2.4.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/server/hadoop/share/hadoop/common/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
Logging initialized using configuration in jar:file:/home/server/hive/lib/hive-common-2.1.1.jar!/hive-log4j2.properties Async: true
Mon Feb 13 12:01:41 EST 2017 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't …Run Code Online (Sandbox Code Playgroud) 我在Ubuntu 16.04上运行Spark 2.1.0,Hive 2.1.1和Hadoop 2.7.3.
我从github下载Spark项目并构建"without hadoop"版本:
./dev/make-distribution.sh --name"hadoop2-without-hive"--tgz"-Pyarn,hadoop-provided,hadoop-2.7,parquet-provided"
当我运行时./sbin/start-master.sh,我得到以下异常:
Spark Command: /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java -cp /home/server/spark/conf/:/home/server/spark/jars/*:/home/server/hadoop/etc/hadoop/:/home/server/hadoop/share/hadoop/common/lib/:/home/server/hadoop/share/hadoop/common/:/home/server/hadoop/share/hadoop/mapreduce/:/home/server/hadoop/share/hadoop/mapreduce/lib/:/home/server/hadoop/share/hadoop/yarn/:/home/server/hadoop/share/hadoop/yarn/lib/ -Xmx1g org.apache.spark.deploy.master.Master --host ThinkPad-W550s-Lab --port 7077 --webui-port 8080
========================================
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/Logger
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
at java.lang.Class.getMethod0(Class.java:3018)
at java.lang.Class.getMethod(Class.java:1784)
at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526)
Caused by: java.lang.ClassNotFoundException: org.slf4j.Logger
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 7 more
Run Code Online (Sandbox Code Playgroud)
我根据hadoop 2中的hadoop jar文件的位置编辑SPARK_DIST_CLASSPATH …
我正在使用Spring Boot来构建RESTful Web服务.我的IDE是Eclipse Oxygen.
我送多在HTTP GET请求每2秒通过Chrome浏览器,但它们引发一个接一个.每个请求都将等待上一个请求完成.
这是我的控制器代码:
@RestController
@RequestMapping("/dummy")
public class DummyController {
@RequestMapping(method = RequestMethod.GET)
public ResponseEntity<Map<String, String>> dummytsp(@RequestParam(value="msg", defaultValue="Hello") String msg) {
System.out.println("" + new Date() + ": ThreadId " + Thread.currentThread().getId());
try {
Thread.sleep(5000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Map<String, String> response = new HashMap<>();
response.put("message", msg);
return new ResponseEntity<>(response, HttpStatus.OK);
}
}
Run Code Online (Sandbox Code Playgroud)
我的控制台输出是:
Thu Sep 14 11:31:15 EDT 2017: …Run Code Online (Sandbox Code Playgroud) 我在Ubuntu 16.04上运行hive 2.1.1,hadoop 2.7.3.
ps aux | grep hive 表明hiveserver2正在运行.
我正在尝试使用用户[hive2]和密码[密码]登录到hivesever2直线.
这是我的直线输出:
beeline> !connect jdbc:hive2://localhost:10000
Connecting to jdbc:hive2://localhost:10000
Enter username for jdbc:hive2://localhost:10000:
Enter password for jdbc:hive2://localhost:10000:
17/02/14 13:51:41 [main]: WARN jdbc.HiveConnection: Failed to connect to localhost:10000
Error: Could not open client transport with JDBC Uri: jdbc:hive2://localhost:10000: Failed to open new session: java.lang.RuntimeException: org.apache.hadoop.ipc.RemoteException(org.apache.hadoop.security.authorize.AuthorizationException): User: server is not allowed to impersonate anonymous (state=08S01,code=0)
Run Code Online (Sandbox Code Playgroud)
我可以通过!connect jdbc:hive2://直线输入连接到嵌入式模式.
这是我的hive-site.xml:
<configuration>
<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:mysql://localhost:3306/hive?createDatabaseIfNotExist=true&useSSL=false</value>
</property>
<property>
<name>javax.jdo.option.ConnectionDriverName</name>
<value>com.mysql.jdbc.Driver</value>
</property>
<property>
<name>javax.jdo.option.ConnectionUserName</name>
<value>hive</value>
</property> …Run Code Online (Sandbox Code Playgroud)