October 27th, 2008 406 Views
Solaris运行级别表示系统的运行状态,每个level具体运行哪些服务和进程是由/etc/rc#.d目录下面的脚本决定的。举例来说,在有SunCluster的RAC环境下,对Oracle UDLM (ORCLudlm) 进行升级就需要先进入单用户模式,卸载老的ORCLudlm,然后安装新版本。 这个时候就需要boot -s
默认的服务的运行级别列表如下:
* 0: The system is at the PROM monitor (ok>) or security monitor (>) prompt. It is safe to shut down the system when it is at this init state.
* 1, s or S: This state is known as “single-user” or “system administrator” mode. Root is the only user on the system, and only basic kernel functions are enabled. A limited number of filesystems (usually only root and /usr) are mounted. This init state is often used for sensitive functions (such as kernel libc patches) or while troubleshooting a problem that is keeping the system from booting into multiuser mode.
* 2: Multiple users can log in. Most system services (except for NFS server and printer resource sharing) are enabled.
* 3: Normal operating state. NFS and printer sharing is enabled, where appropriate.
* 4: Usually undefined.
* 5: Associated with the boot -a command. The system is taken to init 0 and an interactive boot is started.
* 6: Reboot. This state takes the system to init state 0 and then to the default init state (usually 3, but can be redefined in the /etc/inittab file).
阅读全文 »
Share This
归类于 主机 | 就等您评论了 »
September 22nd, 2008 442 Views
这个问题困扰了我好几个月,今天终于搞定了。
一个Solaris10的cluster,四个节点,此处以1,2,3,4代替,所有节点之间ssh和rsh都是通的,但是1-1,2-1,3-1,4-1的rsh不通,这里所说的通就是不用输入密码即可访问其他的节点,比如1-2,即在1节点执行rsh 2 date即可显示2节点的当前时间。
其实要配置从1-2节点的rsh,有一些必要的步骤,简单罗列如下:
阅读全文 »
Share This
归类于 主机 | 就等您评论了 »
August 26th, 2008 455 Views
在解决前面scstat问题的时候,仔细的研读了一下这个sun的官方帮助,加深了对Solaris的服务的理解。在Solaris中,可以利用svcs 和svcadm 命令进行查看和修改、重启服务。下面就转载一下Service Management Facility这篇快速入门:
简介
过去,UNIX 操作系统包含一组服务:这些服务是与任何交互式用户登录都不关联的软件程序,用于侦听和响应请求以执行特定的任务(如传送电子邮件、响应 ftp 请求,或允许执行远程命令)。这些传统服务通常是一些单独的应用程序,它们作为单个进程执行,在系统引导时启动,并在系统启动和运行时持续执行,可处理接收到的任何请求。
如今,管理员必须管理一系列服务,这些服务的作用已经超出了此原始模型的作用范围。Sun 推出了 Service Management Facility(SMF,服务管理工具),以简化这些系统服务的管理。SMF 是 Solaris 操作系统的一项新功能,为每个 Solaris 系统上的服务和服务管理创建支持的、统一的模型。它是 Solaris 10 中预测性自我修复技术的核心部分,为软件和硬件故障以及管理错误提供自动恢复功能。
在本指南中,我们将介绍 SMF 的功能及优势,指出 Solaris 中显著更新的部分,并说明如何使用 SMF 完成典型的管理任务。可以在 Sun 的 BigAdmin Web 站点上找到 SMF 及预测性自我修复功能的详细指南。
功能
Service Management Facility 已经改进了 Solaris 管理模型的几个方面。一些最显著的更新包括:
* 服务由可以进行查看(使用新的 svcs(1) 命令)和管理(使用 svcadm(1M) 和 svccfg(1M))的一级对象表示。
* 无论失败的服务是由管理员错误、软件错误导致,还是受无法更正的硬件错误的影响,这些服务都将按照相关性顺序自动重新启动。
* 可以获取有关配置错误或行为异常的服务的详细信息,包括对服务未运行的原因的说明(使用 “svcs -x”),以及每个服务单独的持久性日志文件。
* 引导过程中出现的问题比较容易调试,因为在启动故障期间可以控制引导详细程度,记录服务启动消息,以及提供更可靠的控制台访问。
* 自动拍摄服务配置快照,从而更容易备份、恢复和撤消对服务所做的更改。
* 可以使用受支持的工具 (svcadm(1M)) 启用和禁用服务,从而允许更改不受升级和修补程序的影响而保留原样。
* 管理员可以更容易地将任务安全地委派给非超级用户,这些任务包括配置、启动、停止或重新启动服务(如 smf_security(5) 手册页中所述)。
* 根据服务的相关性并行启动服务,可以更快地引导大型系统。
阅读全文 »
Share This
归类于 主机 | 就等您评论了 »
August 26th, 2008 489 Views
最近一直很少更新博客,熟悉的朋友都知道,我在忙一个重要的release,Oracle Database 11g的第一个patchset - 11.1.0.7,这个patchset应该很快就要发布的,敬请期待。
今天在测试的时候,Solaris的节点再一次出现问题,最近服务器的问题不断,先是DLM问题,后面是QFS问题,现在居然是服务出现依赖关系,启动异常,SunCluster命令scstat返回异常结果:unexepcted error
根据google搜到的结果,在Sun的官方网站找到一个类似的问题:
根据提示,检查一下svcs -x 的输出,
bash-2.05$ svcs -x
svc:/network/nfs/client:default (NFS client)
State: offline since August 25, 2008 10:33:46 PM PDT
Reason: Start method is running.
See: http://sun.com/msg/SMF-8000-C4
See: mount_nfs(1M)
See: /var/svc/log/network-nfs-client:default.log
Impact: 18 dependent services are not running. (Use -v for list.)
svc:/application/print/server:default (LP print server)
State: disabled since August 25, 2008 10:31:10 PM PDT
Reason: Disabled by an administrator.
See: http://sun.com/msg/SMF-8000-05
See: lpsched(1M)
Impact: 2 dependent services are not running. (Use -v for list.)
svc:/system/cluster/cl-svc-cluster-milestone:default (Synchronizing the cluster userland services)
State: disabled since August 25, 2008 10:32:38 PM PDT
Reason: Temporarily disabled by an administrator.
See: http://sun.com/msg/SMF-8000-1S
Impact: 1 dependent service is not running. (Use -v for list.)
svc:/application/stosreg:default (Service Tag OS Registry Inserter)
State: maintenance since August 25, 2008 10:33:39 PM PDT
Reason: Method failed.
See: http://sun.com/msg/SMF-8000-8Q
See: stclient(1M)
See: /var/svc/log/application-stosreg:default.log
Impact: This service is not running.
svc:/network/stdiscover:default (Service Tag discovery probe)
State: maintenance since August 25, 2008 10:33:45 PM PDT
Reason: Restarter svc:/network/inetd:default gave no explanation.
See: http://sun.com/msg/SMF-8000-9C
See: in.stdiscover(1M)
Impact: This service is not running.
svc:/network/stlisten:default (Service Tag Discovery Listener)
State: maintenance since August 25, 2008 10:33:45 PM PDT
Reason: Restarter svc:/network/inetd:default gave no explanation.
See: http://sun.com/msg/SMF-8000-9C
See: in.stlisten(1M)
Impact: This service is not running.
bash-2.05$
发现服务的依赖不对,启动console进入单用户模式,操作了几个服务,重新禁用和启用,重启,居然好了。
记录一下。
Share This
归类于 主机 | 已经有5 条评论 »
March 7th, 2008 1,485 Views
最近,经常遇到SunCluster中有一个节点ucmm起不来的问题,现象就是scstat -g输出的结果显示ucmmd is not running,十分郁闷
STIT的弟兄们帮助解决了几次,但是也不知所以然,这次刚解决了,又坏了,恼火。
search了Sun的网站,找到了scswitch的用法,仔细看了一遍,然后用了两个命令搞定了。
1.先用ucmmd把ucmm的process重新启动一次:
#/usr/cluster/lib/ucmm/ucmmd -r /usr/cluster/lib/ucmm/ucmm_reconf
2. 然后用scswitch把相关的group resource offline/online一次,结果OK
# /usr/cluster/bin//scswitch -R -h xxx -g rac-framework-rg
#xxx is the node name
scswitch的用法记录一下,以备后患
scswitch(1M)
scswitch– perform ownership and state change of resource groups and disk device groups in Sun Cluster configurations
SYNOPSIS
scswitch -c -h node[,…] -j resource[,…] -f flag-name
scswitch {-e| -n} [-M] -j resource[,…]
scswitch -F {-g resource-grp[,…]| -D device-group[,…]}
scswitch -m -D device-group[,…]
scswitch -Q [ -g resource-grp[,…]]
scswitch -R -h node[,…] -g resource-grp[,…]
scswitch -S -h from-node [ -K continue_evac]
scswitch {-u| -o} -g resource-grp[,…]
scswitch -z -g resource-grp[,…] -h node[,…]
scswitch -z -g resource-grp[,…]
scswitch -z
scswitch -z -D device-group[,…] -h node
scswitch -Z [-g resource-grp[,…]]
阅读全文 »
Share This
归类于 主机 | 就等您评论了 »
February 25th, 2008 1,530 Views
最近两次去图书馆,也不是一无所得,还是发现了两本有关Solaris的好书的,给朋友们推荐一下,对Solaris有兴趣的朋友或者用的着的朋友可以考虑买一个本。
第一本就是:Solaris内核结构(第二版)

