Results 1 to 4 of 4

Thread: Amrecover : Connection reset by peer

  1. #1

    Default Amrecover : Connection reset by peer

    Hello everyone,

    I've followed all how-to available on differents amanda sites but I can't get the amrecover command working.

    This is my config :
    1 Amanda server 2.5.1p2
    1 Amanda client 2.5.1p2

    Everything is ok to get amdump working and amcheck doesn't display any error. I can do an amrecover on the server itself (cause the server does backup itself, too).

    On the server :
    - /var/spool/amanda/.amandahosts :
    Code:
    server.domain amanda amdump
    server.domain root amindexd amidxtaped
    client.domain root amindexd amidxtaped
    - /etc/hosts is ok and contains the full qualified name of both the server and the client
    - /etc/amanda/amanda-client.conf :
    Code:
    conf "daily"
    index_server "server.domain"
    tape_server "server.domain"
    tapedev "/dev/nst0"
    auth "bsdtcp"
    - /etc/xinetd.d/amanda :
    Code:
    service amanda
    {
            socket_type     = stream
            protocol        = tcp
            wait            = no
            user            = amanda
            group           = amanda
            groups          = yes
            server          = /usr/libexec/amandad
            server_args     = -auth=bsdtcp amdump amindexd amidxtaped
            # You need to ensure this points to your Amanda server!
            # Don't just remove it!
            only_from       = server.domain client.domain
            disable         = no
    }
    
    service amandaidx
    {
            socket_type     = stream
            protocol        = tcp
            wait            = no
            user            = amanda
            group           = amanda
            groups          = yes
            server          = /usr/libexec/amindexd
            # You need to ensure this points to your Amanda server!
            # Don't just remove it!
            only_from       = server.domain client.domain
            disable         = no
    }
    
    service amidxtape
    {
            socket_type     = stream
            protocol        = tcp
            wait            = no
            user            = amanda
            group           = amanda
            groups          = yes
            server          = /usr/libexec/amidxtaped
            # You need to ensure this points to your Amanda server!
            # Don't just remove it!
            only_from       = server.domain client.domain
            disable         = no
    }
    - When I perform a netstat -a on the server :
    Code:
    tcp        0      0 *:amanda                *:*                     LISTEN      
    tcp        0      0 *:amandaidx             *:*                     LISTEN      
    tcp        0      0 *:amidxtape             *:*                     LISTEN

    On the client :
    - /var/spool/amanda/.amandahosts :
    Code:
    server.domain amanda amdump
    - /etc/amanda/amanda-client.conf :
    Code:
    conf "daily"
    index_server "server.domain"
    tape_server "server.domain"
    tapedev "/dev/nst0"
    auth "bsdtcp"
    - /etc/xinetd.d/amanda :
    Code:
    service amanda
    {
            socket_type     = stream
            protocol        = tcp
            wait            = no
            user            = amanda
            group           = amanda
            groups          = yes
            server          = /usr/libexec/amandad
            server_args     = -auth=bsdtcp amdump amindexd amidxtaped
            # You need to ensure this points to your Amanda server!
            # Don't just remove it!
            only_from       = server.domain
            disable         = no
    }
    
    service amandaidx
    {
            socket_type     = stream
            protocol        = tcp
            wait            = no
            user            = amanda
            group           = amanda
            groups          = yes
            server          = /usr/libexec/amindexd
            # You need to ensure this points to your Amanda server!
            # Don't just remove it!
            disable         = yes
    }
    
    service amidxtape
    {
            socket_type     = stream
            protocol        = tcp
            wait            = no
            user            = amanda
            group           = amanda
            groups          = yes
            server          = /usr/libexec/amidxtaped
            # You need to ensure this points to your Amanda server!
            # Don't just remove it!
            disable         = yes
    }
    But, when I perform a amrecover on my client, I get this message :
    AMRECOVER Version 2.5.1p2. Contacting server on -nameofclient- ...
    [request failed: recv error: Connection reset by peer]

    I've tried writing the complete amrecover command with options, like this :
    amrecover -s server.domain -t server.domain -d /dev/nst0
    but I get the same message.

    And the weird thing is, when I look in the client logs (/var/spool/amanda/tmp/client/daily/amrecover<timestamp>.debug), I see that the client try to connect to its own IP address instead of the server !
    Code:
    ...
    amrecover: connect_port: Skip port 526: Owned by tempo.
    amrecover: connect_port: Try  port 527: Available   -
    amrecover: connected to 192.168.136.170.10080 <--- client IP address
    amrecover: our side is 0.0.0.0.527
    amrecover: try_socksize: send buffer size is 65536
    amrecover: try_socksize: receive buffer size is 65536
    security_stream_seterr(0x805be68, recv error: Connection reset by peer)
    security_seterror(handle=0x805b9e8, driver=0xb7edd140 (BSDTCP) error=recv error: Connection reset by peer)
    security_close(handle=0x805b9e8, driver=0xb7edd140 (BSDTCP))
    security_stream_close(0x805be68)
    Any help would be very very very appreciated.

    Thanks.

  2. #2
    Join Date
    Apr 2006
    Posts
    116

    Default xinetd

    Hello,

    The reason you are having connection issues is because your xinetd configs are incorrect.
    Please read this document to find a solution:
    [url]http://www.zmanda.com/quick-backup-setup.html[/url]

    Pavel
    Thanks

  3. #3

    Default

    Hello,

    Thanks for your reply. I've tried putting in my xinetd amanda file the same lines that in the tutorial. But if I remove the only_from directive in the xinetd amanda service config file, both on the client and the server, I got an error message while trying to perform an amcheck. If I put the directive allowing everyone connecting to this service (only_from = 0.0.0.0), the amcheck is ok.
    But, now when I launch an amrecover from the client, as user root, I got the following message :
    Code:
    AMRECOVER Version 2.5.1p2. Contacting server on -clientname- ...
    NAK: user root from client.domain is not allowed to execute the service amindexd: Please add "amindexd amidxtaped" to the line in /var/spool/amanda/.amandahosts
    On the server, the lines in the .amandahosts file are ok :
    Code:
    server.domain amanda amdump
    server.domain root amindexd amidxtaped
    client.domain root amindexd amidxtaped
    But, as I said before, I'm sure that the client is trying to connect to itself and not to the server.domain as indicated in /etc/amanda/amanda-client.conf

    Even if I explicitly give it the name of server with :
    Code:
    amrecover -s server.domain -t server.domain
    it gives me the same answer..

    By the way, my xinetd amanda service file, now looks like this :
    On the server :
    Code:
    service amanda
    {
            disable         = no
            socket_type     = stream
            protocol        = tcp
            wait            = no
            user            = amanda
            group           = amanda
            groups          = yes
            server          = /usr/libexec/amandad
            server_args     = -auth=bsdtcp amdump amindexd amidxtaped
            only_from       = 0.0.0.0
    }
    On the client :
    Code:
    service amanda
    {
            disable         = no
            socket_type     = stream
            protocol        = tcp
            wait            = no
            user            = amanda
            group           = amanda
            groups          = yes
            server          = /usr/libexec/amandad
            server_args     = -auth=bsdtcp amdump
            only_from       = 0.0.0.0
    }
    Thanks for replies.

  4. #4

    Default

    I finally found the reason of my problem. In fact, my Amanda client is set on a Gentoo server. Each time I launched amrecover, it tried to connect to the Amanda server set in the environement variable $AMANDA_SERVER
    But the problem is that even if a /etc/amanda/amanda-client.conf exists, amrecover doesn't override the $AMANDA_SERVER variable with the settings contained in this file nor with the amrecover command line options.. Strange.
    So, on Gentoo, the solution is to edit the file /etc/env.d/97amanda and to change this :
    Code:
    AMANDA_SERVER=server.domain
    AMANDA_SERVER_INDEX=server.domain
    AMANDA_SERVER_TAPE=server-domain
    Then, as root, type :
    Code:
    env-update && source /etc/profile
    Then, it works. At least for me.
    If it can help...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •