I just see that solr runs as the user solr when started by root
with service solr start. From within the console startet it runs
as user root and the creation of a core does not fail then.

I must be a permissionproblem when solr runs as the user solr
altough all the files and folders in /var/solr are owned by
the user solr.

# ll solr
insgesamt 16
drwxr-x--- 2 solr users 4096 23. Mai 00:48 data
-rw-r----- 1 solr users  977 22. Mai 13:37 log4j.properties
drwxr-x--- 2 solr users 4096 23. Mai 00:47 logs
-rw-r--r-- 1 solr users    6 23. Mai 00:47 solr-8983.pid

I get an AccessDeniedException.

In the log I see this

....
2016-05-22 22:48:25.268 INFO  (qtp428746855-16) [   ] 
o.a.s.s.FileExchangeRateProvider Reloading exchange rates from file currency.xml
2016-05-22 22:48:25.452 INFO  (qtp428746855-16) [   ] 
o.a.s.c.ConfigSetProperties Did not find ConfigSet properties, assuming default 
properties: Can't find resource 'configsetprops.json' in
2016-05-22 22:48:25.454 INFO  (qtp428746855-16) [   ] o.a.s.c.CoreContainer 
Creating SolrCore 'zzz' using configuration from instancedir /var/solr/data/zzz
2016-05-22 22:48:25.459 INFO  (qtp428746855-16) [   x:zzz] o.a.s.c.SolrCore 
solr.NRTCachingDirectoryFactory
2016-05-22 22:48:25.553 INFO  (qtp428746855-16) [   x:zzz] o.a.s.c.SolrCore 
[[zzz] ] Opening new SolrCore at [/var/solr/data/zzz], 
dataDir=[/var/solr/data/zzz/data/]
2016-05-22 22:48:25.618 INFO  (qtp428746855-16) [   x:zzz] 
o.a.s.c.JmxMonitoredMap No JMX servers found, not exposing Solr information 
with JMX.
2016-05-22 22:48:25.629 INFO  (qtp428746855-16) [   x:zzz] o.a.s.c.SolrCore 
[[zzz] ] Added SolrEventListener for newSearcher: 
[org.apache.solr.core.QuerySenderListener{queries=[]}]
2016-05-22 22:48:25.630 INFO  (qtp428746855-16) [   x:zzz] o.a.s.c.SolrCore 
[[zzz] ] Added SolrEventListener for firstSearcher: 
[org.apache.solr.core.QuerySenderListener{queries=[]}]
2016-05-22 22:48:25.643 INFO  (qtp428746855-16) [   x:zzz] 
o.a.s.c.SchemaCodecFactory Using default compressionMode: BEST_SPEED
2016-05-22 22:48:25.758 ERROR (qtp428746855-16) [   x:zzz] o.a.s.c.SolrCore 
:java.nio.file.AccessDeniedException: /var/solr/data/zzz/data
        at 
sun.nio.fs.UnixException.translateToIOException(UnixException.java:84)
        at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
        at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
        at 
sun.nio.fs.UnixFileSystemProvider.createDirectory(UnixFileSystemProvider.java:384)
        at java.nio.file.Files.createDirectory(Files.java:674)

and further down

        at java.lang.Thread.run(Thread.java:745)
Caused by: java.nio.file.AccessDeniedException: /var/solr/data/zzz/data
        at 
sun.nio.fs.UnixException.translateToIOException(UnixException.java:84)

  Andreas

Erick Erickson <erickerick...@gmail.com> schrieb am 22.05.16 um 10:50:06 Uhr:

