JustaPenguin / assetto-server-manager

A web interface to manage an Assetto Corsa Server.
https://github.com/JustaPenguin/assetto-server-manager/releases
MIT License
292 stars 70 forks source link

multiserver management #117

Closed Hecrer closed 4 years ago

luismercury commented 5 years ago

My solution.

It is not necessary ... it is enough to duplicate the "AC Server Manager" folder and change the ports to have another server

luismercury commented 5 years ago

👍

mike855 commented 5 years ago

I've done this solution, then a bootstrap navbar that displays mainpage of each servers at bottom with iframe

Nordicdesign commented 5 years ago

I tried this, and now every time I log into one the other logs out. My setup:

Steps to reproduce

  1. Launch first AC Server Manager (SM)
  2. Log in
  3. Launch 2nd SM
  4. Log in
  5. Go back to 1st SM, navigate to any page, and it will log me off
mike855 commented 5 years ago

Here is my configuration, you can see I renamed the server-manager executable, maybe it's the solution for you (I have 7 servers working like that) :

. ├── acfr1 │   ├── acfr1 │   ├── acfr1-2019-05-08-17-56.log │   ├── blacklist.txt │   ├── cfg │   ├── config.yml │   ├── content -> /home/acfr/serveur/assetto_corsa/content │   ├── json │   ├── manager │   ├── results │   ├── server-manager1 │   ├── server-manager.log │   ├── setups │   ├── stracker │   └── system ├── acfr2 │   ├── acfr2 │   ├── acfr2-2019-05-09-13-18.log │   ├── blacklist.txt │   ├── cfg │   ├── config.yml │   ├── content -> /home/acfr/serveur/assetto_corsa/content │   ├── json │   ├── manager │   ├── results │   ├── server-manager2 │   ├── server-manager.log │   ├── setups │   ├── stracker │   └── system

cj123 commented 5 years ago

Thanks for that @mike855, hopefully that helps for the moment. My ideal 'multiserver' scenario would involve full management of multiple acServer instances through a single web interface. This has many complexities and may not even be feasible, but it's the next 'big thing' i'm looking into.

Nordicdesign commented 5 years ago

@mike855 did you change anything else other than the executable? I tried renaming it to server-manager2.exe but the login issue was still happening. This is on windows though, maybe the behaviour is different.

mike855 commented 5 years ago

Just put unique ports for servers and server manager

mike855 commented 5 years ago

Thanks for that @mike855, hopefully that helps for the moment. My ideal 'multiserver' scenario would involve full management of multiple acServer instances through a single web interface. This has many complexities and may not even be feasible, but it's the next 'big thing' i'm looking into.

look at http://acfr-server.fr : it's a bootstrap with iframe

mike855 commented 5 years ago

other tip : the content folder is deported and each server have a symbolic link to the content folder to save space and have same content on all servers

Nordicdesign commented 5 years ago

the symbolic link is a brilliant idea, thanks.

Something odd is going on because I'd say that my ports are different. But I'm new to AC servers so probably doing something wrong.

My 2 servers cfg, with different ports. Also SM1 uses 8772 and SM2 8772 image

My setup is: SERVER 1 SM on - C:\ac-dedicated AC server on - C:\Program Files (x86)\Steam\steamapps\common\Assetto Corsa Dedicated Server

SERVER 2 SM - C:\ac-dedicated - fun AC server on - C:\ac-dedicated - fun\AC Dedicated Server

mike855 commented 5 years ago

Your config.yml is correct?

Nordicdesign commented 5 years ago

according to yaml lint it is syntactically correct. See attached (renamed to .txt so I can add it here)

config.txt

mike855 commented 5 years ago

Did you set different port for each server on : hostname: localhost:8773 Don't forget to change that line with correct exe name : executable_path: acServer.exe

Nordicdesign commented 5 years ago

ok I'm in idiot, renamed a folder and didn't change the config.yml 🤦🏻‍♂️ I'm now logged in both. So in a nutshell

and it works. Thank you so much @mike855 for all the support. By the way your web with those 7 servers looks impressive, top job 👍

Nordicdesign commented 5 years ago

Did you set different port for each server on : hostname: localhost:8773 Don't forget to change that line with correct exe name : executable_path: acServer.exe

