Handling multiple servers

Discussion in 'Server & Community Management' started by bloodsplat, May 18, 2013.

  1. Hey guys just wondering if there's any programs or shell scripts that make handling multiple servers a fair bit easier. What I'm looking for is something that can:
    • Update all servers jars eg Spigot to at once or at least iterate through each server and update.
    • Update Certain plugins on each server.
    • Stop/start/ all servers at once.
    Any solutions?
     
  2. Super easy with Linux. Are you using /etc/init.d to run the servers? I'll edit this post and share how I accomplish 2 of the 3 things you are looking for.
    Edit: You can do something like this. With bukkit you could edit the URL to include the latest
    Recommended. I don't see that in spigot so I updated the path for latest.
    Create a script like below and invoke it manually with sh spigotupdate.sh or add it as a cronjob and running it weekly or whatever you are aiming for. Edit the paths to suit your layout.

    Code (Text):

    #!/bin/bash
    # spigotupdate.sh
    # Spigot Update, using latest Spigot
    cd /opt/minecraft/assets
    wget http://ci.md-5.net/job/Spigot/lastSuccessfulBuild/artifact/Spigot-Server/target/spigot.jar
    cp spigot.jar /opt/minecraft/servers/hardcore/hc-spigot.jar
    cp spigot.jar /opt/minecraft/servers/creative/creative-spigot.jar
    cp spigot.jar /opt/minecraft/servers/event/event-spigot.jar

    Edit 2
    If you are using /etc/init.d to run minecraft you can start and stop all servers by adding them to a script or even making an /etc/init.d to rule them all

    Code (Text):
    #!/bin/bash
    # fullrestart.sh
    # Restart all defined servers below
    /etc/init.d/hardcore stop
    /etc/init.d/creative stop
    /etc/init.d/event stop
    sleep 30
    /etc/init.d/hardcore start
    /etc/init.d/creative start
    /etc/init.d/event start
    And for the plugins what you can do is make a folder like /opt/minecraft/assets/plugins and manually download the plugins you want sent to all servers. Then create a bash script that uses some for each logic and for each file in the plugins folder it would use the copy command to the directories you have specified in a script. Would take just a few mins to create the script, but if you have many servers it will be a nice timesaver.
     
    #2 richboos, May 18, 2013
    Last edited: May 18, 2013
    • Informative Informative x 1
    • Useful Useful x 1
  3. richboos Thanks heaps for the examples! never thought of running init.d to run the servers =)
     
  4. jtaylor69

    jtaylor69 Retired Moderator
    Retired

    For updating plugins safely, create an update folder in the plugins directory.
    Please note jar names must match and will update plugins on restart :)