> What does the Solr log show? That often has more root causes than the
> return to the client.
> 
> Best,
> Erick
> 
> On Sun, May 22, 2016 at 10:13 AM, Andreas Meyer <a.me...@nimmini.de> wrote:
> > Hello!
> >
> > I run as root in both situations. If I start solr with service solr start
> > and then do a ./solr create -c zzz it fails with
> > ERROR: Error CREATEing SolrCore 'zzz': Unable to create core [zzz] Caused 
> > by: /var/solr/data/zzz/data
> >
> > If I do the same a second time, I get
> > ERROR:
> > Core 'zzz' already exists!
> > Checked core existence using Core API command:
> > http://localhost:8983/solr/admin/cores?action=STATUS&core=zzz
> >
> > A ./solr delete -c zzz clears this. Creation does not fail when I run
> > solr from within the console and the solr.in.sh in /etc/defaults is
> > ignored then.
> >
> > Regards
> >
> >   Andras
> >
> > Erick Erickson <erickerick...@gmail.com> schrieb am 22.05.16 um 09:34:53 
> > Uhr:
> >
> >> Possibly a permissions problem? Are you running
> >> as different users in the two situations?
> >>
> >> And do note that sometimes Solr gets a little confused
> >> if you try to create the same core multiple times without
> >> cleaning out the directories.
> >>
> >> Best,
> >> Erick
> >>
> >> On Sun, May 22, 2016 at 9:19 AM, Andreas Meyer <a.me...@nimmini.de> wrote:
> >> > Hello!
> >> >
> >> > It must have something to do with the init-script and the solr.in.sh.
> >> > As long as I start solr from within a console with bin/solr start
> >> > then there is no problem creating a core.
> >> >
> >> > As soon as I start solr with service solr start the creation of
> >> > a core fails.
> >> >
> >> > Even if I comment the SOLR_HOME="/var/solr/data" in solr.in.sh
> >> > and start solr with service solr start, creating a core is not
> >> > possilbe.
> >> >
> >> > # bin/solr create -c zzz
> >> >
> >> > Copying configuration to new core instance directory:
> >> > /opt/solr/server/solr/zzz
> >> >
> >> > Creating new core 'zzz' using command:
> >> > http://localhost:8983/solr/admin/cores?action=CREATE&name=zzz&instanceDir=zzz
> >> >
> >> >
> >> > ERROR: Error CREATEing SolrCore 'zzz': Unable to create core [zzz] 
> >> > Caused by: /opt/solr-5.5.1/server/solr/zzz/data
> >> >
> >> > Can't figure out why it is so.
> >> >
> >> > Greetings
> >> >
> >> >   Andreas
> >> >
> >> > Andreas Meyer <a.me...@nimmini.de> schrieb am 22.05.16 um 14:14:58 Uhr:
> >> >
> >> >> Hello!
> >> >>
> >> >> Got a problem with the creation of a core using a fresh installation.
> >> >>
> >> >> # ll
> >> >> insgesamt 16
> >> >> drwxr-x--- 2 solr users 4096 22. Mai 13:54 data
> >> >> -rw-r----- 1 solr users  977 22. Mai 13:37 log4j.properties
> >> >> drwxr-x--- 2 solr users 4096 22. Mai 13:54 logs
> >> >> -rw-r--r-- 1 solr users    6 22. Mai 13:54 solr-8983.pid
> >> >>
> >> >> # ps aux |grep solr
> >> >> solr     10121  2.0  9.6 2510148 198112 ?      Sl   13:54   0:12 
> >> >> /usr/lib64/jvm/jre/bin/java -server -Xms512m -Xmx512m -XX:NewRatio=3 
> >> >> -XX:SurvivorRatio=4 -XX:TargetSurvivorRatio=90 
> >> >> -XX:MaxTenuringThreshold=8 -XX:+UseConcMarkSweepGC -XX:+UseParNewGC 
> >> >> -XX:ConcGCThreads=4 -XX:ParallelGCThreads=4 
> >> >> -XX:+CMSScavengeBeforeRemark -XX:PretenureSizeThreshold=64m 
> >> >> -XX:+UseCMSInitiatingOccupancyOnly 
> >> >> -XX:CMSInitiatingOccupancyFraction=50 
> >> >> -XX:CMSMaxAbortablePrecleanTime=6000 -XX:+CMSParallelRemarkEnabled 
> >> >> -XX:+ParallelRefProcEnabled -verbose:gc -XX:+PrintHeapAtGC 
> >> >> -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps 
> >> >> -XX:+PrintTenuringDistribution -XX:+PrintGCApplicationStoppedTime 
> >> >> -Xloggc:/var/solr/logs/solr_gc.log -Djetty.port=8983 -DSTOP.PORT=7983 
> >> >> -DSTOP.KEY=solrrocks -Duser.timezone=UTC -Djetty.home=/opt/solr/server 
> >> >> -Dsolr.solr.home=/var/solr/data -Dsolr.install.dir=/opt/solr 
> >> >> -Dlog4j.configuration=file:/var/solr/log4j.properties -Xss256k 
> >> >> -XX:OnOutOfMemoryError=/opt/solr/bin/oom_
 sol
> >  r.s
> >> >  h 8983 /var/solr/logs -jar start.jar --module=http
> >> >>
> >> >> # bin/solr create -c xxx
> >> >>
> >> >> Copying configuration to new core instance directory:
> >> >> /var/solr/data/xxx
> >> >>
> >> >> Creating new core 'xxx' using command:
> >> >> http://localhost:8983/solr/admin/cores?action=CREATE&name=xxx&instanceDir=xxx
> >> >>
> >> >>
> >> >> ERROR: Error CREATEing SolrCore 'xxx': Unable to create core [xxx] 
> >> >> Caused by: /var/solr/data/xxx/data
> >> >>
> >> >> and again
> >> >>
> >> >> # bin/solr create -c xxx
> >> >>
> >> >> ERROR:
> >> >> Core 'xxx' already exists!
> >> >> Checked core existence using Core API command:
> >> >> http://localhost:8983/solr/admin/cores?action=STATUS&core=xxx
> >> >>
> >> >> but the folder xxx is not created. I see this in the logs:
> >> >>
> >> >> So 22 Mai 2016 13:54:26 CEST  ERROR   null    SolrCore        
> >> >> :java.nio.file.AccessDeniedException: /var/solr/data/xxx/data
> >> >> So 22 Mai 2016 13:54:26 CEST  WARN    null    SolrCore        [xxx] 
> >> >> Solr index directory '/var/solr/data/xxx/data/index' doesn't exist. 
> >> >> Creating new index...
> >> >> So 22 Mai 2016 13:54:26 CEST  ERROR   null    CoreContainer   Error 
> >> >> creating core [xxx]: /var/solr/data/xxx/data
> >> >> So 22 Mai 2016 13:54:26 CEST  ERROR   null    RequestHandlerBase      
> >> >> org.apache.solr.common.SolrException: Error CREATEing SolrCore 'xxx': 
> >> >> Unable to create core [xxx] Caused by: /var/solr/data/xxx/data
> >> >>
> >> >> Whats wrong?
> >> >>
> >> >> Kind regards
> >> >>
> >> >>   Andreas
> >> >
> >

Reply via email to