so you've also renamed acServer.exe? I've only changed server-manager.exe, and it seems to work. But I haven't put both servers live, I'm on it right now

cj123 commented 5 years ago

i've explored various programming solutions to this, and I don't think any of them are worthwhile. However, I do think that a guide on running multiple instances of Server Manager at once would be useful. Also, the following feature was requested to further facilitate running multiple instances:

would be possible to have 2 separate databases? e.g.

  • settings database (ports, server name, etc..)
  • events / championship / driver databases if you run multiple ACManager instances, it would help a lot cause each panel would have its own settings database but all of them could share the same events, drivers and championships add a custom race to an instance of AC Manager, and it becomes available also for the other ones

so I'm thinking this feature and the guide mentioned above are enough to constitute 'multiserver management' to close this ticket

MisterCadrega commented 5 years ago

Multiserver management is a bit of a weird world. I was thinking: instead of having a single AC Server Manager instance handling multiple acServer instances....why don't we have a single database that stores all the data, which could be fetched by said multiple acServer instances?

Here is the thing, AC Server Manager supports JSON database, which means everything gets stored in a very specific JSON file.

I've been messing up with servers on both Linux and Windows, and found out it's already possible to create a single JSON database manually (following the database structure used by AC Server Manager) and have it symlinked to the database path specified in the path: entry of the config yml file of each AC Server Manager instance.

That way, you can create custom races and championships on an AC Server Manager instance, and they would appear on other instances as well!

There's one catch tho, the JSON database structure was not designed for this (you have to symlink multiple elements), so I'm proposing a redesign of said structure. That would require migration of course, but this could make symlinking way easier. Here is the structure I propose:

- shared/
  - accounts/
  - championships/
  - custom_races/
  - entrants.json

- private/
  - server_options.json
  - audit.json
  - version.json
MisterCadrega commented 5 years ago

Actually symlinking may not even be necessary: thanks to the redesign of the JSON structure we could use a new setting in the config yml file:

store:

  type: json

  # BOLTDB ONLY: where to save the server manager data
  boltdb_path: server_manager.db
  # JSON ONLY: where to save the private AC Server Manager data (server settings, audit logs, etc)
  private_json_path: private_server_manager
  # JSON ONLY: where to save the shared AC Server Manager data (events, championship, and so on)
  shared_json_path: shared_server_manager

Pretty much described everything in the comments: 2 new settings which are read only if you use JSON database. Get rid of the old setting and use either the JSON ones or the BOLTDB one depending on which database we chose to use

cheesegrits commented 5 years ago

@WraithStar @cj123 I'm extremely interested in this enhancement. Is it a definite for the 1.5 roadmap? If so, I'll merge it into my Discord branch, and run it live on my league server, give it a test workout.

BTW, I presume the migration is only for existing JSON installs, it wouldn't migrate Bolt to JSON?

Hecrer commented 5 years ago

The migration is only for existing JSON installs, although the split JSON stores was actually implemented in 1.3.3, so you shouldn't have to merge this!

I think we just need a wiki post on the process to close this ticket.

eliofernandes commented 2 years ago

Here is my configuration, you can see I renamed the server-manager executable, maybe it's the solution for you (I have 7 servers working like that) :

. ├── acfr1 │   ├── acfr1 │   ├── acfr1-2019-05-08-17-56.log │   ├── blacklist.txt │   ├── cfg │   ├── config.yml │   ├── content -> /home/acfr/serveur/assetto_corsa/content │   ├── json │   ├── manager │   ├── results │   ├── server-manager1 │   ├── server-manager.log │   ├── setups │   ├── stracker │   └── system ├── acfr2 │   ├── acfr2 │   ├── acfr2-2019-05-09-13-18.log │   ├── blacklist.txt │   ├── cfg │   ├── config.yml │   ├── content -> /home/acfr/serveur/assetto_corsa/content │   ├── json │   ├── manager │   ├── results │   ├── server-manager2 │   ├── server-manager.log │   ├── setups │   ├── stracker │   └── system

i tried that but no avail, i rename everything after create another folder structure but login will be the same for both web servers and second acserver will not be created :(