Tuesday 8 February 2011

Configuring Netapp filer for rsh connections

So you need to connect to your Netapp filer via rsh. Maybe for example you wish to coordinate the snapshot on a volume with some other specific events in a script, as I did to perform consistent Oracle database backups.

So how do you set it up for this?

First we need to check that the Netapp settings allow rsh, it is allowed by default but it is worth us checking. Login to the filer via telnet and checks the rsh.enable parameter:

Netapp_filer> options rsh.enable
rsh.enable on

If it is set to off, we will need to turn it on with:

Netapp_filer> options rsh.enable=on

Now we need to allow our host to connect via rsh. We will also define it for a specific user as we don't want to.make the system too insecure by letting everyone run system commands on the filer!

First we need read/write access to the root filesystem on the Netapp, so we need to share the /vol/vol0 volume with read/write permissions through the nfs section of the GUI - I am not going to document that step here as it is a common task when setting up nfs shares. I will however remind you to hit the "export all" button once you have set it up, otherwise you will be left scratching your head as to why you cannot mount the filesystem as expected!

Now navigate to the /etc directory of this filesystem, and make a backup of the hosts and hosts.equiv files:

Linux> cd /vol0/etc
Linux> cp hosts hosts_080211
Linux> cp hosts.equiv hosts.equiv_080211

We know need to add our host to the hosts file, I.e. add the line:

1.2.3.4 our_host

Then we need to add the hostname and account name to the hosts.equiv file. Here we are using the Oracle account so the line we will add is:

our_host oracle

Once this is complete, we should be able to confirm the rsh command is working. To test try the following command whilst logged into the oracle account on our_host:

rsh -l root Netapp_filer df -k

This should return the df output of the filesystem on the Netapp filer.

3 comments:

  1. We are trying to do the same thing with Oracle & NetApp - could you by any chance provide your script?

    Are you using SnapMirror with it as well?

    ReplyDelete
  2. We have the tableepace files on a separate volume, then the control, redo and archivelogs on a shared volume, with the other db's.

    Then the script essentially does the following:

    1. Select all tablespaces in the database except temp tablespace and put them into hot backup mode
    2. Rsh to filer and remove oldest snapshot
    3. Rsh to filer and rename last snapshot to older snapshot
    4. Rsh to filer and take a new snapshot
    5. Take all tablespaces out of hot backup mode
    6. Alter system switch logfile
    7. Backup controlfile to trace

    Then later on we backup the snapshot to tape along with taking a ndmp backup of the control, redo and archivelogs volume.

    I am thinking of changing the rsh connection, to ssh so as to increase the security and lock down the connection a bit. But that won't be till next month as I am massively busy at the moment!

    We are not using snspmirror and rely on backups to tape.

    Hope this helps!

    Matthew

    ReplyDelete
  3. You can short circuit the nfs export process if you are able to ssh onto the box. use wrfile /etc/hosts and wrfile /etc/hosts.equiv to just add that quick line.

    ReplyDelete