7/30/2007
PS shell variable
Changing your Command Prompt (the PS1 shell variable) |
The UNIX shell displays a command prompt when the system is ready to accept commands on the command line. The default command prompt is a single character (typically $ or #). Changing or customizing the command prompt makes your life easier when jumping from system to system, or when logging in as multiple users on a single system (e.g. your personal/non-privileged account and root). To customize your prompt you will need to modify the PS1 shell variable. PS1 stands for "prompt string 1" and defines the primary prompt string. If you wanted your command prompt to contain the current username and hostname separated by the "@" character and enclosed in brackets (e.g. [root@hawk] #), PS1 would need to be re-defined with the following command(s): |
|
The shell variable LOGNAME contains the username you logged in with, and $(hostname) will execute the hostname command which will print the name of the current host system. Exporting PS1 makes it available to any subshells you create during the login session. Since PS1 in this example was re-defined on the command line, it will be lost as soon as you log out. To retain this definition across login sessions you will need to add the previous command(s) to your shell initialization file (.profile if the Korn shell is your default shell). |
Posted by Yonghang Wang at 7/30/2007 04:01:00 下午 3 comments
Labels: UNIX
Korn Shell Arrays
$ colors[0]=RED |
Alternatively, you can perform the same assignments using a single command: |
|
Adding a dollar sign and an opening brace to the front of the general syntax and a closing brace on the end allows you to access individual array elements: |
|
Using the array we defined above, let's access (print) each array element one by one: |
|
If you access an array without specifying a subscript, 0 will be used: |
|
The while construct can be used to loop through each position in the array: |
|
Posted by Yonghang Wang at 7/30/2007 03:55:00 下午 0 comments
Labels: UNIX
3/20/2007
paging space是置于rootvg还是放在盘阵上好呢?
我先来扔块砖, 想听听大家的意见।
----------------
我的考虑
paging space是置于rootvg上好呢还是放在盘阵上呢?
一个前提,我们考虑的情况是,由于某种原因---比如部署了一个新的未经充分调优的应用,甚至只是个别巨大的ad-hoc查询---从而导致较大的paging space使用,如果要说一个数字的话,那么我们考虑30%以上... 当然,这种情况是我们必须极力避免的,我们这里只是考察在这种极端情况下的能够争取的一点点性能.
业务的性质决定paging space的访问模式.我们先考虑BI等olap应用.
使用paging的时候一般伴随着较大数据块的换入换出,对paging的要求和数据空间类似是要求大的数据带宽. 从这一点讲使用盘阵就有比较大的优势.
还有一个考虑, 现在盘阵一般实现为raid5,对写入操作的写惩罚也是必须考虑的. 但是应该记得盘阵上的电池和缓存. 系统对盘阵的写操作应该是以写到盘阵缓存为准,一般不用等待寻道和写入的时间, 这样盘阵的写入IO相比本地盘就又有了额外的优势.
很多时候,我们会对rootvg做mirror,这会给使用rootvg做paging space减分.
一般情况下单台server需要配置的paging space达到128G就几乎是顶点了. 即使是两台server的群集,加起来也没有实际两块硬盘大.
所以,对olap应用,个人倾向于使用盘阵作为paging space,即使没有raid10। raid5相对本地盘,尤其是做过mirror的本地盘应该是有比较明显的优势的।
------------------
HDS的建议
1) HDS存储支持将Paging Space空间摆放在HDS AMS1000存储阵列上。
2) 从HDS 有关HDLM技术文档描述上看,Paging Space的磁盘卷不可以通过HDLM进行管理。这样存在单链路故障导致Paging Space不可访问的风险。
3) 综合考虑,最佳的摆放方法是将Paging Space空间摆放在服务器的内置硬盘上。
--------------------
<---
只有结论,没有分析啊.
1. HDLM为什么不支持? 或者说为什么支持不好? 这是否是因为有什么特殊的设计以至于对特定类型的IO支持不好?
2. 即使使用单链路,盘阵io的优点仍然不可以否认. 交换机与光纤故障的几率就比作为paging的内置盘高? 有数据?
3. 使用内置盘,即使使用mirror仍然不能避免单点. 在运行的时候任何一块盘的损伤都会造成因为数据不一致而虚地址访问故障.
我承认采用内置盘是"传统"上最"安全"的"决策"।但是我希望能够借此机会来澄清也学习一下. 我觉得从paging和盘阵的技术特定以及相关软件的限制来讨论比较好.
Posted by Yonghang Wang at 3/20/2007 06:15:00 上午 1 comments