Академический Документы
Профессиональный Документы
Культура Документы
Topic on Solaris 10
Mo Qiuju /57859
www.huawei.com
Huawei Confidential
Preface
This course is developed on the basis of common requirement on knowledge about Solaris 10 operating system for technical service engineers. This course is used for engineers to improve the management and application capabilities of Solaris 10 operating system.
Huawei Confidential
Page 2
Study Guide
Huawei Confidential
Page 3
Objectives
Know main delivered hardware of the workstation Know the evolvement of Solaris, Sybase and T2000 and describe differences and features between solaris10 and solaris8 Understand common operations, common maintenance commands and application of basic tools of Solaris operating system
Huawei Confidential
Page 4
Content
operating system
Troubleshooting on Solaris 10
Huawei Confidential
Page 5
Content
Models of SUN
Huawei Confidential
Page 6
Huawei Confidential
Page 7
Huawei Confidential
Page 8
Huawei Confidential
Page 9
Question
Huawei Confidential
Page 10
Summ ary
Models of SUN
Huawei Confidential
Page 11
Content
operating system
Troubleshooting on Solaris 10
Huawei Confidential
Page 12
Content
System structure and basic concept of Solaris Versions of Solaris and matching relations with T2000 and Sybase
Huawei Confidential
Page 13
UNIXUNIX genres:
Main features:
multi-tasking, multi-users, pipe, powerful Shell, security protection
mechanism, good stability, graphic user interface, powerful network support, good migrateability
Huawei Confidential
Page 14
kernel
shell(B shell,
Hardware
K shell, C shell)
Application Program
Huawei Confidential
Page 15
Huawei Confidential
Page 16
bin sh
dev
etc
usr
opt T2000
var sybase
cdrom tmp
export home
csh
rc3.d
client
server
t2000
Huawei Confidential
Page 17
group
owner 111
Huawei Confidential
Page 18
Shell
The shell sits between you and the operating system, acting as a command
interpreter. It reads your terminal input and translates the commands into actions taken by the system. The shell is analogous to command.com in DOS.
There are several types of shell: B Shell, K Shell, C Shell. Sh( B shell) uses the startup file .profile and the default prompt is $; Csh uses the startup files .cshrc and .login, the default prompt is %.
Normally the default shell is Bourne Shell. To change shell, just input
Huawei Confidential
Page 19
Environment Variables
Environment variables are used to provide information to the programs you use. The
following information are example: display mode, default editor, terminal type, resource configuration of serial ports and network cards, login user name, hostname, group name, path, prompt.
2 types: global environment and local shell variables. Global environment variables are available in every Shell, but local shell variables are available only in one Shell.
PATH:Paths to be searched for commands SYBASE:Sybase installation path,normally, SYBASE=/opt/sybase T2000DBServer:Sybase Server Name IMAP: T2000 server path, normally, IMAP/T2000/server
Version of Solaris
Solaris 2.8
Solaris 2.9
Not used.
Solaris 2.10
The latest version, which T2000/T2100 will switch to, is the main version now.
Huawei Confidential
Page 21
The database since Solaris10 starts to be switched to Sybase12.5. The T2000V2R2 and V2R3 start to support Solaris10 and Sybase12.5 as well as Solari8 and Sybase12.0.
The T2100V2R1 starts to match Solaris10 and Sybase12.5 and no longer supports Solaris8 abd Sybase11.9.2.
When the NMS is upgraded, pay attention to the matching relations with the operating system and database.
Huawei Confidential
Page 22
Features of Solaris10
Clear system operation process: Dynamic Tracing Wide hardware platforms: New UltraSPARC IV, Persistent availability: Predictive Self Healing Incomparable security: Process Rights Management,Crypto Infrastructure
Huawei Confidential
Page 23
SMC
container Built-in SSH2 Dynamic Tracing Support x86
Admintool
None None None None
File position changes. /etc/ftpusers /etc/ftpd/ftpusers /opt/sybase/interfaces ip File ip display mode changes. Denoted in hexadecimal format /opt/sybase/interfaces ip denoted in decimal format
HUAWEI TECHNOLOGIES CO., LTD. Huawei Confidential Page 24
Question
Huawei Confidential
Page 25
Summ ary
System structure and basic concept of Solaris Versions of Solaris and matching relations with T2000 and Sybase
Huawei Confidential
Page 26
Content
operating system
Troubleshooting on Solaris 10
Huawei Confidential
Page 27
Content
Normal operation for Engineering Normal operation for Maintenance Use of tools
Huawei Confidential
Page 28
Include:
Start the SUN workstation Install the Solaris 10 Install T2000/T2100 software in Solaris Start a terminal window
Huawei Confidential
Page 29
CD-ROM
Huawei Confidential
Page 30
the NM includes:
Sybase database system: providing database service NM program High-Availability software (optional)
Huawei Confidential
Page 31
Huawei Confidential
Page 32
Installation Preparations
Before you install the T2000 system, make sure that the preparations for the software, hardware and environment are done. The T2000's software and hardware running environment is strictly selected
and tested.
Hardware Installation
Notes:
Huawei Confidential
Page 33
g) Enabling the Northbound Interface (Optional) h) Creating a Disk Mirror (Optional) i) Verifying the Installation
Huawei Confidential
Page 34
Click the terminal window icon on the bottom of the screen (the name is this host)
Right-click at the blank place of screen, a menu will pop out. Choose Hosts -> Terminal Console in the menu
Type command exit behind the prompt in terminal window Double click the top-left corner of terminal window
Huawei Confidential
Page 35
Disable/Enable ftp server in Solaris10: ( Only the root user has the right to do it )
Huawei Confidential
Page 36
steps
a) enable the ftp and telnet function only by root user # svcadm enable telnet
# svcadm enable ftp b) enable telnet connection and enable ftp connection of a special user #root
enable telnet connection -- Change the /etc/default/login file and add #
Procedure
and remove # before the user name. To disable ftp connection of the
root user, remove # before root. (b) Disable ftp and telnet functions. Only the root user is authorized to perform this operation.
Huawei Confidential
Page 38
make sure that the ftp function of two computers that transfer files to each other is
enabled. Example: Transfer a file from a PC to a workstation a. b. c. d. e. f. g. h. Start Run cmd (necessary for a PC and unnecessary for a workstation)
ftp ip address Type in the user name and password. ftp> ascll (transfer mode: text file in ascll mode; other files in bin mode) ftp>cd /aaa (directory of files in the workstation) ftp>lcd d:\ ftp>put bbb (bbb refers to the file name. To obtain a file from the workstation, replace put with get.) ftp>bye (ftp ends.)
Huawei Confidential
Page 39
Use of Telnet
Application scenario: When the workstation server is placed remotely or the server cannot be randomly used, you need to log in to the server remotely on the client (PC or workstation) to perform some operations. After remote login by using the Telnet function, using the workstation server is the same as using the local workstation. Procedure for Telnet
a. b. c. Start Run workstation) cmd (necessary for a PC and unnecessary for a
Huawei Confidential
Page 40
Control Keys
Control+S
Stop + A
Used to go to OK state
Huawei Confidential
Page 41
Application scenario
The tar command combines files into one device or filename for archiving
purposes. The tar command does not compress the files; it merely makes a
large quantity of files more manageable.
Syntax
tar [options] [directory file] Common Options c create an archive (begin writing at the start of the file) t table of contents list x extract from an archive v verbose f archive file name b archive block size
Example
tar cvf aaa.tar aaa (In current directory, dump all the files and sub-directories in aaa directory to aaa.tar in the current directory) tar xvf aaa.tar (restore aaa.tar into the current directory)
Huawei Confidential Page 42
When a file has been compressed using the compress command, a suffix of .Z is appended to the file name.
Syntax
compress [options] [file] uncompress [options] [file.Z] Example: compress aaa uncompress aaa.Z
Gzip and gunzip command Gunzip restores the files originally compressed by gzip. When a file has been compressed using the gzip command, a suffix of .gz is appended to the file name.
Syntax :
gzip filename
Example:
gzip aaa
gunzip aaa.gz
Huawei Confidential
Page 43
When a file has been compressed using the pack command, a suffix of .z is appended to the file name.
unpack name
unpack aaa.z
zip and unzip command unzip restores the files originally compressed by zip. When a file has been compressed using the gzip command, a suffix of .zip is appended to the file name.
Syntax :
unzip FileName.zip
Example:
unzip aaa.zip
Huawei Confidential Page 44
Steps
b) Execute cd /T2000(T2100)/server/bin c) Execute ./t2000server(./startserver.sh) to start T2000(T2100); Execute ./showt2000server(./show_server) to check the running status of
T2000 server(T2100 server). If returned value includes the process and PID for each related process of T2000(T2100) , that is to say , the T2000 server(T2100 server) is running.
Huawei Confidential
Page 45
Steps for power-off are as follows: 1) Use su to enter the root authority of superuser
2)Excute sync several times to write the data from memory to disk
3) Run shutdown -y -g0 -i0 to return to ok prompt, then switch off the host, or type command power-off, or press Ctrl+Alt+ Power keys to switch off the system power. 4)Run shutdown -y -g0 -i5 to power-off directly.
Run command reboot under superuser root Run init 0 to enter prompt ok, then type boot Run shutdown -y -g0 i6
Page 46
Huawei Confidential
Include:
switch user File maintenance Display the content of file System resource navigation and control Modify the hostname Configure and query the IP address Configure the default network route
Huawei Confidential
Page 47
switch user
Two methods
variables;
Method 2 is used to switch user completely .(recommend to use)
Example:
su root User name:root
Password:rootkit
HUAWEI TECHNOLOGIES CO., LTD. Huawei Confidential Page 48
cd [directory]
ls [options] [directory or file] mkdir [options] directory pwd
change directory
list directory contents or file permissions make a directory print working (current) directory
remove a directory
Huawei Confidential
Page 49
Change directory -- cd
%cd /
%cd ..
Huawei Confidential
Page 50
Syntax: ls [options] [parameter] -a lists all files, including those beginning with a dot (.),such as .login -l long listing lists the mode, link information, owner, size, last modification
(time). If the file is a symbolic link, an arrow (-->) precedes the pathname of the
linked-to file. Example: ls l Return value: drwxr-xr-x 2 t2000 ems 512 May 3 13:58 T2000/ Explanation :For the directory T2000, it allows the user (owner) t2000 to read, write and execute; other users except t2000 in the UNIX group assigened to the file to read and execute; users on the system only to read.
Huawei Confidential
Page 51
Several options can be used together for most commands: Command -[Option 1][Option 2][Option 3][ ...] For example: ls alF
Options also can be listed separately: Command -[Option 1] -[Option 2] -[Option 3] -[ ...]
For example: ls -a -l F
Common Operations
cd ls mkdir
Change directory List the directory contents, for example: ls -al Create directory
cp/rcp
pwd rmdir rm mv man su
Copy files
Present the current working directory Delete directory Delete file, for example: rm r /tmp/t2000 Move file or change file name Obtain help information on command Switch user
Huawei Confidential
Page 53
touch find
Used to create a file, for example: touch a.txt Recursively search the indicated directory tree to find files
Search specified string in the whole text file Change access authority over file Change the ownership of a file Change the group of the file Display the contents of a file with the concatenate command
more/less/pg Page through a text file head/tail echo Display the head/tail N lines of a file Repeat the characters you give to the standard output, for example: echo $SYBASE
Huawei Confidential
Page 54
df du
Summarize disk block and file usage, for example: df -k Report disk space in use, for example: du k /usr/t2000
who
which date env tar
Huawei Confidential
Page 55
Display the hardware information Display the computers information Configure or display the hostname Display the hostid
id
pkginfo pkginfo l xxx showrev
Huawei Confidential
Page 56
prtdiag uname
hostname
hostid du id pkginfo pkginfo l xxx showrev
Huawei Confidential
Page 57
Return value: the clock frequency, the amount of memory , CPU information, I/O information Query the basic information of system Syntax: uname a,hostname,hostid Example: %uname a %hostname %hostid Return value: the current user name, hostname, hostID,etc. Query the information of system patch Execute showrev p | grep patch number to query the pacth whether it has been installed. Example: #showrev -p | grep 117350 Return value:
Patch: 117350-02 Obsoletes: 116897-01 Requires: 108528-29, 117000-0 Incompatibles:Packages: SUNWcarx, SUNWcar, SUNWcsr, SUNWpmu, SUNWpmux, SUNWhea
Huawei Confidential
Page 58
Controlling Processes
Generally speaking, a process is a running task. The UNIX system realizes time-sharing multi-tasks by controlling, provisioning and storage management of the processes.
Common commands
ps kill
show status of active processes, for example: ps ef terminate a process, for example: kill -9 213
Huawei Confidential
Page 59
Modifying Hostname
Modify /etc/nodename file, input the new hostname. If the new hostname is Primary, input Primary in nodename file.
There is at least one hostname.interface0 file in /etc. Modify /etc/inet/hosts and /etc/hosts files, change the old hostname to the new one.
Huawei Confidential
Page 60
IP Address Configuration
Modify /etc/inet/ipnodes file Modify /etc/hosts file, the content is IP tab character string Modify /etc/netmasks file, writting the corresponding netmask of IP
The parameter route indicates the route management command; add indicates
adding route option; default indicates the default route; 129.9.1.254 indicates the IP address of the internal port of the local network; 1 refers to the hop number. b. Run the netstat nr command to query the added default route in the system route table. In this event, NEs at other network segments can be pinged through. c. To facilitate the system to automatically add the default route when the system is restarted every time, create the defautrouter file in the /etc directory and write in the IP address of the relevant route port (take 129.9.1.254 as an example)
vi /etc/defaultrouter
129.9.1.254
HUAWEI TECHNOLOGIES CO., LTD. Huawei Confidential Page 62
Use of tools
Include:
Huawei Confidential
Page 63
Tools --Vi
Application scenario: vi command is a powerful tool for editing text file in UNIX, it can create and modify the text file.vi has two basic modes for manipulating text, command mode and text entry mode. When you start vi, you will be in command mode until you enter one of the text entry commands, such as i, a, s, or o, which are explained in Entering Text with vi. To create a file named myfile and open it for editing, use this command: vi filename control command ESC Key: switch between Command mode and text input mode b: cursor go to the beginning of last word X: delete a word dd: delete an row i: Insert the text at the location before the cursor(insert) j:Move the cursor to up k:Move the cursor to down l:Move the cursor to right o: insert the text in the next line where the cursor is(open) :wq:Save and exit :w! :Only save, no exit :q! :Force exit without save :e ! : reedit the file again without change
Huawei Confidential
Page 64
Procedure
1. Right-click the desktop and choose Application > Snapshot to enable the snapshot program. 2. Choose Hide the window during snapshot. Click the window to snap or choose the screen. Snapshot is complete after waiting for eight seconds. 3. On the graphic viewer, choose File > Save as jpeg. Note: When typing in the file name, do type in the suffix name like XXXX.jpg(jpeg).
Huawei Confidential
Page 65
Application scenario: HA system In the /opt/haT2000-veritas-scripts/Monitor directory of the Veritas HA system, the Veritas_Explorer.pl data collection script exists. Run the script to check the status of the HA system and collect data.
Huawei Confidential
Page 66
Tool-smc
admintool in Solaris8 is changed to smc in Solaris10. Compared with admintool, smc features better expansion performance. smc does not provide specific functions, but provides interfaces that access these functions. a. Assign authority and role for users. b. Create and carry out the user policy. c. View the system log and find out abnormal or doubtful log records. d. Create a mail list. e. Configure and format the new system disk, including disk partition and preparation for RAID configuration disk copy.
#smc
HUAWEI TECHNOLOGIES CO., LTD. Huawei Confidential Page 67
Question
Huawei Confidential
Page 68
Summ ary
Huawei Confidential
Page 69
Content
operating system
Troubleshooting on Solaris 10
Huawei Confidential
Page 70
Content
Troubleshooting on Solaris 10
Huawei Confidential
Page 71
Problem cause:
The configuration file of Desktop of the user may be damaged. Solution:
Huawei Confidential
Page 72
popup key under the driver, but the CD fails to pop up.
Solution Type in the command: eject f.
Huawei Confidential
Page 73
Huawei Confidential
Page 74
In these two cases, use ls l XXX.sh (script name) to view the file attribute.
Solution In case 1, switch the user or change the script host. If the executable authority is insufficient, add the executable authority.
If the script is changed on the PC, check whether the transport mode is correct (ASCII). In addition, use the sh x xxx.sh debugging mode to check the execution course of the script and analyze the problem.
HUAWEI TECHNOLOGIES CO., LTD. Huawei Confidential Page 75
The workstation does not respond to the keyboard and mouse, so it is nonoperable.
Problem description: The workstation does not respond to the keyboard and mouse, so
it is nonoperable.
Problem cause: The process runs abnormally. Solution: Find out the abnormal process and kill it or restart the workstation. Specifically,
do as follows: (a) Connect another computer (laptop computer, PC or workstation) to this workstation with a network cable. Enter the following command on this computer: Telnet the IP address of the workstation. Follow the prompt to type in the rms user name and relevant password and then log in to the workstation. (b) Find out the abnormal process and kill it. Enter the following command to find out the possible abnormal process and record the process number: %ps -ef Enter the following command to kill the abnormal process: %kill -9 process number If the abnormal process is unclear, kill the dtsession process. Then the workstation interface restarts and enters in the login status.
HUAWEI TECHNOLOGIES CO., LTD. Huawei Confidential Page 76
The workstation does not respond to the keyboard and mouse, so it is nonoperable.
(c) If the workstation is restored after the preceding operations are carried out, restart NMS in the workstation. If the system remains abnormal, use the following command to restart the workstation: #/usr/sbin/shutdown -y -g0 -i6 Then the system is restarted. If no computer connects to the workstation onsite or the computer fails to telnet the workstation due to some reasons, do as follows: (1) Type in STOP+A.
(2) When the system displays the ok prompt, type in sync to restart the system.
Warning:
The preceding operation is bad to the file system, so it is used only when there is no other method. Use fsck to check the file system after the system is restarted.
HUAWEI TECHNOLOGIES CO., LTD. Huawei Confidential Page 77
Question
Huawei Confidential
Page 78
Summary
CDE Cannot Be Logged in Normally The CD Fails to Pop up The User Password Is Forgotten
Huawei Confidential
Page 79
Summar y
Introduction to server hardware Brief introduction to Solaris 10 operating system Common operations of Solaris 10 operating system Troubleshooting on Solaris 10
Huawei Confidential
Page 80
Thank You
www.huawei.com