It's unclear to me what the permissions on log files and directories should
be when impersonation is enabled. How do we configure this?
Using the MapR packaging, when impersonation is enabled I get permission
denied errors when starting up sqlline. The permissions on the directory
after running rpm --setperms mapr-drill are:
[vince@node1 ~]$ ls -ld /opt/mapr/drill/drill-1.0.0/logs
drwxrw-rw-. 3 mapr root 4096 Jun 15 12:14 /opt/mapr/drill/drill-1.0.0/logs
Seems that this directory should have a mode of 1777.
If I don't change the permissions, I get the output below. If I change the
permissions to 1777 and remove sqlline_queries.json, the sqlline shell
starts up cleanly. But I imagine that if I run sqlline as another user,
that user will run into trouble with sqlline tries to open
sqlline_queries.json and sqlline.log for write.
Note that I configured impersonation after having already run some queries,
so that likely explains why I needed to remove the sqlline_queries file.
When I use rpm --setperms mapr-drill to reset permissions, I get:
drwxrw-rw-. 3 mapr root 4096 Jun 19 07:52 logs
Which doesn't seem quite right.
---
[vince@node1 ~]$ /opt/mapr/drill/drill-1.0.0/bin/sqlline -u jdbc:drill: -n
vince -p notmypassword
07:46:55,174 |-INFO in ch.qos.logback.classic.LoggerContext[default] -
Could NOT find resource [logback.groovy]
07:46:55,175 |-INFO in ch.qos.logback.classic.LoggerContext[default] -
Could NOT find resource [logback-test.xml]
07:46:55,175 |-INFO in ch.qos.logback.classic.LoggerContext[default] -
Found resource [logback.xml] at [file:/opt/mapr/drill/drill-1.0
.0/conf/logback.xml]
07:46:55,370 |-INFO in
ch.qos.logback.classic.joran.action.ConfigurationAction - debug attribute
not set
07:46:55,374 |-INFO in ch.qos.logback.core.joran.action.AppenderAction -
About to instantiate appender of type [ch.qos.logback.core.Co
nsoleAppender]
07:46:55,386 |-INFO in ch.qos.logback.core.joran.action.AppenderAction -
Naming appender as [STDOUT]
07:46:55,412 |-INFO in
ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default
type [ch.qos.logback.classic.encode
r.PatternLayoutEncoder] for [encoder] property
07:46:55,485 |-INFO in ch.qos.logback.core.joran.action.AppenderAction -
About to instantiate appender of type [ch.qos.logback.core.ro
lling.RollingFileAppender]
07:46:55,488 |-INFO in ch.qos.logback.core.joran.action.AppenderAction -
Naming appender as [QUERY]
07:46:55,509 |-INFO in
ch.qos.logback.core.rolling.FixedWindowRollingPolicy@294c4c55 - No
compression will be used
07:46:55,519 |-INFO in
ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default
type [ch.qos.logback.classic.encode
r.PatternLayoutEncoder] for [encoder] property
07:46:55,519 |-INFO in
ch.qos.logback.core.rolling.RollingFileAppender[QUERY] - Active log file
name: /opt/mapr/drill/drill-1.0.0/logs
/sqlline_queries.json
*07:46:55,519 |-INFO in
ch.qos.logback.core.rolling.RollingFileAppender[QUERY] - File property is
set to [/opt/mapr/drill/drill-1.0.0/l*
*ogs/sqlline_queries.json]*
*07:46:55,521 |-ERROR in
ch.qos.logback.core.rolling.RollingFileAppender[QUERY] -
openFile(/opt/mapr/drill/drill-1.0.0/logs/sqlline_que*
*ries.json,true) call failed. java.io.FileNotFoundException:
/opt/mapr/drill/drill-1.0.0/logs/sqlline_queries.json (Permission denied)*
* at java.io.FileNotFoundException:
/opt/mapr/drill/drill-1.0.0/logs/sqlline_queries.json (Permission denied)*
at at java.io.FileOutputStream.open(Native Method)
at at
java.io.FileOutputStream.<init>(FileOutputStream.java:221)
at at
ch.qos.logback.core.recovery.ResilientFileOutputStream.<init>(ResilientFileOutputStream.java:28)
at at
ch.qos.logback.core.FileAppender.openFile(FileAppender.java:149)
at at
ch.qos.logback.core.FileAppender.start(FileAppender.java:108)
at at
ch.qos.logback.core.rolling.RollingFileAppender.start(RollingFileAppender.java:86)
at at
ch.qos.logback.core.joran.action.AppenderAction.end(AppenderAction.java:96)
at at
ch.qos.logback.core.joran.spi.Interpreter.callEndAction(Interpreter.java:317)
at at
ch.qos.logback.core.joran.spi.Interpreter.endElement(Interpreter.java:196)
at at
ch.qos.logback.core.joran.spi.Interpreter.endElement(Interpreter.java:182)
at at
ch.qos.logback.core.joran.spi.EventPlayer.play(EventPlayer.java:62)
at at
ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:149)
at at
ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:135)
at at
ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:99)
at at
ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:49)
at at
ch.qos.logback.classic.util.ContextInitializer.configureByResource(ContextInitializer.java:75)
at at
ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:148)
at at
org.slf4j.impl.StaticLoggerBinder.init(StaticLoggerBinder.java:85)
at at
org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:55)
at at org.slf4j.LoggerFactory.bind(LoggerFactory.java:129)
at at
org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:108)
at at
org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:302)
at at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:276)
at at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:288)
at at
org.apache.drill.jdbc.DrillHandler.<clinit>(DrillHandler.java:27)
at at
org.apache.drill.jdbc.Driver.createHandler(Driver.java:74)
at at
net.hydromatic.avatica.UnregisteredDriver.<init>(UnregisteredDriver.java:49)
at at org.apache.drill.jdbc.Driver.<init>(Driver.java:34)
at at org.apache.drill.jdbc.Driver.<clinit>(Driver.java:80)
at at java.lang.Class.forName0(Native Method)
at at java.lang.Class.forName(Class.java:191)
at at
sqlline.DatabaseConnection.connect(DatabaseConnection.java:125)
at at
sqlline.DatabaseConnection.getConnection(DatabaseConnection.java:213)
at at sqlline.Commands.connect(Commands.java:1083)
at at sqlline.Commands.connect(Commands.java:1015)
at at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
at at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at at java.lang.reflect.Method.invoke(Method.java:606)
at at
sqlline.ReflectiveCommandHandler.execute(ReflectiveCommandHandler.java:36)
at at sqlline.SqlLine.dispatch(SqlLine.java:734)
at at sqlline.SqlLine.initArgs(SqlLine.java:519)
at at sqlline.SqlLine.begin(SqlLine.java:587)
at at sqlline.SqlLine.start(SqlLine.java:366)
at at sqlline.SqlLine.main(SqlLine.java:259)
07:46:55,521 |-INFO in ch.qos.logback.core.joran.action.AppenderAction -
About to instantiate appender of type
[ch.qos.logback.core.rolling.RollingFileAppender]
07:46:55,521 |-INFO in ch.qos.logback.core.joran.action.AppenderAction -
Naming appender as [FILE]
07:46:55,523 |-INFO in
ch.qos.logback.core.rolling.FixedWindowRollingPolicy@34996009 - No
compression will be used
07:46:55,524 |-INFO in
ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default
type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder]
property
07:46:55,524 |-INFO in
ch.qos.logback.core.rolling.RollingFileAppender[FILE] - Active log file
name: /opt/mapr/drill/drill-1.0.0/logs/sqlline.log
07:46:55,524 |-INFO in
ch.qos.logback.core.rolling.RollingFileAppender[FILE] - File property is
set to [/opt/mapr/drill/drill-1.0.0/logs/sqlline.log]
07:46:55,525 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction -
Setting additivity of logger [org.apache.drill] to false
07:46:55,525 |-INFO in ch.qos.logback.classic.joran.action.LevelAction -
org.apache.drill level set to INFO
07:46:55,525 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction -
Attaching appender named [FILE] to Logger[org.apache.drill]
07:46:55,528 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction -
Setting additivity of logger [query.logger] to false
07:46:55,528 |-INFO in ch.qos.logback.classic.joran.action.LevelAction -
query.logger level set to INFO
07:46:55,528 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction -
Attaching appender named [QUERY] to Logger[query.logger]
07:46:55,528 |-INFO in ch.qos.logback.classic.joran.action.LevelAction -
ROOT level set to ERROR
07:46:55,528 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction -
Attaching appender named [STDOUT] to Logger[ROOT]
07:46:55,528 |-INFO in
ch.qos.logback.classic.joran.action.ConfigurationAction - End of
configuration.
07:46:55,529 |-INFO in
ch.qos.logback.classic.joran.JoranConfigurator@417009d9 - Registering
current configuration as safe fallback point
apache drill 1.0.0
"the only truly happy people are children, the creative minority and drill
users"
0: jdbc:drill:>