1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

run 2 card proxy server at the same time

Discussion in 'CSP Discussion and Questions' started by jadidemohaabdo, Mar 28, 2013.

Thread Status:
Not open for further replies.
  1. Offline
    jadidemohaabdo

    jadidemohaabdo Member Member

    Messages:
    51
    Likes Received:
    0
    Trophy Points:
    6
    Country:
    Possible help run 2 card proxy server at the same time
  2. Offline
    ktzelepi
    Wtf

    ktzelepi Moderator Staff Member Moderator

    Messages:
    836
    Likes Received:
    397
    Trophy Points:
    63
    Country:
    Brazil
    1) make 2 copys of csp (csp1, csp2)
    2) copy the 2 foldes in /usr/local/
    3) open file cardproxy.sh.ubuntu-autostart and change the line DAEMONPATH=/usr/local/csp to
    DAEMONPATH=/usr/local/csp1
    and DAEMONPATH=/usr/local/csp2 for each version
    4) in proxy.xml of /usr/local/csp2, change
    a)
    <status-web>
    <listen-port>8083</listen-port>
    b)
    rmi/registry-port to 4096
    rmi/local-port to 4097
    c)
    clustered cache port have to be different on both csp's
    d)
    port of profiles have to be different on both csp's

    now start both csp's

    /usr/local/csp1/cardproxy.sh.ubuntu-autostart start
    /usr/local/csp2/cardproxy.sh.ubuntu-autostart start

    and you have 2 csp's running in the same time.
  3. Offline
    jadidemohaabdo

    jadidemohaabdo Member Member

    Messages:
    51
    Likes Received:
    0
    Trophy Points:
    6
    Country:
    Thanks for the follow-up

    error

    root@vmi1286:/var/csp1# cd /var/csp1
    root@vmi1286:/var/csp1# ./cardproxy1.sh start
    starting cardservproxy: [ failed ]
    configuration error:
    - element: <rmi (/cardserv-proxy)
    - message: Unable to initialize rmi: Java.rmi.server.exportexceptio n: Port already in use: 4099; nested exception is:
    Java.net.bindexception: Address already in use
    root@vmi1286:/var/csp1#
  4. Offline
    ktzelepi
    Wtf

    ktzelepi Moderator Staff Member Moderator

    Messages:
    836
    Likes Received:
    397
    Trophy Points:
    63
    Country:
    Brazil
    you have to follow my steps.

    you don't have done step 3
  5. Offline
    jadidemohaabdo

    jadidemohaabdo Member Member

    Messages:
    51
    Likes Received:
    0
    Trophy Points:
    6
    Country:
    where are
    DAEMONPATH=/usr/local/csp1 ????
    ===================

    cardproxy.sh
    ==========
    #!/bin/bash

    case "`uname -s`" in

    'CYGWIN'*)
    SYSTEM="Cygwin"
    ;;

    'Linux')
    SYSTEM="Linux"
    ;;

    'OSF1')
    SYSTEM="Tru64"
    ;;

    'SunOS')
    SYSTEM="Solaris"
    ;;

    *)
    SYSTEM="Unknown"
    ;;

    esac

    PID_FILE=cardservproxy.pid

    serverpid() {
    if [ -f $PID_FILE ]; then
    if [ "$SYSTEM" = "Cygwin" ]; then
    PID=`cat $PID_FILE`
    if [ "x"$PID != "x" ]; then
    if [ -n "`ps | grep $PID`" ]; then
    cat $PID_FILE
    return
    fi
    fi
    else
    if [ "$SYSTEM" = "Solaris" ]; then
    if [ -n "`cat $PID_FILE | xargs ps -p | tail +2`" ]; then
    cat $PID_FILE
    return
    fi
    else
    if [ -n "`cat $PID_FILE | xargs ps | tail -n +2`" ]; then
    cat $PID_FILE
    return
    fi
    fi
    fi
    fi
    echo -n 0
    }

    echoresult() {
    echo -n " "
    $MOVE_TO_COL
    echo -n "[ "
    echo -n $1
    echo " ]"
    shift
    if [ "$#" != "0" ] ; then echo "$1" ; fi
    }

    case "$1" in

    'start')
    echo -n "Starting CardServProxy:"
    if [ "`serverpid`" != "0" ]; then
    echoresult FAILED "An instance of the server is already running"
    exit 1
    fi
    java -Dsun.net.inetaddr.ttl=0 -jar lib/cardservproxy.jar > log/cardserv-sysout.log 2>&1 &
    echo $! > $PID_FILE
    sleep 3
    ERR=`cat log/cardserv-sysout.log | grep '[Ee]rror\|[Ee]xception\|[Ff]ailed\|not found'`
    if [ "$ERR" ]; then
    echoresult FAILED
    cat log/cardserv-sysout.log
    OP=`serverpid`
    if [ $OP != "0" ]; then
    kill $OP
    fi
    rm $PID_FILE
    exit
    else
    echoresult OK
    fi
    ;;

    'stop')
    echo -n "Killing Proxy:"
    OP=`serverpid`
    if [ $OP != "0" ]; then
    rm $PID_FILE
    kill $OP
    echoresult OK
    else
    echoresult FAILED "Cannot determine pid"
    fi
    ;;

    'dump')
    echo -n "Sending SIGQUIT:"
    OP=`serverpid`
    if [ $OP != "0" ]; then
    kill -3 $OP
    echoresult OK
    else
    echoresult FAILED "Cannot determine pid"
    fi
    ;;

    'status')
    OP=`serverpid`
    if [ $OP = "0" ]; then
    echo "Proxy is stopped"
    exit 1
    else
    echo "Proxy (pid $OP) is running..."
    exit 0
    fi
    ;;

    *)
    echo "Usage: $0 {start|stop|status|dump}"
    exit 1
    ;;

    esac

    exit $?
  6. Offline
    ktzelepi
    Wtf

    ktzelepi Moderator Staff Member Moderator

    Messages:
    836
    Likes Received:
    397
    Trophy Points:
    63
    Country:
    Brazil
    you edit the wrong file.
    you have to edit:
    "cardproxy.sh.ubuntu-autostart"
    then make executable and start csp from cardproxy.sh.ubuntu-autostart.
    working on ubuntu and debian as well.
  7. Offline
    jadidemohaabdo

    jadidemohaabdo Member Member

    Messages:
    51
    Likes Received:
    0
    Trophy Points:
    6
    Country:

    GOOD
    10/10

    seiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii grande amigo



    grazieeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeMOLTO,,,,.
  8. Offline
    MultiCS™
    Classy

    MultiCS™ Administrator Staff Member Administrator

    Messages:
    4,745
    Likes Received:
    354
    Trophy Points:
    83
    Country:
    Estonia
    [on]Solved+Locked[/on]
Thread Status:
Not open for further replies.

Share This Page