on 07-13-2012 11:38 AM
NFS mount for backups on NCS:
nms-kate/admin# backup verifying_nfs repository nfsVictoria application NCS
% Creating backup with timestamped filename: verifying_nfs-120713-1055.tar.gpg
Stage 1 of 7: Database backup ...
-- complete.
Stage 2 of 7: Database copy ...
-- complete.
Stage 3 of 7: Backing up support files ...
-- complete.
Stage 4 of 7: Compressing backup ...
-- complete.
Stage 5 of 7: Building backup file ...
-- complete.
Stage 6 of 7: Encrypting backup file ...
-- complete.
Stage 7 of 7: Transferring backup file ...
-- complete.
nms-kate/admin#
NCS Config:
backup-staging-url nfs://nms-victoria.cisco.com:/var/nfs
repository nfsVictoria
url nfs://nms-victoria.cisco.com:/var/nfs
NFS Config ( Centos ):
Install nfs:
yum install nfs-utils nfs-utils-lib
chkconfig --levels 35 nfs on
chkconfig --levels 35 portmap on
service portmap start
service nfs start
Create the share and set permissions:
mkdir -p /var/nfs
chown 65534:65534 /var/nfs
chmod 755 /var/nfs/etc/exports:
/var/nfs 172.18.123.0/16(rw,sync,no_subtree_check)
run the command "exportfs -a"
You should be able to see what you are exporting then with:
nms-victoria:/var# exportfs
/var/nfs 172.18.123.0/16nms-victoria:/var# showmount -e localhost
Export list for localhost:
/var/nfs 172.18.123.0/16
Verify services are running:
nms-victoria:/media/sschmidt# rpcinfo -p rpcinfo: can't contact portmapper: RPC: Remote system error - Connection refused
Portmap is not running
service portmap start
nms-victoria:/media/sschmidt# rpcinfo -p
program vers proto port
100000 2 tcp 111 portmapper
100000 2 udp 111 portmapper
Not seeing all the other ports and services -
service nfs restart
From machine that is configured for NFS:
nms-victoria:/media/sschmidt# rpcinfo -p
program vers proto port
100000 2 tcp 111 portmapper
100000 2 udp 111 portmapper
100011 1 udp 861 rquotad
100011 2 udp 861 rquotad
100011 1 tcp 864 rquotad
100011 2 tcp 864 rquotad
100003 2 udp 2049 nfs
100003 3 udp 2049 nfs
100003 4 udp 2049 nfs
100021 1 udp 33690 nlockmgr
100021 3 udp 33690 nlockmgr
100021 4 udp 33690 nlockmgr
100003 2 tcp 2049 nfs
100003 3 tcp 2049 nfs
100003 4 tcp 2049 nfs
100021 1 tcp 60276 nlockmgr
100021 3 tcp 60276 nlockmgr
100021 4 tcp 60276 nlockmgr
100005 1 udp 876 mountd
100005 1 tcp 879 mountd
100005 2 udp 876 mountd
100005 2 tcp 879 mountd
100005 3 udp 876 mountd
100005 3 tcp 879 mountd
From a machine that is in the same subnet:
linuxlabciscocom:/mnt/nfs/var/nfs# rpcinfo -p 172.18.123.241
program vers proto port
100000 2 tcp 111 portmapper
100000 2 udp 111 portmapper
100011 1 udp 861 rquotad
100011 2 udp 861 rquotad
100011 1 tcp 864 rquotad
100011 2 tcp 864 rquotad
100003 2 udp 2049 nfs
100003 3 udp 2049 nfs
100003 4 udp 2049 nfs
100021 1 udp 33690 nlockmgr
100021 3 udp 33690 nlockmgr
100021 4 udp 33690 nlockmgr
100003 2 tcp 2049 nfs
100003 3 tcp 2049 nfs
100003 4 tcp 2049 nfs
100021 1 tcp 60276 nlockmgr
100021 3 tcp 60276 nlockmgr
100021 4 tcp 60276 nlockmgr
100005 1 udp 876 mountd
100005 1 tcp 879 mountd
100005 2 udp 876 mountd
100005 2 tcp 879 mountd
100005 3 udp 876 mountd
100005 3 tcp 879 mountd
Either disable iptables or add the ports from above
service iptables stop chkconfig iptables off
To mount from another linux machine:
Create mount point and mount:
mkdir -p /mnt/nfs/var/nfs
mount 172.18.123.241:/var/nfs /mnt/nfs/var/nfs
Verify:
linuxlabciscocom:/mnt/nfs/var/nfs# mount
172.18.123.241:/var/nfs on /mnt/nfs/var/nfs type nfs (rw,addr=172.18.123.241)
Windows NFS server config:
The best document I have found is this write up of the process from Microsoft MSDN:
Nice Doc Rollin..
Thank you for taking the time to make this document. It was very useful when I needed to backup Cisco Prime to NFS.
The following PowerShell script can be used to install and configure NFS on Windows Server 2012 R2:
### # Set variables ### $CiscoPrimeIPAddress = "IP address of Cisco Prime Infrastructure" $nfsServer = $env:ComputerName $nfsRepoName = "nfsRepo" $nfsRepoRoot = "C:\nfsRepo" $nfsRepoStaging = "staging" $nfsRepoStorage = "storage" ### # Create the files group and passwd in %SystemRoot%\System32\drivers\etc to be used as a user mapping source. ### New-Item "${env:SystemRoot}\System32\drivers\etc\group" -Type File -Value "BUILTIN\Administrators:x:0:root" New-Item "${env:SystemRoot}\System32\drivers\etc\passwd" -Type File -Value "${nfsServer}\Administrator:x:0:0:root::" ### # Install Server for NFS Role ### Import-Module ServerManager Add-WindowsFeature FS-NFS-Service Import-Module NFS ### # Create staging and storage folders ### New-Item -ItemType Directory -Path ${nfsRepoRoot}\${nfsRepoStaging} New-Item -ItemType Directory -Path ${nfsRepoRoot}\${nfsRepoStorage} New-Item "${nfsRepoRoot}\${nfsRepoStorage}\test.txt" -Type File ### # Create new share ### New-NfsShare -Name $nfsRepoName -Path $nfsRepoRoot -AllowRootAccess $False -Authentication Sys -EnableAnonymousAccess $False -EnableUnmappedAccess $False -Permission No-Access ### # Grant permission to CPI ### Grant-NfsSharePermission -Name $nfsRepoName -ClientName $CiscoPrimeIPAddress -ClientType "Host" -Permission "ReadWrite" -AllowRootAccess $True ### # Output Cisco Prime Config ### $Output = @" configure terminal backup-staging-url nfs://${nfsServer}:/${nfsRepoName}/${nfsRepoStaging} repository ${nfsRepoName} url nfs://${nfsServer}:/${nfsRepoName}/${nfsRepoStorage} end show repository ${nfsRepoName} "@ Write-Host "After running the following config on CPI you should get test.txt as output" -ForegroundColor "Yellow" Write-Host $Output -BackgroundColor "Black" -ForegroundColor "Green"
Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: