Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Server

Notices

Reply
 
Thread Tools Search this Thread
Old 05-26-2022, 07:06 AM   #1
Tuxracer
Junior Member
Tuxracer began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Jul 2015
Device: iPad
Multiple content-server instances possible ?

Hello,

as a first time thank you very much for the great program.

I use the Calibre-content-server in an Ubuntu Linux container on a Proxmox environment, it works wonderfully.
Integrated are some libraries on different topics.

My question:
Is it possible to start several content-server instances in parallel on the Linux server, which should then be accessible from external via different ports + login user ?

Background: I want to reduce the access for individual users to single or multiple libraries, so that they can not all see or access.

Thanks in advance

Thomas
Tuxracer is offline   Reply With Quote
Old 05-26-2022, 08:12 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,268
Karma: 27111060
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
You can define library limits per user account no need for multiple server instances.
kovidgoyal is online now   Reply With Quote
Advert
Old 05-27-2022, 02:34 AM   #3
Tuxracer
Junior Member
Tuxracer began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Jul 2015
Device: iPad
Hello,

thanks for the tip.
I have set it up with the help of the documentation, it works quite well, if the accesses of different users from different computers.

However, from the same computer it only works reliably if you clear the browser cache in the meantime - but that's not a problem so far.
Tuxracer is offline   Reply With Quote
Old 05-27-2022, 01:07 PM   #4
martianrock
Junior Member
martianrock began at the beginning.
 
Posts: 9
Karma: 10
Join Date: May 2022
Device: fbreader
Not sure if it is ok to hijack this thread, but I'd still like to know how to run more than one instance of service on a single machine. I tried to separate them by giving 2 instances each different --port's, different library directories and even different --pidfile's and one of them still detects that the other instance is running and fails to start. What else should I configure to keep them both running?
martianrock is offline   Reply With Quote
Old 05-27-2022, 01:25 PM   #5
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 79,506
Karma: 145863177
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by martianrock View Post
Not sure if it is ok to hijack this thread, but I'd still like to know how to run more than one instance of service on a single machine. I tried to separate them by giving 2 instances each different --port's, different library directories and even different --pidfile's and one of them still detects that the other instance is running and fails to start. What else should I configure to keep them both running?
Two different computers with two different libraries.
JSWolf is offline   Reply With Quote
Advert
Old 05-27-2022, 01:45 PM   #6
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 30,973
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by JSWolf View Post
Two different computers with two different libraries.
https://manual.calibre-ebook.com/gen...re-server.html
I believe You can STILL use the CLI to start multiple instances if you specify With Library.
I used to do the way back around Calibre 2 where server (instance) could only do 1 Library
theducks is offline   Reply With Quote
Old 05-27-2022, 02:30 PM   #7
martianrock
Junior Member
martianrock began at the beginning.
 
Posts: 9
Karma: 10
Join Date: May 2022
Device: fbreader
Quote:
Originally Posted by theducks View Post
https://manual.calibre-ebook.com/gen...re-server.html
I believe You can STILL use the CLI to start multiple instances if you specify With Library.
I used to do the way back around Calibre 2 where server (instance) could only do 1 Library
There's no --with-library option but I did provide distinct path to different libraries for each instance. And yet I still got an error on startup of one of the instances saying another instance is running. No idea why, I suspect this error is a bug.

I got around that by having Environment="CALIBRE_NO_SI_DANGER_DANGER=Y" in systemd config for each since I am pretty sure that separate instances talk to separate libraries. That and one of them is intended as read-only. So I hope actual danger is not that big, though it would be nice if I didn't have to use this override.
martianrock is offline   Reply With Quote
Old 05-27-2022, 02:47 PM   #8
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 30,973
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Look at the example at the top.
( My bad. this does not use the actual --withlibrary phase as part of the argument)
theducks is offline   Reply With Quote
Old 05-27-2022, 06:41 PM   #9
martianrock
Junior Member
martianrock began at the beginning.
 
Posts: 9
Karma: 10
Join Date: May 2022
Device: fbreader
Quote:
Originally Posted by theducks View Post
Look at the example at the top.
( My bad. this does not use the actual --withlibrary phase as part of the argument)
Right, so 1st server is started as
Quote:
/usr/bin/calibre-server --port=80 --pidfile="/tmp/calibre-server-prod.pid" /calibre/library/
2nd as:
Quote:
/usr/bin/calibre-server --pidfile="/tmp/calibre-server-staging.pid" /calibre/staging/
And somehow only one of them starts and other fails with error saying there's another instance running (that's w/o CALIBRE_NO_SI_DANGER_DANGER override) Different ports, pid files and library directories.
martianrock is offline   Reply With Quote
Old 05-27-2022, 07:04 PM   #10
gbm
Wizard
gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.
 
