AIX系统安装后的基本设置过程
当你安装完AIX后,你也许想知道下一步怎么做?如何安装软件、打补丁等等工作,以下是一个安装后需要做的工作列表,如果有哪需要补充的话,请通知我,呵呵。这就是Wiki的魅力所在。
当AIX安装完成并自动重起后,系统会自动出现安装助手界面。大部分人通常会选择直接退出此向导界面,然而你也可以在任何时候再次启动此界面。
以root用户启动命令行,输入:install_assist命令,你将重新看到熟悉的安装助手界面。
在安装助手界面,你可以完成以下任务(对于新手来说,这是一个相当好的开始,至少不必发帖问:我怎样才能设置时间和时区?实际上我看过好多系统连时区都不曾改动过,哈。):
设置日期与时间
设置root密码
配置网络信息
安装软件
时间、日期与时区设置
实际上很容易忘记设置时间、日期与时区,但很多应用依赖于此,因此你至少得让系统时间大概上是准确的吧。如果需要更精确的时间同步,可以设置一个时间服务器来让时间在机器间保持同步。(NTP主题)
任务命令(root权限)
通过smitty date设置时间、日期
通过smitty chtz设置时区(注意夏令时哟)
设置root密码
root密码就是系统大门的第一道锁,因此请尽量设置负责的规则,数字、字母混用,但别超过8位。通常,应该按月份/季度更改密码。
任务命令(root权限)
通过passwd命令设置root密码
想了解你的机器的所有信息?ok,那我们来做配置检查工作吧。
如果机器是新安装或者是一个新创建的LPAR分区,你应该从以下途径得知你的机器上的部件信息:
部件列表---从IBM或者IBM商业合作伙伴下单得到的东西(利润、黑暗等等事情将在此发光,哈)
检查机器的硬盘、RAM、卡等等信息,把它整理成一个列表记下来
从HMC上检查LPAR配置信息
从IVM上检查LPAR配置信息
对于所有部件,你应该在AIX上看到并实际上是可用的。如果是defined状态,再次仔细检查。
任务命令(root权限)
通过lsconf命令列出配置和部件信息
由于输出信息是一个很长的输出列表,信息你应该通过管道符将输出信息交给pg进行翻页查看。
你应该检查每个部件是否存在并且了解输出信息中的每个部件所代表的意思。
特别重要的是了解以太网端口,这样你才能知道en0是哪个物理端口,然后你才能将以太网线连接到正确的端口上。
输出信息的第一部分对我们来说特别有用。例如,在我的机器上:
Resource Details
System Model IBM,9124-720(openpower机器,哈)
Machine Serial Number (deleted)
Processor Type PowerPC_POWER5
Number Of Processors 2
Processor Clock Speed 1654 MHz
CPU Type 64-bit
Kernel Type 64-bit
LPAR Info 5 IBM_VIO_Server
Memory Size 2048 MB
Good Memory Size 2048 MB
Platform Firmware level Not Available
Firmware Version IBM,SF235_152
Console Login enable
Auto Restart true
Full Core false
通过以上输出,我们可以马上了解到机器的型号、cpu数量、频率以及内存配置信息是否正确并且出于正常状态。
启用64位内核 - 这个特性是在安装时选择的,并且可以在安装后进行更改,但需要重起机器.
Firmware版本是正确的,并处于最新状态- 在新机器上推荐保持最新版本的firmware-它总能解决一些问题.
配置网络
ok,现在你可能厌烦使用从hmc上打开终端或者VTERM的方式来访问主机,但你还是希望通过网络来访问主机,因此你可以在办公桌上完成剩余的工作。
虽然常规UNIX的ifconfig命令可以立即把地址启用,但不推荐这么做,因为它并不是把配置永久保存,你会发现下次重起后配置信息会消息。首先,你需要确认那个网卡端口计划用于访问并管理机器,假设其它端口有其它需求,例如用户访问或者备份。lsconf命令可以将以太网端口的详细信息列出来:
任务命令
列出网络端口 lsdev -Cc adapter
设置IP地址 smitty tcpip
smitty --> Communications Applications and Services --> TCP/IP --> Minimum Configuration & Startup.
在这里你可以设置关于网卡的所有信息,通知推荐设置完成后重起机器。选择你想设置的网卡端口,添加常规网络设置包括网关、DNS等。在这里要注意选择en(例如en0)开头的接口类型,不要选择ent开头的接口类型。
同样要注意的是,不要通过此种方式设置其它的网卡或网络信息,应该选择如下方式:
smitty --> Communications Applications and Services --> TCP/IP --> Further Configuration pannel
检查错误信息 - errrpt和errclear命令
检查系统记录的错误日志.
任务命令
简要列出错误信息 errpt
将所有信息详细列出 errpt -a
将所有信息定向到文件 中errpt -a > /tmp/errors
清空错误信息 errclear 0
如何知道系统目前的内核信息?
AIX 5.2, 默认安装32位内核.
AIX 5.3, 默认在64位硬件主机上安装64位内核,在32位硬件主机上安装32位内核.
任务命令
了解内核版本 bootinfo -K /lsconf
了解AIX版本?
了解AIX发行及维护版本(ML) oslevel -r
当前维护版本(ML) instfix -i | grep ML
分页空间
现实中一个经典错误是没有设置足够的分页空间. 老的UNIX手册会标明 "如果分页空间耗尽, 系统将崩溃". 分页空间的大小没有最佳推荐值,它依赖于配置、应用及负载。(通常来说,对于数据库及大负荷系统,4G内存以下,分页空间的大小为内存的2倍;8G-32G之间,分页空间的大小与内存数量相等;大于32G,可为内存数量的一半。)
在系统开始运行前,可对分页空间进行持续监控以确定一个相当合适的数值。
以下是一些常见推荐方式:
分页空间永远不要小于2GB
最好是内存的两倍
RDBMS应用通常有很大的缓存,可以减少分页空间需求
将分页空间跨越多个磁盘以获得更高的吞吐量
不要对分页空间进行镜像
任务命令
列出分页空间大小 lsps -s
添加分页空间 smitty pgsp
系统环境调优
There are a number of AIX tunable parameters that are worth checking early on. All these can be found in a single smitty panel.
This includes:
Maximum number of PROCESSES allowed per user
Maximum number of pages in block I/O BUFFER CACHE
Maximum Kbytes of real memory allowed for MBUFS
Automatically REBOOT system after a crash
Continuously maintain DISK I/O history
HIGH water mark for pending write I/Os per file
LOW water mark for pending write I/Os per file
Maximum login name length at boot time
Stack Execution Disable (SED) Mode
ARG/ENV list size in 4K byte blocks
CPU Guard
Either take smitty --> System Environments --> Change / Show Characteristics of Operating System
or the following short cut:
Task Command
System Environment smitty chgsys
Add paging spaces smitty pgsp
Open Source and Freely available programs
There are many Open Source programs available pre-compiled for AIX that are very useful. See the "Getting Start" section of this AIX wiki for more details on where to find them. My favorites are below but you will have to make your own mind up:
Application/Tool Comments
VNC Free X Windows for PC - zero install/setup/graphics/can reconnect, you install and run the VNC Server on AIX
vim vi with advanced features like colourised code and no AIX maximum line length limits
Ethereal for network analysis
Apache you can install the HTTP webserver from IBM which is based on Apache or the original version
Samba for file access to and from Windows based machines
wget fetches the contents of a website to you disk
MySQL the Open Source database
GCC compilers the GNU Compiler Collection
nmon for performance monitoring
If you have a recommendation, why not add it here?
Increase core file system size
The initial installation will create small filesystems to get you started. If you have free disk space is recommended that you increase some of these immediately. For example, many strange things can happen to tools and commands if the /tmp filesystems fills up, including crashes and errors. I recommend that the following filesystems are enlarged to say four times the initial size or more
Filesystem
/tmp
/var
/home
Note: /usr tends to be grown automatically when software is added via installp.
Additional filesystems
Many sites have standard extra filesystems for backup, system admin tools, performance data etc.
These should be added and setup before install further applications.
Firmware, AIX and software Updates
If this is a stand alone machine then you should consider updating the system firmware before "going live" in to production to avoid the downtime and disruption.
Every operating system has updates and fixes and AIX is no different.
See under Maintenance in this AIX Wiki for details of best to update the firmware and AIX and related software.
Install extra packages
The AIX installation will have added the basic AIX system from the media. There are many other optional packages that can be added. It is recommended to review the optional packages and those on the Bonus pack and Expansion Pack.
Extra packages might include:
*Performance related tools
*DOS floppy disk tools (if you have a floppy disk on the machine which is increasingly rare
*Security packages like ssh
*HTTP server which is Apache plus IBM features
Users
Create users and user groups is best performed by using smitty for small numbers (say less than 20). for more than this use smitty to work out the command required by using F6.
Encourage the use of non-root user accounts and not shared accounts for security.
Many applications require a particular user account like oracle for the Oracle database or dbadmin for DB2 database.
If you have more than one RDBMS database, if possible with have different users accounts for each. This will then make Workload manager very simple to use and setup.
Reboot check
Once everything is setup it is worth doing a cold reboot of the system to ensure everything is working correctly. For example, some AIX updates require a reboot anyway and it is often forgotten and you will be running on the previous AIX kernel (no a good idea). It also checks that services hardware automatically come online like disks and networks.
Performing this reboot check here avoid any nasty surprises later one when there may be users involved and waiting.
mksysb
The AIX make a system backup command mksysb allows you to snap shot the AIX disks and use them are the basis of a recover or cloning on to an other machine. Having setup the machine exactly the way you like it, now is a good time to save it in case something goes wrong or you need to duplicate the work and want to save lots of time.
Backup and test
Don't forget to setup the backup for the whole system.
At this stage it might not be possible to test the complete recovery - hopefully you will do this after all the applications are setup and the data imported.
It is recommended that you at least perform a backup and follow this by listing out the content of the back from the media to ensure all the necessary files are present.
Has something important been skipped here?
If yes, why not add it and help others?