Running 2 or more instances of seafile pro on one server

I am running 4 seafile server on 1 physical maschine (3 CE + 1 PRO)
every seafileserver has its own user and folder

/srv/seafile-1/ running with user seafile-1
/srv/seafile-2/ running with user seafile-2
/srv/seafile-3/ running with user seafile-3
/srv/seafile-4/ running with user seafile-4

Everything is running fine.

I would like to support seafile Ltd. by buying additional pro licenses.
the problem is, running more than one PRO causes an error:

./seafile-pro-server-5.1.10/seafile.sh start

[seafevents] is running, pid 8026. You can stop it by:

    kill 8026

Stop it and try again.

Is there a workaround for that?

thx in advance,
fabian

1 Like

We’ve fixed that part of seafile.sh script, and it would be included in the next release. For a quick fix, you can use the latest version of it https://download.seafile.com/f/9839513ef9/

cd /path/to/seafile-pro-server-5.1.10
cp seafile.sh seafile.sh.bak
wget -O seafile.sh https://download.seafile.com/f/9839513ef9/?raw=1
chmod +x seafile.sh

Now you can try run multiple instances with the new script.

2 Likes

Hi @lins05

thx. working perfetct!

I have a simelar problem in the update script since version 5.

you might would like to fix it too :slight_smile:

How did you do that?

The current seahub.sh has this function

function validate_seahub_running () {
    if pgrep -f "${manage_py}" 2>/dev/null 1>&2; then
        echo "Seahub is already running."
        exit 1;
    elif pgrep -f "seahub.wsgi:application" 2>/dev/null 1>&2; then
        echo "Seahub is already running."
        exit 1;
    fi
}

which will not start seahub as soon as a seahub process is already running.

I am reluctant to hack these scripts myself, plus these fixes would be gone with the next update anyway.

How did you achieve parallel instances starting up and running?

Which version do you use?
I am still using v5. x.
And each instance runs under its own user. The home directory of the user contains the installation of Seafile.

And you have to assign the database names manually.

And with the web server (e. g. Appache2) always use different ports for the reverse proxy.

FastCGIExternalServer /var/www/user1/seahub.fcgi -host 127.0.0.1:8000
FastCGIExternalServer /var/www/user2/seahub.fcgi -host 127.0.0.1:8001
FastCGIExternalServer /var/www/user3/seahub.fcgi -host 127.0.0.1:8002
FastCGIExternalServer /var/www/user4/seahub.fcgi -host 127.0.0.1:8003
FastCGIExternalServer /var/www/user5/seahub.fcgi -host 127.0.0.1:8004

Best regards
Fabian

I use the latest, 6.1.2.

Yes, that is what I am trying to set up.

I think I will have to patch the scripts.

thats my seafile.sh:

function check_component_running() {
    name=$1
    cmd=$2
    if pid=$(pgrep -f "$cmd" 2>/dev/null); then
        echo "[$name] is running, pid $pid. You can stop it by: "
        echo
        echo "        kill $pid"
        echo
        echo "Stop it and try again."
        echo
        exit
    fi
}

function validate_already_running () {
    if pid=$(pgrep -f "seafile-controller -c ${default_ccnet_conf_dir}" 2>/dev/null); then
        echo "Seafile controller is already running, pid $pid"
        echo
        exit 1;
    fi

    check_component_running "ccnet-server" "ccnet-server -c ${default_ccnet_conf_dir}"
    check_component_running "seaf-server" "seaf-server -c ${default_ccnet_conf_dir}"
    check_component_running "fileserver" "fileserver -c ${default_ccnet_conf_dir}"
    check_component_running "seafdav" "wsgidav.server.run_server"
}

you can try

pgrep -u $USER seaf-server

@lins05 could you take a look at that again?

see also: Multiple Seafile instances on one machine