Posts: 2,180
Karma: 8800000
Join Date: Jun 2010
Device: Kobo Clara HD,Hisence Sero 7 Pro RIP, Nook STR, jetbook lite
You need to assign them different ports--one on port 80 the other on say port 85.

bernie
Quote:
Originally Posted by martianrock View Post
Right, so 1st server is started as


2nd as:


And somehow only one of them starts and other fails with error saying there's another instance running (that's w/o CALIBRE_NO_SI_DANGER_DANGER override) Different ports, pid files and library directories.
gbm is offline   Reply With Quote
Old 05-27-2022, 07:18 PM   #11
martianrock
Junior Member
martianrock began at the beginning.
 
Posts: 9
Karma: 10
Join Date: May 2022
Device: fbreader
Quote:
Originally Posted by gbm View Post
You need to assign them different ports--one on port 80 the other on say port 85.

bernie
one is set to 80, other is not set so default 8080 is used. They _are_ on different ports and I can see web UIs on 80 and 8080 accordingly.
martianrock is offline   Reply With Quote
Old 05-27-2022, 07:46 PM   #12
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 30,973
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
I always specified the port as well as the library.
BTW I would use the full path to the Library
Some systems want you to avoid Port 80
theducks is offline   Reply With Quote
Old 05-27-2022, 10:18 PM   #13
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,268
Karma: 27111060
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
If for some reason you really want to run two different servers on a single machine and dont want to use the env var, use different user accounts. Though the single instance mutex is there for your protection, working around it is not a good idea. It doesnt just prevent multiple instances of the server, it also prevents other tools such as calibredb and the GUI from running. You basically cannot have more than one thing that can alter a database running.
kovidgoyal is online now   Reply With Quote
Old 05-28-2022, 10:05 AM   #14
martianrock
Junior Member
martianrock began at the beginning.
 
Posts: 9
Karma: 10
Join Date: May 2022
Device: fbreader
Quote:
Originally Posted by theducks View Post
I always specified the port as well as the library.
BTW I would use the full path to the Library
Some systems want you to avoid Port 80
isn't /calibre/library/ a full path to library directory? Or should I have specified metadata file as well?

And I have elevated CAP_NET_BIND_SERVICE capability in systemd .service file to allow non-root account bind to port <1024, and in fact verified both ports 80 and 8080 were properly bound by respective instances.

Quote:
Originally Posted by kovidgoyal View Post
If for some reason you really want to run two different servers on a single machine and dont want to use the env var, use different user accounts. Though the single instance mutex is there for your protection, working around it is not a good idea. It doesnt just prevent multiple instances of the server, it also prevents other tools such as calibredb and the GUI from running. You basically cannot have more than one thing that can alter a database running.
My only reason for asking for 2 instances is to have anonymous accessible library with fewer books than the one which needs login and which would also include work-in-progress books.
I was under impression that giving two instances 2 different paths to 2 different libraries would prevent more than one thing touching any of those libraries, I am confused as to what other resource those 2 instances could be sharing given that I gave them different ports, different libraries and different pid files.
But I agree, I am uncomfortable with using that environment variable override, I will definitely try using 2 different accounts, thanks for suggestion!
martianrock is offline   Reply With Quote
Old 05-28-2022, 10:33 AM   #15
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 30,973
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
I have only 2 users SERVER logins
1) is for guests (Guestusername, guestpassword) (not an individual logonretty anonymous), with the restrictions configured in sharing over the net

2) Me, I get to access all libraries from the web
theducks is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple identical server instances detected didierm Calibre Companion 2 08-17-2014 10:19 AM
Trouble with multiple content server instances perx Calibre 3 02-17-2012 01:24 AM
Content Server Multiple Libraries with different views? jamng Calibre 18 09-27-2011 08:28 AM
multiple libraries in the content server? ottovdv Calibre 1 03-27-2011 05:52 PM
Multiple logins for content server wcalexan Calibre 4 03-06-2011 12:03 PM


All times are GMT -4. The time now is 11:26 PM.


MobileRead.com is a privately owned, operated and funded community.