樓主發(fā)這臺(tái)深了! 看不懂!
OMS升級(jí)詳解及Linux操作
•OMS Upgrade
•Basic Shell Commands for OMS Users
•Linux File System
•File Management
•Networking in Linux
OMS升級(jí)
一、通過(guò)U盤拷貝升級(jí)包(由于升級(jí)包太大,F(xiàn)TP上傳會(huì)斷)
1、備注: dev 下面不可隨意創(chuàng)建目錄。(dev類似于windows操作系統(tǒng)的文件夾)
@mkdir /media/FP 創(chuàng)建media的文件夾才能識(shí)別到U盤
@插上U盤后會(huì)在dev目錄下會(huì)出現(xiàn)一個(gè)sdc的文件夾。
@mount /dev/sdc /media/FP 執(zhí)行后會(huì)出現(xiàn)一條mount: you must specify the filesystem type 提示!,可用ls /dev/查看一下
dev 下面是否有sdc1這個(gè)文件夾了。
@mount /dev/sdc1 /media/FP 執(zhí)行這條命令,ok!
@cd /media/FP 進(jìn)入到所建的文件夾下面ls,可找到tmp文件夾了
命令如下:
#mkdir /media/FP
#mount /dev/sdc /media/FP
#mount /dev/sdc1 /media/FP將/dev/sdc1掛在/media/FP之下
#cd /media/FP/tmp
[root@CLA-0(RNC-9) /media/FP/tmp]
# ls
R_OMS1_4.41.release_oms.corr11-inc-1.rpmR_OMS1_4.42.release_oms.corr19-inc-1.rpmR_OMS1_4.42.release_oms.corr26-inc-1.rpm
R_OMS1_4.41.release_oms.corr12-inc-1.rpmR_OMS1_4.42.release_oms.corr20-inc-1.rpmR_OMS1_4.42.release_oms.corr27-inc-1.rpm
R_OMS1_4.41.release_oms.corr13-inc-1.rpmR_OMS1_4.42.release_oms.corr21-inc-1.rpmR_OMS1_4.42.release_oms.corr28-inc-1.rpm
R_OMS1_4.41.release_oms.corr14-inc-1.rpmR_OMS1_4.42.release_oms.corr22-inc-1.rpmR_OMS1_4.42.release_oms.corr29-inc-1.rpm
R_OMS1_4.42.release_oms.corr16-inc-1.rpmR_OMS1_4.42.release_oms.corr23-inc-1.rpmR_OMS1_4.42.release_oms.corr30-inc-1.rpm
R_OMS1_4.42.release_oms.corr17-inc-1.rpmR_OMS1_4.42.release_oms.corr24-inc-1.rpm
R_OMS1_4.42.release_oms.corr18-inc-1.rpmR_OMS1_4.42.release_oms.corr25-inc-1.rpm
msu_rn4.bz
msu_rn4.md5
2、@cp * /home/Nemuadmin & 復(fù)制文件到Nemuadmin下面,&是讓進(jìn)程在后臺(tái)進(jìn)行。
# cp R* /home/Nemuadmin
# cp m* /home/Nemuadmin &
# cd /home/Nemuadmin
# ll
3、@# mv msu_rn4.bz MSU_RN4.bz把文件名改成大寫,在U盤內(nèi)修改不了,等cp完后再對(duì)文件名進(jìn)行修改。
# mv msu_rn4.bz MSU_RN4.bz
# mv msu_rn4.md5 MSU_RN4.md5
[root@CLA-0(RNC-9) /home/Nemuadmin]
# df –h 查看空間大小
二、Install the RN4.0 upgrade support correction.
#fsswcli--delivery—install 中間用空格格開(kāi)
R_OMS1_4.41.release_oms.corr11-inc-1.rpm
R_OMS1_4.41.release_oms.corr12-inc-1.rpm
R_OMS1_4.41.release_oms.corr13-inc-1.rpm
R_OMS1_4.41.release_oms.corr14-inc-1.rpm
# fsswcli --set –list/current//Check current sw level
R_OMS1_4.41.release_oms.corr10
R_OMS1_4.41.release_oms.corr14
Upgrade LDAP data:
# fsswcli --ldap --upgrade R_OMS1_4.41.release_oms.corr14
Activate new software set:
# fsswcli --set --activate R_OMS1_4.41.release_oms.corr14
Activating the LDAP database for set R_OMS1_4.41.release_oms.corr14
After activateset command, OMS is restarted with new software set.
三、Separating the upgrade disk in the OMS
# fsswcli --major –disklock
四、Install a disk image to the upgrade disk.
Before copying check that upgrade image is not corrupted with md5sum.
# md5sum -c MSU_RN4.md5
MSU_RN4.bz: OK
Installing a disk image locally into OMS disk.
# fsswcli --major --install MSU_RN4.bz &//后臺(tái)安裝,需要大概1個(gè)多小時(shí)時(shí)間
五、Execute data conversion scripts//
# fsswcli --major –convert
Execute the installation cutover//To separate the live disk from the system and cancel the separation of the upgrade disk.
# fsswcli --major –cutover
During cutover, OMS is restarted twice.
六、Finalizing the new installation in the target
Environment
Execute the post-configuration script
# fsswcli --major --postconfigure
Node CLA-0 unlocked
Do you want to create partitions for SAN-1 and up (y/n) [y]: n
Do you want to synchronize the CLA-0 system time to other nodes (y/n) [y]: y
Do you want to execute noderc level 5 scripts (y/n) [y]: y
七、To convert the databases and transfer measurements xml files to the new System
# /opt/Nokia/SS_OMSINST/msu/Complete_MSU_Upgrade.sh
When Complete_MSU_Upgrade is finished system is on RN4.0 level
and ready be used. Rollback is still possible at this point
八、Committing the system to the new installation
# fsswcli --major –commit//大概40分鐘
The rollback is no longer possible after executing the fsswcli --major
--commit command. Please be patient, committing takes about 40
minutes. Do not close the connection and do not stop the script.
# fsbackup –f 全備包
Basic Shell Commands for OMS Users
cd (change working directory)
pwd (print working directory)
•Print working directory. Enter pwd
•Change working directory to /home. Enter cd /home
•Print again working directory. Enter pwd
# pwd
/root
# cd /home
# pwd
/home
ls (short listing) and ll (long listing)
Change working directory to root directory
[root@CLA-0(RNC-309) /root] # cd /
Short list of root directory contents
[root@CLA-0(RNC-309) /] # ls
binhomemediaprocsrv usr
bootinitrdmiscrootsys var
devlibmnt sbintftpboot
etclost+foundopt selinuxtmp
Long list of root directory contents
[root@CLA-0(RNC-309) /] # ll
total 170
drwxr-xr-x 2 root root4096 Nov 12 23:21 bin
drwxr-xr-x 4 root root1024 Nov 12 20:06 boot
drwx------ 2 root root 16384 Nov 12 20:26 lost+found
Auto complete function (TIPS!)
•Linux has auto complete function when you type in a file or directory path name.
•Used when you need to type in long file or directory path name.
•It gives you option for available files or directory paths name when it could not do auto complete
# cd /var/
# cd /var/
Press ‘Tab’ twice it will list all available options
.HAS/ local/opt/
_has_smr.serializedlock/ preserve/
cache/log/run/
crash/mail/ run_boot/
db/mnt/spool/
empty/named/tmp/
ftp/net-snmp-5.3.1/www/
lib/nis/yp/
man (format and display on-line manual pages)
•Get on-line manual pages for a command using man
•Type in the following command to get manual for ‘tail’
“copy” and “paste” in RedHat (TIP!)
•Shutdown brings the system down in a secure way.All logged-in users are notified that the system is going down, and login is blocked.
•It is possible to shut the system down immediately or after a specified delay.All processes are first notified that the system is going down by the signal SIGTERM.
–Option -h halts the systemafter shutdown.
–Option –r reboots the system after shutdown.
–Option now shuts down immediately.
df (report filesystem disk space usage)
df displaystheamountofdisk space available on the filesystem. Command df –h printssizes in human readable format.
You can check the amount of available disk space for making a OMS backup. Enter
df -h /var/mnt/local/backup.
# df -h /var/mnt/local/backup/
FilesystemSizeUsed Avail Use% Mounted on
/dev/md59.7G54M9.1G1% /var/mnt/local/backup
tail (output the last part of files)
Sometimes it is usefull to read only the last lines of the file. Especially reading the logs the last lines are important.
read master-system log (OMS only). Enter
tail -f /var/log/master-syslog
# tail -f /var/log/master-syslog | grep -i error
Oct 24 14:03:32 err CLA-0 PMDataDBServer/MySQLWD[9787]: mySQLInterface: stat error in DB free size get; file=/var/mnt/local/MySQL_DB_PMData/ibdata/ibdata1 errno=75 MySQLWD
nano (Nano's ANOther editor, an enhanced free Pico clone)
There are various text editors in Linux, but nano is typically referred in OMS documentation.
Create a file and edit. Enter nano
nano -w /home/student/testfile
After editing the file, exit by strike ”Ctrl” and ”x” simultaneusly
Strike ”y” to confirm changes
Strike ”enter” to exit.
less (read a file)
less – a more advanced version of more paging through text one screenful at a time
”less is more”
Try different shells to print a file. Enter
cat /home/student/testfile
more /home/student/testfile
less /home/student/testfile
“|” (pipe)
Piping allowes to pipe commands together. The output from the first commandis piped as input for the latter command.
Note! Pipe character you find from keyboard stroking ”AltGr” and ”<” simultaneusly.
Look for errors from master-syslog (located in OMS only). Enter
tail -f /var/log/master-syslog | grep –i error
# tail -f /var/log/master-syslog | grep error
Oct 24 14:03:32 err CLA-0 PMDataDBServer/MySQLWD[9787]: mySQLInterface: stat error in DB free size get; file=/var/mnt/local/MySQL_DB_PMData/ibdata/ibdata1 errno=75 MySQLWD
“>” or tee (read from standard input and write to stadard output and files)
Practical method on writing the output of a command to a file e.g writing script output to a file.
Display testfile file and copy the content to dest_testfile file. Enter
less/home/student/testfile | tee /home/dest_testfile
Note! You can also use ”>”. Run the EnvCam script and direct the result to the file. Enter
less/home/student/testfile > /home/dest_testfile
“./” (run a script which is not in the path)
To run a script which is not in the path, you must add ./ before the script name
Run script which in the path
CompleteOMS_USBInstallation.sh
Run script which is not in the path.
./CompleteOMS_USBInstallation.sh
Note! You can interrogate current path. Enter echo $PATH
#echo$PATH/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/opt/Nokia_BP/sbin:/opt/Nokia/sbin:/usr/local/bin:/opt/Nokia_BP/bin:/opt/Nokia/bin:/opt/visibroker/bin:/opt/visibroker/sbin:/opt/SunJ2SE/jdk1.5.0/bin:/opt/visibroker:/root/bin:/opt/visibroker
rpm (RPM package manager)
Query all installed packages. Enter
rpm –qa
Check current fewstools from FEWS. Enter
rpm -qa | grep -i fews
Remove old fewstools. Enter
rpm -e fewstools-x.x-x
Install fewstools RPM. Enter
rpm -ihv --force /<directory>/fewstools-x.x-x.rpm
Linux File System
/opt
/opt - This directory contains all the software and add-on packages that are not part of the default installation.
Enter ls -l /opt
# ls -l /opt/
lrwxrwxrwx1 root root 89 Nov 13 15:04 MySQL -> /var/mnt/remote/sysimg/flexiserver/sets/R_OMS1_3.35.release_oms.corr7-inc-1.rpm/opt/MySQL
lrwxrwxrwx1 root root 89 Nov 13 15:04 Nokia -> /var/mnt/remote/sysimg/flexiserver/sets/R_OMS1_3.35.release_oms.corr7-inc-1.rpm/opt/Nokia
lrwxrwxrwx1 root root 93 Nov 13 15:04 Nokia_BP -> /var/mnt/local/localimg/flexiserver/sets/R_OMS1_3.35.release_oms.corr7-inc-1.rpm/opt/Nokia_BP
/dev
/dev - This is a very interesting directory that highlights one important characteristic of the Linux filesystem - everything is a file or a directory.
Look through this directory and you should see sda1 and sda2 ,which represent the partitions on the first master drive (sda) of the system.
Enter ls /dev
Insert USB memorystick to host
Enter ls /dev
Do you see the memorystick at /dev as a new device. Typically sdc, and USB memory stick partitions is sdc1
# ls /dev/
sda
sda1
sda2
sdb
sdb1
sdb2
sdc
sdc1
/var and /var/log
/var - This directory contains spooling data like mail and also the output from the printer daemon. The system logs are also kept here in /var/log/messages.
OMS main log is master-syslog and (FEWS main log is messages).
Enter ls /var
Enter ls /var/log/
Note! You can read ”on-line” there logs.
In OMS enter
tail -f /var/log/master-syslog
# ls /var/log
dmesg
master-syslog
messages
syslog
/var/opt/Nokia/www
Directory /var/opt/Nokia/www/
is OMS www-root. It contains OMS homepage. Also RNC system ID and PuTTy.exe is located here.
Enter
ls /var/opt/Nokia/www/
Browse OMS www root systemid.txt file. E.g.
https://192.168.5.9/systemid.txt
You can read OMS system ID.
# ls /var/opt/Nokia/www/
AL_client
Insec_SessionManager_V1.ior
SessionManager_V1.ior
asciireports
certificates
cgi-bin
em
index.html
j2se
logviewer.html
logviewerfiles
putty.exe
restrictreports
swversion.html
swversionfiles
systemid.txt
/var/opt/OMSftproot
Directory /var/opt/Nokia/www/
is OMS ftp-root. Ftp users access to this directory. Typical ftp user is the NetAct when fetching PM .xml files.
Enter ls /var/opt/OMSftproot/
Check if there is any .xml files in xmlfiles directory. Enter
ls /var/opt/OMSftproot/
Note! After fetching a .xml file from OMS the NetAct request to delete the file from OMS xmlfiles directory. So if you find any files older than few hours, there must bea problem in OMS-NetAct interface.
# ls /var/opt/OMSftproot/
AuditTrailXMLFiles
Nwi3LMAgent
OMSLicenceManager
RUIM_XML
SWPackages
internal_reports
key_counter
xmlfiles
xmlfilesBU
File Management
File and directory access rights
•To prevent malicious acces to the Linux file system, each file and directory has owner and access rights. Access rights are per owner, owner group and other groups and they allow reading, writing or executing the file or directory.
•Take a long list of OMS root. Enter ls -l /
lrwxrwxrwx1 root root40 Nov1 12:08 root -> /var/mnt/local/localimg/flexiserver/root
lrwxrwxrwx 1 root root= symbolic link
lrwxrwxrwx 1 root root= read, write and execute right for root user
lrwxrwxrwx 1 root root= read, write and execute right for root group
lrwxrwxrwx 1 root root= read, write and execute right for other groups
chmod (change file access permissions)
chmod changes the permissions of each given file per users or groups
Longlist testfile.
Enter ls -l /home/student/testfile
Allow all users execute the file. Enter chmod +x /home/testfile
Allow file owner write the file. Enter chmod +w /home/testfile
Give full right to everybody. Enter chmod 777 /home/testfile
mount (mount a file system)
•OMS does not automatically mount new device e.g. USB stick filesystem. You must mount it manually.
•Insert an USB stick to OMS USB port.
•Check ls /dev/ the USB stick device name.
Note! You can also check from kernel ring buffer the device name. Enter dmesg | tail | grep -B2 "Attached scsi removable disk". Look forsd<a,b,c…>: sd<a,b,c…>1, where sd<a,b,c…> is the USB device and sd<a,b,c…>1 is the USB disc partition).
•Mount USB partition sdc1 to /home/student/ directory. Enter mount /dev/sdc1 /home/student/
mkdir (make directory)
Create a directory ”student” on /home/
mkdir /home/student
cp (copy) and mv (move)
Copy file testfile from /home/student to /home/
cp /home/student/testfile /home/
Move testfile from /home/ to /root/. Enter
mv /home/student/testfile /root/
rm (remove files or directories)
Removes each specified file.By default, it does not remove directories, buy adding option –rf the directory and files are removed.
Remove test.txt from /home. Enter
rm /home/student/test.txt
Remove directory and files. Enter
rm –rf /home/student/
scp (secure copy, remote file copy program)
Copy file /home/student/testfile from local computer to remote computer /home/Nemuadmin/.Use Nemuadmin as scp access to remote computer.Enter ;
scp /home/student/testfile
Nemuadmin@10.2.82.107:/home/Nemuadmin/
scp (secure copy, remote file copy program)
Copy file /home/Nemuadmin/testfile from remote computer to local computer /home/student/.
Use Nemuadmin as scp access to remote computer. Enter ;
scp
Nemuadmin@10.2.82.107:/home/Nemuadmin/testfile /home/student/
WinSCP
ftp (file transfer protocol program)
Ftp is the user interface to the Internet standard File Transfer Protocol.The program allows a user to transfer files to and from a remote network site.
In OMS default ftp user is omsFtpUser and oms ftp root is located e.g in /var/mnt/local/sysimg/R_OMS1_3.38/OMSftproot/
Start ftp session from FEWS to OMS. Enter
ftp 10.2.82.107
Networking in Linux
mii-tool (view, manipulate media-independent interface status)
Thisutility checks or sets the status of a network interface's Media Independent Interface (MII) unit.Most fast ethernet adapters use an MII to autonegotiate link speedand duplex setting.
Check the link status. Enter mii-tool
# mii-tool
eth0: negotiated 100baseTx-FD, link ok
eth1: no link
Administrate IP configurations
•Chek the network interface configuration and status ifconfig
•Shutdown interface ifdown <if name>
•Show network status. Enter ip addr
•Show routing table. Enter netstat -r
•Show ARP cache entry. Enter ip neig
•Add network address to eth0. Enter
ip addr add 192.168.0.250/16 dev eth0
•Activate interface. Enter ifup <if name>
bond0
•OMS binds both eth0 and eth1 into single bond0 in order to grain network redundancy
•Show bond0 configuration
# ifconfig | grep -F4 bond
bond0Link encap:EthernetHWaddr 00:80:42:23:73:42
inet addr:10.56.116.238Bcast:0.0.0.0Mask:255.255.255.0
inet6 addr: fe80::280:42ff:fe23:7342/64 Scope
ink
UP BROADCAST RUNNING MASTER MULTICASTMTU:1500Metric:1
RX packets:2827929 errors:0 dropped:0 overruns:0 frame:0
Administrating services
IP address is provided by dhcpd (dhcp daemon) in the FEWS during OMS installation. FEWS DHCP service provides IP address for OMS in OMS after kick start.
Check the status of DHCP service. Enter
service dhcpd status
Start DHCP service. Enter
service dhcpd start