1. Long time useless log4j, go to Logback for many years, hbase program run, reported lack of log4j configuration, then, go to Logback bar (The following XXX represents the version number).
The original Lib package contains Log4j-xxx.jar, Slf4j-api-xxx.jar, Slf4j-log4j12-xxx.jar, kill Log4j-xxx.jar and Slf4j-log4j12-xxx.jar, join Jcl-over-slf4j-xxx.jar,log4j-over-slf4j-xxx.jar, Logback-classic-xxx.jar, Logback-core-xxx.jar, as for the original SLF4J-API this package, can be replaced with new, and then, add a logback.xml to classpath under
<?XML version= "1.0" encoding= "UTF-8"?><!--For assistance related to logback-translator or configuration -<!--files in general, logback user mailing list -<!--At Http://www.qos.ch/mailman/listinfo/logback-user -<!-- -<!--For professional . -<!--Http://www.qos.ch/shop/products/professionalSupport -<!-- -<ConfigurationScan= "true"Scanperiod= "Seconds"Debug= "false"> <Appendername= "Fileapp"class= "Ch.qos.logback.core.rolling.RollingFileAppender"> <!--See also Http://logback.qos.ch/manual/appenders.html#RollingFileAppender - <Filterclass= "Ch.qos.logback.classic.filter.ThresholdFilter"> < Level>WARN</ Level> </Filter> <File>Log/hbaseclient.log</File> <Encoder> <pattern>%d [%t]%-5p%c-%m%n</pattern> </Encoder> <Rollingpolicyclass= "Ch.qos.logback.core.rolling.FixedWindowRollingPolicy"> <Maxindex>10</Maxindex> <Filenamepattern>Log/hbaseclient.log.%i</Filenamepattern> </Rollingpolicy> <Triggeringpolicyclass= "Ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy"> <MaxFileSize>1024KB</MaxFileSize> </Triggeringpolicy> </Appender> <Appendername= "Conapp"class= "Ch.qos.logback.core.ConsoleAppender"> <Encoder> <pattern>%d [%t]%-5p%c-%m%n</pattern> </Encoder> </Appender> <Root Level= "ERROR"> <Appender-refref= "Conapp"/> <Appender-refref= "Fileapp"/> </Root></Configuration>
In this way, log4j and System log system is logback take over, as for why not log4j, with Logback, this ... See for yourself, I may write something, logback a little bug, is that some Linux system will not find the configuration file, previously repaired, do not know the new version has been processed.
2.Could Locate executable Null\bin\winutils.exe in the Hadoop binaries
The old question, the system variable settings hadoop_home, I still do not want to set the environment variable, or a line of code come fast
System.setproperty ("Hadoop.home.dir", "g:/hadoop/hadoop-2.4.1");
3. The program runs normally, but when the log level is changed to info, you suddenly find a
2014-08-04 16:19:22,942 [Main-sendthread (master:2222)] INFO org.apache.zookeeper.clientcnxn-opening socket Connection to server master/192.168.117.128:2222. Will isn't attempt to authenticate using SASL (java.lang.SecurityException: Unable to locate login configuration)
See a exception, what's the situation? Feel wrong, but the program is all normal.
Search for a pass, found a lot of the same problem, but seems to have nothing to do with me, others are the program can not run through, I am the program is normal.
There is said to be zookeeper version inconsistency, I saw the next Hadoop and hbase in the real difference, a zookeeper-3.4.5.jar, a zookeeper-3.4.6.jar, but I always feel wrong, new and old how can be incompatible ah. That is the direct unification of the test, even the client program is unified, the result that info information is still there, and do not change is the same, it is not the problem here!
There are said to be the configuration and the hosts, I do not have this problem here, have been configured. Add parameter? I have written in the configuration, and directly print a look to know that there is.
This is just an info information, it is strange why is an info, 're told info level is not affect what information, the program is really normal run, but see this information is uncomfortable.
Self-check code to forget, according to the log, is in the Clientcnxn.java information, OK, check the source
Private void logstartconnect (inetsocketaddress addr) { = "Opening socket connection to server" + addr; if NULL { + = "." + zookeepersaslclient.getconfigstatus (); } Log.info (msg); }
Sweat, you have to check Zookeepersaslclient.java, go on.
PublicZookeepersaslclient (FinalString Serverprincipal)throwsloginexception {/*** Zookeeper-1373:allow system property to specify the JAAS * configuration sections that the Zookeepe R client should use. * Default to "Client". */String clientsection= System.getproperty (Zookeepersaslclient.login_context_name_key, "Client");//Note that's ' Configuration ' here refers to javax.security.auth.login.Configuration.AppConfigurationEntry entries[] =NULL; RuntimeException runtimeexception=NULL; Try{Entries=configuration.getconfiguration (). Getappconfigurationentry (clientsection); } Catch(SecurityException e) {//handle Below:might is harmless if the user doesn ' t intend to use JAAS authentication.RuntimeException =e; } Catch(IllegalArgumentException e) {//Third party customized getappconfigurationentry could throw illegalargumentexception when JAAS//configuration isn ' t set. We can reevaluate whether to catch runtimeexception instead if more//different types of runtimeexception foundRuntimeException =e; } if(Entries! =NULL) { This. Configstatus = "would attempt to sasl-authenticate using the Login Context section '" + clientsection + "'"; This. saslclient =createsaslclient (Serverprincipal, clientsection); } Else { //Handle situation of clientsection ' s being null:it might simply because the client does not intend to //Use SASL and so is not necessarily an error.Saslstate =saslstate.failed; String explicitclientsection = System.getproperty (Zookeepersaslclient.login_context_name_key); if (explicitclientsection! = null) { //If The user explicitly overrides the default Login Context, they probably expected SASL to//succeed. But if we got here, SASL failed. if(RuntimeException! =NULL) { Throw NewLoginexception ("Zookeeper client cannot authenticate using the" + explicitclientsection + "se Ction of the supplied JAAS configuration: ' "+System.getproperty (Environment.jaas_conf_key)+ "' because of a" + "RuntimeException:" +runtimeexception); } Else { Throw NewLoginexception ("Client cannot sasl-authenticate because the specified JAAS configuration" + "s Ection ' "+ explicitclientsection +" ' could not being found. "); } } else {//The user did not override the default context. It might is that they just don ' t intend to use SASL,//So logs at INFO, not WARN, since they don't expect any sasl-related information.String msg = "won't attempt to authenticate using SASL"; if(RuntimeException! =NULL) { msg + = "(" + RuntimeException + ")"; } Else{msg+ = "(Unknown error)"; } This. Configstatus =msg; This. issaslconfigured =false; } if(System.getproperty (environment.jaas_conf_key)! =NULL) { //Again, the user explicitly set something sasl-related, so they probably expected-SASL to succeed. if(RuntimeException! =NULL) { Throw NewLoginexception ("Zookeeper client cannot authenticate using the '" +System.getproperty (Zookeepersaslclient.login_context_name_key,"Client") + "' section of the supplied JAAS configuration: '" +System.getproperty (Environment.jaas_conf_key)+ "' because of a" + "RuntimeException:" +runtimeexception); } Else { Throw NewLoginexception ("No JAAS configuration section named" +System.getproperty (Zookeepersaslclient.login_context_name_key,"Client") + "' is found in specified JAAS configuration file: '" +System.getproperty (Environment.jaas_conf_key)+ "'."); } } } }
According to the above code, the problem is that the red part, and then pay attention to the above comment, I really just a plain text, but, can not do in info information inside a exception hint out???
Well, that is really an info information, is irrelevant info information, in fact, just explain ..... Because the client is useless SASL, do not use SASL to verify ...
Can you change the explanatory text for a better point? I've done all this! That's what they show, alas. There is no way to see the bad, is this something else to change the source? It's sweaty enough.
Solution, the client adds SASL information, and then the service side also get rid of, add authentication, this official document Http://hbase.apache.org/book.html#security has explained, directly see is, here does not explain.
Alas, the Virgo pursuit of Perfect heart, sure enough is the same ... Plus, can't see the disturbing words, comfortable.