在Oracle Solaris平台的早期版本中,管理员使用SVR4包管理将软件安装到系统上,然后使用一组不同的命令安装补丁来更新系统。虽然最终结果是更新了系统,但此过程通常十分耗时且容易出错,因为管理员必须费力地研究应安装哪些软件包,哪些补丁和建议的补丁集是需要的,以及需要按什么顺序应用补丁。如果通过使用Oracle Solaris区域配置任何虚拟环境,则工作就会愈加复杂,对于管理员几乎无自动化可言。为了确保整个数据中心更好的一致性,管理员往往会从头重装系统,而不是花时间修补系统。
IPS是一个集成解决方案,通过将打补丁与软件包更新集成,有助于实现Oracle Solaris 11上系统软件管理过程自动化并降低其复杂性。它依赖于一种以网络为中心、自动进行软件依赖性检查和验证的高效方法,构建在以Oracle Solaris ZFS作为默认根文件系统的基础上。
使用IPS 可以跨许多不同的系统可靠地安装或复制一组精确的软件包版本,更清晰地了解任何给定系统上安装的软件版本之间的任何差异。
更重要的是,IPS利用ZFS快照和克隆功能的优点大大提高了系统升级的安全性,您可将更改应用到克隆或备用引导环境 (BE),这样便可在活动系统运行关键应用程序或服务时安排系统更新。当可以安排一段时间进行计划内维护时,只需将系统重新引导至新的BE,即可更快地启动并运行系统,同时大大缩短系统停机时间。如果在新环境中遇到任何问题,只需关闭系统并引导返回旧环境。
IPS改进了与Oracle Solaris区域的集成,您可以自动更新任何非全局区域,以确保整个系统的一致性。一个额外的好处是每个非全局区域的各个软件系统都独立于全局区域。
安装Solaris 11.3
Solaris 11.3的安装很简单,和之前老版本比起来简单多了。我们可以通过下面的方式安装。
Oracle Solaris 11.3 Live Media,图形化界面安装, 和Window PE工具很像。
Oracle Solaris 11.3 Text Installer,交互式安装,文本模式。
IPS是以网络为中心的软件包管理解决方案。所有新安装的Oracle Solaris 11都配置为只有一个默认发布者solaris,它提供的软件包来自公开发布的Oracle Solaris 11信息库 (http://pkg.oracle.com/solaris/release)。但这个需要连接公网来实现,对于客户来说,有时还是有点担心的。IPS就像Linux上YUM,配置好了,使用起来非常方便。
PUBLISHER TYPE STATUS URI
solaris origin online http://pkg.oracle.com/solaris/release/
本文通过V78246-01的压缩文件配置IPS、生成iso文件。然后通过生成的iso来配置IPS,再到配置IPS web服务器,这样客户端就可以通过内网的服务器来访问了。
首先需要从Edelivery上获取11.3的IPS repository安装文件(包含SPARC和x86),文件如下
root@solaris:/ohs# cd /mnt/ root@solaris:/mnt# ls -l total 16465369 -rwxrwxrwx 1 root root 3922 Oct 7 2015 README-zipped-repo.txt -rwxrwxrwx 1 root root 1540097274 Nov 3 13:18 V78246-01_1of5.zip -rwxrwxrwx 1 root root 1730669364 Nov 3 13:13 V78246-01_2of5.zip -rwxrwxrwx 1 root root 1717187368 Nov 3 13:18 V78246-01_3of5.zip -rwxrwxrwx 1 root root 1871913207 Nov 3 13:23 V78246-01_4of5.zip -rwxrwxrwx 1 root root 1570373423 Nov 3 13:28 V78246-01_5of5.zip -rwxrwxrwx 1 root root 11612 Oct 7 2015 install-repo.ksh -rwxrwxrwx 1 root root 285 Oct 8 2015 sol-11_3-repo_md5sums.txt root@solaris:/mnt# root@solaris:/ohs# pkg publisher PUBLISHER TYPE STATUS P LOCATION solaris origin online F http://pkg.oracle.com/solaris/release/ root@solaris:/ohs# pkg unset-publisher solaris #删除默认的solaris的publisher Updating package cache 1/1 root@solaris:/ohs# pkg publisher PUBLISHER TYPE STATUS P LOCATION root@solaris:/ohs#
我们也可以从下面的链接下载IPS repository需要的文件(包含SPARC和x86)
http://www.oracle.com/technetwork/server-storage/solaris11/downloads/local-repository-2245081.html
Follow the instructions in the README by downloading the assembly script,The repository will contain both SPARC and x86 packages.
Repository Assembly Script (install-repo.ksh)
MD5 Checksums
Oracle Solaris 11.3 Repository (Part 1) (1.4 GB)
Oracle Solaris 11.3 Repository (Part 2) (1.6 GB)
Oracle Solaris 11.3 Repository (Part 3) (1.6 GB)
Oracle Solaris 11.3 Repository (Part 4) (1.7 GB)
Oracle Solaris 11.3 Repository (Part 5) (1.5 GB)
创建ISO镜像
root@solaris:/mnt# ./install-repo.ksh -d /ohs -I -v #这个命令会创建一个iso镜像,并会把文件复制到/ohs下 Using V78246-01 files for sol-11_3-repo download. Uncompressing V78246-01_1of5.zip...done. Uncompressing V78246-01_2of5.zip...done. Uncompressing V78246-01_3of5.zip...done. Uncompressing V78246-01_4of5.zip...done. Uncompressing V78246-01_5of5.zip...done. Repository can be found in /ohs. Initiating repository verification. Building ISO image...done. ISO image can be found at: /mnt/sol-11_3-repo.iso Instructions for using the ISO image can be found at: /ohs/README-repo-iso.txt root@solaris:/ohs# ps auxww|grep mkisofs #这个是创建iso的命令 root 1535 8.5 22.9357192356376 pts/1 S 13:27:37 4:07 /usr/bin/mkisofs -o /mnt/sol-11_3-repo.iso -no-limit-pathtables -l -allow-leading-dots -A Oracle Solaris sol-11_3-repo Release Repository -publisher Copyright 2014 Oracle and/or its affiliates. All rights reserved. -p pkg-inquiry_ww@oracle.com -R -uid 0 -gid 0 -V SOL-11_3_REPO -v -graft-points repo/publisher=publisher repo/pkg5.repository=pkg5.repository COPYRIGHT NOTICES README-repo-iso.txt root@solaris:/ohs# root@solaris:/mnt# cd /ohs/ root@solaris:/ohs# ls COPYRIGHT pkg5.repository README-repo-iso.txt NOTICES publisher readme.txt root@solaris:/ohs# cd publisher/ root@solaris:/ohs/publisher# ls solaris root@solaris:/ohs/publisher# cd solaris/ root@solaris:/ohs/publisher/solaris# pwd /ohs/publisher/solaris root@solaris:/ohs/publisher/solaris# ls catalog file index pkg tmp trans root@solaris:/ohs/publisher/solaris#
设置IPS
root@solaris:~# pkg set-publisher -P -g file:///ohs solaris root@solaris:~# pkg publisher PUBLISHER TYPE STATUS P LOCATION solaris origin online F file:///ohs/ root@solaris:~# root@solaris:~# pkg publisher solaris #IPS信息,位置为本地的目录/ohs Publisher: solaris Alias: Origin URI: file:///ohs/ SSL Key: None SSL Cert: None Client UUID: 91df62d8-a287-11e6-a626-a39908161483 Catalog Updated: Tue Oct 06 19:45:07 2015 Enabled: Yes root@solaris:~# root@solaris:~# pkg list solaris-desktop pkg list: No packages matching 'solaris-desktop' installed root@solaris:~# pkg search solaris-desktop #搜索桌面的安装包 INDEX ACTION VALUE PACKAGE pkg.fmri set solaris/group/system/solaris-desktop pkg:/group/system/solaris-desktop@0.5.11-0.175.3.1.0.5.0 root@solaris:~# pkg install solaris-desktop Packages to install: 1 Create boot environment: No Create backup boot environment: No DOWNLOAD PKGS FILES XFER (MB) SPEED Completed 1/1 3/3 0.0/0.0 0B/s PHASE ITEMS Installing new actions 425/425 Updating package state database Done Updating package cache 0/0 Updating image state Done Creating fast lookup database Done Updating package cache 1/1 root@solaris:~# root@solaris:~# which startx /usr/bin/startx root@solaris:~# which gnome-session /usr/bin/gnome-session root@solaris:~#reboot -p #重启后就可以进入桌面模式了
通过ISO镜像创建IPS
root@solaris:/ohs# cd /export/home/ohsdba root@solaris:/export/home/ohsdba# ls -l sol-11_3-repo.iso -rwxrwxrwx 1 root root 9940729856 Nov 4 19:46 sol-11_3-repo.iso root@solaris:/export/home/ohsdba# lofiadm -a sol-11_3-repo.iso #加载iso文件 /dev/lofi/1 root@solaris:/export/home/ohsdba# mount -F hsfs -o ro /dev/lofi/1 /mnt #挂载iso文件到 /mnt root@solaris:/export/home/ohsdba# ls /mnt COPYRIGHT NOTICES README-repo-iso.txt repo root@solaris:/export/home/ohsdba# root@solaris:/mnt# pkg set-publisher -G '*' -M '*' -g /mnt/repo solaris #设置IPS -G ’*’ Removes all existing origins for the solaris publisher. -M ’*’ Removes all existing mirrors for the solaris publisher. -g Adds the URI of the newly-created local repository as the new origin for the “solaris” publisher. root@solaris:/mnt# root@solaris:/mnt# pkg publisher PUBLISHER TYPE STATUS P LOCATION solaris origin online F file:///mnt/repo/ root@solaris:/mnt# root@solaris:/mnt#
我们还可以将iso镜像同步到本地,然后再创建IPS
root@solaris:/export/home/ohsdba# mkdir /IPS root@solaris:# rsync -aP /mnt/ /IPS root@solaris:/IPS/repo# pkg publisher PUBLISHER TYPE STATUS P LOCATION solaris origin online F file:///mnt/repo/ root@solaris:/IPS/repo# pkg set-publisher -m file:///IPS/repo solaris #增加一镜像,选项为-m root@solaris:/IPS/repo# pkg publisher PUBLISHER TYPE STATUS P LOCATION solaris origin online F file:///mnt/repo/ solaris mirror online F file:///IPS/repo/ root@solaris:/IPS/repo# root@solaris:/IPS/repo# pkg unset-publisher solaris Updating package cache 1/1 root@solaris:/IPS/repo# pkg publisher PUBLISHER TYPE STATUS P LOCATION root@solaris:/IPS/repo# pkg set-publisher -G '*' -M '*' -g /IPS/repo solaris root@solaris:/IPS/repo# pkg publisher PUBLISHER TYPE STATUS P LOCATION solaris origin online F file:///IPS/repo/ root@solaris:/IPS/repo#
如何配置IPS服务器?
配置IPS服务器后,其他客户端可以通过http连接IPS root@solaris:/IPS/repo# svccfg -s application/pkg/server setprop pkg/inst_root=/IPS/repo #这里的/IPS/repo为安装的目录 root@solaris:/IPS/repo# svccfg -s application/pkg/server setprop pkg/readonly=true root@solaris:/IPS/repo# svcprop -p pkg/inst_root application/pkg/server /IPS/repo root@solaris:/IPS/repo# svcadm refresh application/pkg/server root@solaris:/IPS/repo# svcadm enable application/pkg/server root@solaris:/IPS/repo# pkg set-publisher -O http://10.0.2.30 solaris #设置IPS为http root@solaris:/IPS/repo# pkg publisher PUBLISHER TYPE STATUS P LOCATION solaris origin online F http://10.0.2.30/ 注意:如果80端口没占用,可以通过下面的命令设置新的端口 svccfg -s application/pkg/server setprop pkg/port=<port_number> root@solaris:/IPS/repo# pkg search solaris-desktop INDEX ACTION VALUE PACKAGE pkg.fmri set solaris/group/system/solaris-desktop pkg:/group/system/solaris-desktop@0.5.11-0.175.3.1.0.5.0 root@solaris:/IPS/repo# root@solaris:~# curl http://10.0.2.30 This resource can be found at <a href='http://10.0.2.30/en/index.shtml'>http://10.0.2.30/en/index.shtml</a>.root@solaris:~# root@solaris:~# http://10.0.2.30/en/index.shtml
root@solaris:/export/home/ohsdba# pkg history -o start,time,operation,outcome -n3 START TIME OPERATION OUTCOME 2016-11-04T22:14:12 0:00:03 refresh-publishers Succeeded 2016-11-04T22:14:12 0:00:03 update-publisher Succeeded 2016-11-04T22:14:14 0:00:01 rebuild-image-catalogs Succeeded root@solaris:/export/home/ohsdba# root@solaris:~# pkg purge-history History purged. root@solaris:~#
如何移除publisher?
root@solaris:/IPS/repo# pkg unset-publisher solaris
如何更新IPS?
root@solaris:~#pkgrecv -s http://pkg.oracle.com/solaris/release/ -d /IPS/repo '*'
如果在Solaris上安装RAC,可以用mpxio多路径软件。如果你用EMC存储,可以用PowerPath
Solaris其他文档
Oracle Solaris 11.2 中的新特性
OpenStack
Oracle Solaris 内核区域
使用统一存档进行克隆和系统恢复
网络虚拟化和应用定义的网络
从 Oracle Solaris 10 迁移到 Oracle Solaris 11.2
安装
软件更新
网络和网络服务
数据管理
安全性与合规性
虚拟化
系统服务
开发人员环境与工具
http://www.oracle.com/technetwork/cn/articles/servers-storage-dev/o11-018-howto-update-s11-1572261-zhs.html
http://docs.oracle.com/cd/E23824_01/html/E21802/publisher-config.html
http://www.unixarena.com/2013/02/how-to-create-ips-repository-in-solaris11.html
http://www.oracle.com/technetwork/cn/server-storage/solaris11/documentation/index.html
http://www.oracle.com/technetwork/server-storage/solaris11/downloads/install-2245079.html