Chinaunix首页 | 论坛 | 博客
  • 博客访问: 261313
  • 博文数量: 61
  • 博客积分: 1370
  • 博客等级: 中尉
  • 技术积分: 452
  • 用 户 组: 普通用户
  • 注册时间: 2011-03-04 23:40
文章分类

全部博文(61)

文章存档

2012年(1)

2011年(60)

我的朋友

分类: 系统运维

2011-12-23 12:39:37

常用命令

Veritas的log缺省目录为/var/VRTSvcs/log;

Veritas的相关配置(资源等配置文件,对应与java图形终端上做的配置文件格式)目录为:/etc/VRTSvcs/conf/config;

安装VCS的License(root用户下执行),两种方法:

halic

vxlicinst –k 

使用/etc/rc.d/vcs {start|stop|restart|condrestart|status}命令可以启动、停止、重启VCS及查看VCS状态;

也可使用hastart [-stale|-force]来启动VCS;

也可使用下列命令来查看集群状态:

hastatus

hastat -sum

强制VCS读取system上$VCS_CONF/conf/config目录下的配置文件进行启动集群工作:

hasys –force systemname

启动单节点集群:

Hastart –onenode

以时间共享方式启动VCS:

Hastart –ts

关闭整个集群服务:

hastop -all [-force]

关闭集群中一台主机上的集群服务:

hastop -local

只关闭VCS相关进程,而不停止VCS所保护的服务进程:

hastop -sys system [-force | -evacuate]

使配置文件可读写:

haconf –makerw

使配置文件只读:

haconf -dump –makero

增加用户,用户默认有观察员身份:

hauser -add user

给用户添加操作权限:

将用户提升为集群管理员:

haclus -modify Administrators -add user

将用户提升为集群操作员:

haclus -modify Operators -add user;

将用户提升为服务组管理员:

hagrp  -modify service_group Adminstrators -add user

将用户提升为服务组操作员:

hagrp  -modify service_group Operators -add user

删除用户:

hauser -delete user

显示所有用户:

hauser -display

查询service_group状态:

hagrp  -state [service_group] -sys [system];

查询节点之间依赖关系:

hagrp -dep [service_group]

查询资源表:

hagrp  -resources [service_group] ;

hagrp -display [service_group] [-attribute attribute] [-sys system]

hares -display [resource]

hares -display -attribute [attribute]

hares -display -group [service_group]

hares -display -type [resource_type]

hares -display -sys [system]

查询资源代理列表:

hatype -list

hatype -resources resource_type

hatype -display [resource_type]

haagent -display [agent]

查询主机列表:

hasys -list

hasys -display [system]

haclus -value attribute

haclus –display

查询集群日志:

hamsg -list

hamsg -info [-path path_name] LDF

 

基本管理操作:

启动服务组及使服务联机:

hagrp  –online service_group –sys system

 

关闭服务组及使服务脱机:

hagrp  –offline service_group –sys system

 

将服务组切换到另一个系统上:(只对failover组有效,且当服务组中服务部分或全部联机时):

hagrp  -switch service_group -to system

 

冻结服务组(disable onlining, offlining, and failover),option -persistent 是使cluster重启时freeze:

hagrp  -freeze service_group [-persistent]

 

解冻被冻结的服务组 (reenable onlining, offlining, and failover)

hagrp  -unfreeze service_group [-persistent]

 

激活服务组:(服务组激活后才能进行联机操作)

hagrp  -enable service_group [-sys system]

 

禁用服务组:(服务组禁用后不能进行联机或切换操作)

hagrp  -disable service_group [-sys system]

 

激活服务组中资源:

hagrp  -enableresources service_group

 

禁用服务组中资源:(如资源为disable时agents不监控资源组)

hagrp  -disableresources service_group

 

清除故障状态

hagrp  -clear [service_group] -sys [system]

 

管理资源操作:

使资源联机:

hares -online resource -sys system

 

使资源脱机:

hares -offline resource -sys system

 

使资源脱机并将命令传播给子节点:

hares -offprop resource -sys system

 

提示资源代理(agent)监控指定系统上的资源:(命令可能立即返回,但监控的进程可能还没结束)

hares -probe resource -sys system

 

清洗资源,使状态从RESOURCE_FAULTED 转为oRESOURCE_OFFLINE:

hares -clear resource [-sys system]

 

管理主机:

在ADMIN_WAIT状态下强制主机加载集群,此命令会覆盖正在使用的集群配置,使用前请确认准备使用的主机的集群配置文件是否有效:

hacf –verify /etc/VRTSvcs/conf/concig

hasys -force system

 

修改主机的属性,一些属性是VCS的内部属性,不能修改:

hasys -modify modify_options

 

查询主机ID,主机ID定义在文件/etc/llttab中:

hasys –nodeid node_ID

 

冻结主机 (防止主机进行联机或切换操作)

hasys -freeze [-persistent] [-evacuate] system

 

解冻被冻结的主机 (使主机可以进行联机或切换操作)

hasys -unfreeze [-persistent] system

 

管理集群:

haclus [-help [-modify]]

 

阅读(9675) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~