英文原版的,据说中文版也已经出来了,不过不那么难,不用中文版一般也看得懂的。书中从soalris的进程结构,进程间通信,进度调度,内存文件系统管理等都做了深入的剖析。作者Richard McDougall 是Sun公司杰出工程师,专门从事OS技术和系统性能的研究,另外一个作者是Jim Mauro ,Sun公司高级工程师,从事性能、体系结构和应用工程小组方面的研究。
第二本就是Solaris内核结构的姊妹篇,Solaris性能与工具(第二版)

下面是这本书的简介:
本书全面介绍了Solaris 10和OpenSolaris中的强大工具,包括Solaris动态跟踪工具、DTrace和MDB(模块调试器)。书中提供了理解性能和行为的系统方法,包括:
● 分析内核和应用程序的CPU利用率,包括读取和理解硬件计数器。
● 进程级资源使用和概要描述。
● 磁盘IO行为和分析。
● 系统和应用程序级的内存使用。
● 网络性能。
● 内核监视和概要描述,以及收集内核统计数据。
● 使用DTrace提供者和聚集。
● MDB命令和完整的MDB指南。
对任何水平的Solaris 10和OpenSolaris用户来说,本书和《Solaris内核结构》都极具参考价值。
Share This
归类于 主机 | 目前才1 条评论 »
February 14th, 2008 1,428 Views
Solaris在三大UNIX平台(Solaris, AIX, HPUX)中是相对来说比较稳定的一个,虽然启动过程跟Linux大致相同,但是在细节方面还是有一些差异的地方,转载一篇Solaris启动过程分析的文章,帮助自己更好的学习和了解Solaris这个优秀的平台。全文分四个部分:简单介绍,启动,进程和inetd
在Sparc平台下,Solaris系统中有一个类似PC BIOS的芯片程序(EEPROM OpenBoot)负责识别分区、文件系统和加载内核,在Solaris 2.6之后的版本中,默认的内核文件存放在/platform/`arch`/kernel/unix位置,`arch`指令是指明系统的硬件体系,目前一般是i86pc(Intel IA32)或sun4u(Sun UntraSparc)。
在Intel体系中,因为没有eeprom firmware,所以系统提供了一个模拟eeprom的引导程序,来负责内核的定位和加载,这个程序是工作在实模式下的,系统必须要给他提供一个 fat12/16格式的boot分区,在系统引导完成之后可以在/boot/solaris下找到他的配置文件。(Solaris IA使用默认内核/kernel/unix)
整个系统启动过程如下:
=====================================
init 0 openboot模式 -> (引导内核,加载硬件驱动) 可以选择从cdrom引导进入维护模式
|
V
init 1 单用户模式 -> (加载/分区) 登陆进入维护模式,或按Ctrl+D进入多用户模式
|
V
init 2 网络工作站模式 -> (连接网络,运行网络工作站服务) 运行/etc/rc2脚本连接网络
| |
| ->-> 启动S69inet服务,运行部分inetd网络服务
V
init 3 网络服务器模式 -> (运行各种网络服务) 运行/etc/rc3脚本启动网络服务器
阅读全文 »
Share This
归类于 主机 | 就等您评论了 »
December 11th, 2007 1,229 Views
如何更好的理解SunCluster的Quorum,也就是选举盘,下面就结合例子做介绍。
其实说到底就是两个公式:
一个是计算选举盘是否足够的公式:
Q=TCV/2+1
TCV就是当前cluster中配置的总票数,Toally configured Votes.
至于如何计算总票数,就是第二个公式了:
TCV=node 票数+device 票数
node票数很容易计算,每个节点一票
device票数计算方法是:
QD=TCD-1
TCD就是连接当前共享设备的所有的节点数-1
下面是详细的说明:
To form a cluster and offer services, the nodes in a cluster must first reach quorum. The quorum equation states that a cluster must have the total number of configured votes, divided by two (remainders are discarded), plus one (Q = TCV/2 + 1). If a cluster cannot reach quorum, then it does not form. The individual cluster nodes do not boot fully, but wait until enough votes are available to reach quorum. If a running cluster loses quorum, the affected nodes panic and try to reboot (assuming auto-boot? is set to true on those nodes). Machines can be booted outside the cluster by issuing a boot -x from the OBP, but no cluster services will be available on these machines.
The key to understanding quorum is learning how votes are assigned and counted. Each node in a configured cluster has one (1) quorum vote. Each shared storage device configured as a quorum device has votes totaling the number of connected devices minus one (QD = TCD - 1). Ownership of a quorum device is assigned to one controlling node based on SCSI reservations.
阅读全文 »
Share This
归类于 数据库 | 就等您评论了 »