[ https://issues.apache.org/jira/browse/PHOENIX-2200?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14718063#comment-14718063 ]
lihuaqing commented on PHOENIX-2200: ------------------------------------ It doesn't help. Has other clues? Thanks > Can phoenix support mapreduce with secure hbase(kerberos)? > ----------------------------------------------------------- > > Key: PHOENIX-2200 > URL: https://issues.apache.org/jira/browse/PHOENIX-2200 > Project: Phoenix > Issue Type: Bug > Environment: hbase-0.98.12.1-hadoop2 phoenix-4.5.0-HBase-0.98-bin > Reporter: lihuaqing > > I can not work with phoenix mapreduce kerberos. My codes is as followings: > final Configuration configuration = HBaseConfiguration.create(); > configuration.set("hbase.security.authentication","kerberos"); > configuration.set("hadoop.security.authentication", "kerberos"); > configuration.set("hbase.master.kerberos.principal","hbase/_HOST@DATA.SCLOUD"); > configuration.set("hbase.regionserver.kerberos.principal","hbase/_HOST@DATA.SCLOUD"); > configuration.set(QueryServices.HBASE_CLIENT_PRINCIPAL,"***"); > configuration.set(QueryServices.HBASE_CLIENT_KEYTAB,"***"); > final Job job = Job.getInstance(configuration, "phoenix-mr-job"); > // We can either specify a selectQuery or ignore it when we would like to > retrieve all the columns > final String selectQuery = "SELECT > STOCK_NAME,RECORDING_YEAR,RECORDINGS_QUARTER FROM STOCK "; > // StockWritable is the DBWritable class that enables us to process the > Result of the above query > PhoenixMapReduceUtil.setInput(job, StockWritable.class, "STOCK", > selectQuery); > // Set the target Phoenix table and the columns > PhoenixMapReduceUtil.setOutput(job, "STOCK_STATS", > "STOCK_NAME,MAX_RECORDING"); > job.setMapperClass(StockMapper.class); > job.setReducerClass(StockReducer.class); > job.setOutputFormatClass(PhoenixOutputFormat.class); > job.setMapOutputKeyClass(Text.class); > job.setMapOutputValueClass(DoubleWritable.class); > job.setOutputKeyClass(NullWritable.class); > job.setOutputValueClass(StockWritable.class); > TableMapReduceUtil.addDependencyJars(job); > job.waitForCompletion(true); > I get the error statck as following: > 2015-08-24 12:12:15,767 WARN [main] org.apache.hadoop.mapred.YarnChild: > Exception running child : java.lang.RuntimeException: java.sql.SQLException: > ERROR 103 (08004): Unable to establish connection. > at > org.apache.phoenix.mapreduce.PhoenixInputFormat.getQueryPlan(PhoenixInputFormat.java:125) > at > org.apache.phoenix.mapreduce.PhoenixInputFormat.createRecordReader(PhoenixInputFormat.java:69) > at > org.apache.hadoop.mapred.MapTask$NewTrackingRecordReader.<init>(MapTask.java:512) > at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:755) > at org.apache.hadoop.mapred.MapTask.run(MapTask.java:341) > at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:163) > at java.security.AccessController.doPrivileged(Native Method) > at javax.security.auth.Subject.doAs(Subject.java:415) > at > org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1628) > at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:158) > Caused by: java.sql.SQLException: ERROR 103 (08004): Unable to establish > connection. > at > org.apache.phoenix.exception.SQLExceptionCode$Factory$1.newException(SQLExceptionCode.java:388) > at > org.apache.phoenix.exception.SQLExceptionInfo.buildException(SQLExceptionInfo.java:145) > at > org.apache.phoenix.query.ConnectionQueryServicesImpl.openConnection(ConnectionQueryServicesImpl.java:297) > at > org.apache.phoenix.query.ConnectionQueryServicesImpl.access$300(ConnectionQueryServicesImpl.java:180) > at > org.apache.phoenix.query.ConnectionQueryServicesImpl$12.call(ConnectionQueryServicesImpl.java:1901) > at > org.apache.phoenix.query.ConnectionQueryServicesImpl$12.call(ConnectionQueryServicesImpl.java:1880) > at > org.apache.phoenix.util.PhoenixContextExecutor.call(PhoenixContextExecutor.java:77) > at > org.apache.phoenix.query.ConnectionQueryServicesImpl.init(ConnectionQueryServicesImpl.java:1880) > at > org.apache.phoenix.jdbc.PhoenixDriver.getConnectionQueryServices(PhoenixDriver.java:180) > at > org.apache.phoenix.jdbc.PhoenixEmbeddedDriver.connect(PhoenixEmbeddedDriver.java:132) > at org.apache.phoenix.jdbc.PhoenixDriver.connect(PhoenixDriver.java:151) > at java.sql.DriverManager.getConnection(DriverManager.java:579) > at java.sql.DriverManager.getConnection(DriverManager.java:190) > at > org.apache.phoenix.mapreduce.util.ConnectionUtil.getConnection(ConnectionUtil.java:93) > at > org.apache.phoenix.mapreduce.util.ConnectionUtil.getInputConnection(ConnectionUtil.java:57) > at > org.apache.phoenix.mapreduce.PhoenixInputFormat.getQueryPlan(PhoenixInputFormat.java:112) > ... 9 more > Caused by: java.io.IOException: Login failure for > work/nj01-scloud-data-monitor00.nj01.baidu.com@DATA.SCLOUD from keytab > /home/work/dataproject/HIndex/conf/work_00.keytab: > javax.security.auth.login.LoginException: Unable to obtain password from user > at > org.apache.hadoop.security.UserGroupInformation.loginUserFromKeytab(UserGroupInformation.java:935) > at org.apache.hadoop.security.SecurityUtil.login(SecurityUtil.java:243) > at > org.apache.hadoop.hbase.security.User$SecureHadoopUser.login(User.java:391) > at org.apache.hadoop.hbase.security.User.login(User.java:258) > at > org.apache.phoenix.query.ConnectionQueryServicesImpl.openConnection(ConnectionQueryServicesImpl.java:292) > ... 22 more > Caused by: javax.security.auth.login.LoginException: Unable to obtain > password from user > at > com.sun.security.auth.module.Krb5LoginModule.promptForPass(Krb5LoginModule.java:852) > at > com.sun.security.auth.module.Krb5LoginModule.attemptAuthentication(Krb5LoginModule.java:715) > at > com.sun.security.auth.module.Krb5LoginModule.login(Krb5LoginModule.java:580) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:601) > at javax.security.auth.login.LoginContext.invoke(LoginContext.java:784) > at > javax.security.auth.login.LoginContext.access$000(LoginContext.java:203) > at javax.security.auth.login.LoginContext$5.run(LoginContext.java:721) > at javax.security.auth.login.LoginContext$5.run(LoginContext.java:719) > at java.security.AccessController.doPrivileged(Native Method) > at > javax.security.auth.login.LoginContext.invokeCreatorPriv(LoginContext.java:718) > at javax.security.auth.login.LoginContext.login(LoginContext.java:590) > at > org.apache.hadoop.security.UserGroupInformation.loginUserFromKeytab(UserGroupInformation.java:926) > ... 26 more > I am sure the keytab and principal are right. Beause I can kinit successfully > with the keytab and principal > Can phoenix support mapreduce with secure hbase(kerberos)? > if support. How config ? Thanks -- This message was sent by Atlassian JIRA (v6.3.4#6332)