rhel5.5 安装spacewalk1.6

经过一周努力,终于安装完成了spacewalk,并成功部署并注册了系统。下面就把整个的部署过程记录一下,欢迎大家批评指正。 

下面的话摘自Spacewalk的官方网站:
“Spacewalk是一个开源(GPLv2)Linux系统管理解决方案,它是Red Hat网络卫星(Network Satellite)项目衍生出来的上游社区项目,Spacewalk管理Red Hat衍生发行版的软件内容更新,如Fedora、CentOS和Scientific Linux,你可以通过不同的环境准备软件内容,管理系统更新内容的部署。它提供了一个清爽了Web控制界面,可查看系统和软件更新状态,以及启动更新操作。”
Spacewalk的重要特性:
1、系统硬件和软件信息清单
2、在你的系统上安装和更新软件
3、收集和发布你的自定义软件包到管理组
4、准备(通过kickstart)你的系统
5、管理和部署配置文件到你的系统
6、监控你的系统
7、准备和启动/停止/配置虚拟客户机
8、跨多个地理位置高效地分发内容

  
  
  
  

  1.  
  2. 安装准备: 
  3. rhel 5的系统 ,我这是rhel5.5
  4. 服务器要求可以上网,SELINUX 是permissive or enforcing 
  5.  
  6. #配置yum仓库 
  7. 1.配置好系统光盘yum仓库 
  8.  
  9. 2.spacewalk 服务器yum仓库 
  10. cat > /etc/yum.repos.d/spacewalk.repo << 'EOF' 
  11. [spacewalk] 
  12. name=Spacewalk 
  13. # RHEL 5 / CentOS 5 
  14. baseurl=http://spacewalk.redhat.com/yum/nightly/RHEL/5/$basearch/ 
  15. # RHEL 6 
  16. #baseurl=http://spacewalk.redhat.com/yum/nightly/RHEL/6/$basearch/ 
  17. # Fedora 14 
  18. #baseurl=http://spacewalk.redhat.com/yum/nightly/Fedora/14/$basearch/ 
  19. # Fedora 15 
  20. #baseurl=http://spacewalk.redhat.com/yum/nightly/Fedora/15/$basearch/ 
  21. gpgkey=http://spacewalk.redhat.com/yum/RPM-GPG-KEY-spacewalk-2010 
  22. enabled=1 
  23. gpgcheck=0 
  24. EOF 
  25.  
  26. 3.spacewalk 客户端yum仓库 
  27. cat > /etc/yum.repos.d/spacewalk-client.repo << 'EOF' 
  28. [spacewalk-client] 
  29. name=Spacewalk 
  30. # RHEL 5 / CentOS 5 
  31. baseurl=http://spacewalk.redhat.com/yum/nightly-client/RHEL/5/$basearch/ 
  32. # RHEL 6 / CentOS 6 
  33. #baseurl=http://spacewalk.redhat.com/yum/nightly-client/RHEL/6/$basearch/ 
  34. # Fedora 14 
  35. #baseurl=http://spacewalk.redhat.com/yum/nightly-client/Fedora/14/$basearch/ 
  36. # Fedora 15 
  37. #baseurl=http://spacewalk.redhat.com/yum/nightly-client/Fedora/15/$basearch/ 
  38. gpgkey=http://spacewalk.redhat.com/yum/RPM-GPG-KEY-spacewalk-2010 
  39. enabled=1 
  40. gpgcheck=0 
  41. EOF 
  42.  
  43. 4.配置EPEL yum仓库 
  44. # rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm 
  45.  
  46. 5.下载如下三个包在oracle 官网,需要注册账号一个账号才可以下 
  47. 地址: 
  48. x86_64=http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html 
  49. x86=http://www.oracle.com/technetwork/topics/linuxsoft-082809.html 
  50.  
  51. oracle-instantclient11.2-basic-11.2.0.2.0.x86_64.rpm 
  52. oracle-instantclient11.2-sqlplus-11.2.0.2.0.x86_64.rpm 
  53. oracle-xe-univ-10.2.0.1-1.0.i386.rpm, 
  54.  
  55. 6: 创建oracle使用的用户及组
  56. # /usr/sbin/groupadd -r dba 
  57. # /usr/sbin/useradd -r -M -g dba -d /usr/lib/oracle/xe -s /bin/bash oracle 
  58.  
  59.  
  60. 7.确定如下包是否安装,oracle-xe需要 
  61. # yum -y install bc libc.so.6 libaio.so.1 
  62.  
  63. 8. 安装oracle-xe
  64. # yum -y localinstall --nogpgcheck oracle-xe-univ-10.2.0.1-1.0.i386.rpm 
  65.  
  66. 9. 安装oracle-xez
  67. # yum -y localinstall --nogpgcheck oracle-instantclient11.2-* 
  68.  
  69. 10. 
  70. # yum -y install oracle-lib-compat 
  71.  
  72. 11. 
  73. yum -y install oracle-xe-selinux oracle-instantclient-selinux oracle-instantclient-sqlplus-selinux 
  74.  
  75. 12.初始化oracle配置,将应用端口由原来的8080改为9055,其他默认: 
  76. [root@spacewalk ~]#  /etc/init.d/oracle-xe configure  
  77.  
  78. Oracle Database 10g Express Edition Configuration 
  79. ------------------------------------------------- 
  80. This will configure on-boot properties of Oracle Database 10g Express  
  81. Edition.  The following questions will determine whether the database should  
  82. be starting upon system boot, the ports it will use, and the passwords that  
  83. will be used for database accounts.  Press <Enter> to accept the defaults.  
  84. Ctrl-C will abort. 
  85.  
  86. Specify the HTTP port that will be used for Oracle Application Express [8080]:9055 
  87.  
  88. Specify a port that will be used for the database listener [1521]: 
  89.  
  90. Specify a password to be used for database accounts.  Note that the same 
  91. password will be used for SYS and SYSTEM.  Oracle recommends the use of  
  92. different passwords for each database account.  This can be done after  
  93. initial configuration: 
  94. Confirm the password: 
  95.  
  96. Do you want Oracle Database 10g Express Edition to be started on boot (y/n) [y]: 
  97.  
  98. Starting Oracle Net Listener...Done 
  99. Configuring Database...Done 
  100. Starting Oracle Database 10g Express Edition Instance...Done 
  101. Installation Completed Successfully. 
  102. To access the Database Home Page go to "http://127.0.0.1:9055/apex" 
  103.  
  104.  
  105.   
  106. 如果要重新初始化oracle-xe,执行如下命令: 
  107. #rpm -e racle-xe-univ 
  108. # yum -y localinstall --nogpgcheck oracle-xe-univ-10.2.0.1-1.0.i386.rpm 
  109.  
  110.  
  111.  
  112.  
  113. 13. vi /etc/tnsnames.ora 
  114. XE = 
  115.     (DESCRIPTION = 
  116.        (ADDRESS_LIST = 
  117.           (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)) 
  118.        ) 
  119.        (CONNECT_DATA = 
  120.           (SERVICE_NAME = xe
  121.        ) 
  122.     ) 
  123.      
  124. 14.   测试是否可以连通 
  125.  
  126. sqlplus system@xe 
  127.  
  128. 15.创建spacewalk用户 
  129.  
  130. # sqlplus 'sys/<password>@//localhost/XE as sysdba' 
  131. SQL> create user spacewalk identified by spacewalk default tablespace users; 
  132. SQL> grant dba to spacewalk; 
  133. SQL> quit 
  134.  
  135. 16.优化oracle-xe 数据库 
  136.  
  137. # sqlplus spacewalk/spacewalk@//localhost/XE 
  138. SQL> alter system set processes = 400 scope=spfile;  
  139. SQL> alter system set "_optimizer_filter_pred_pullup"=false scope=spfile;  
  140. SQL> alter system set "_optimizer_cost_based_transformation"=off scope=spfile;  
  141. SQL> quit   
  142. # /sbin/service oracle-xe restart 
  143.  
  144. #可选,增强oracle-xe功能 
  145. yum install rlwrap 
  146.  
  147. 17. 开始安装 
  148. yum install -y spacewalk-oracle 
  149. 这块可能要安装好久,因为软件包很多有200多个包。 
  150.  
  151. yum update 
  152. reboot 
  153.  
  154.  
  155. 18.spacewalk 配置 
  156.  
  157. [root@spacewalk ~]# spacewalk-setup 
  158. * Setting up Oracle environment. 
  159. * Setting up database. 
  160. ** Database: Setting up database connection for Oracle backend. 
  161. Database service name (SID)? XE 
  162. Username? spacewalk 
  163. Password?  
  164. ** Database: Testing database connection. 
  165. ** Database: Populating database. 
  166. *** Progress: #### 
  167. * Setting up users and groups. 
  168. ** GPG: Initializing GPG and importing key. 
  169. ** GPG: Creating /root/.gnupg directory 
  170. You must enter an email address. 
  171. Admin Email Address? [email protected] 
  172. * Performing initial configuration. 
  173. * Activating Spacewalk. 
  174. ** Loading Spacewalk Certificate. 
  175. ** Verifying certificate locally. 
  176. ** Activating Spacewalk. 
  177. * Enabling Monitoring. 
  178. * Configuring apache SSL virtual host. 
  179. Should setup configure apache's default ssl server for you (saves original ssl.conf) [Y]? y 
  180. ** /etc/httpd/conf.d/ssl.conf has been backed up to ssl.conf-swsave 
  181. * Configuring tomcat. 
  182. ** /etc/tomcat5/tomcat5.conf has been backed up to tomcat5.conf-swsave 
  183. ** /etc/tomcat5/server.xml has been backed up to server.xml-swsave 
  184. ** /etc/tomcat5/web.xml has been backed up to web.xml-swsave 
  185. * Configuring jabberd. 
  186. * Creating SSL certificates. 
  187. CA certificate password?  
  188. Re-enter CA certificate password?  
  189. Organization? Test, Inc. 
  190. Organization Unit [spacewalk.test.com]?  
  191. Email Address [[email protected]]?  
  192. City? Beijing 
  193. State? China 
  194. Country code (Examples: "US", "JP", "IN", or type "?" to see a list)? CN 
  195. ** SSL: Generating CA certificate. 
  196. ** SSL: Deploying CA certificate. 
  197. ** SSL: Generating server certificate. 
  198. ** SSL: Storing SSL certificates. 
  199. * Deploying configuration files. 
  200. * Update configuration in database. 
  201. * Setting up Cobbler.. 
  202. Cobbler requires tftp and xinetd services be turned on for PXE provisioning functionality. Enable these services [Y/n]?Y 
  203. cobblerd does not appear to be running/accessible 
  204. * Restarting services. 
  205. Installation complete. 
  206. Visit https://spacewalk.test.com to create the Spacewalk administrator account. 
  207.  
  208.  
  209.  
  210. mkdir -p /var/iso-images 
  211. mkdir -p /var/distro-trees/ 
  212. cp rhel-5.5-x86_64.iso /var/iso-images 
  213. mkdir /var/distro-trees/rhel5.5-x86_64 
  214. mount -o loop /var/iso-images/rhel5.5-x86_64.iso /var/distro-trees/rhel5.5-x86_64 
  215.  
  216.  
  217. rhnpush -v --server localhost -u rhnadmin -p hell0123 --channel rhel5.5-base-x86_64 /var/distro-trees/rhel5.5-x86_64/Server/*.rpm 
  218.  
  219. Connecting to http://localhost/APP 
  220. Package /var/distro-trees/rhel5.5-x86_64/Server/a2ps-4.13b-57.2.el5.x86_64.rpm already exists on the RHN Server-- Skipping Upload.... 
  221. Package /var/distro-trees/rhel5.5-x86_64/Server/acl-2.2.39-6.el5.x86_64.rpm already exists on the RHN Server-- Skipping Upload.... 
  222. Package /var/distro-trees/rhel5.5-x86_64/Server/acpid-1.0.4-9.el5_4.2.x86_64.rpm already exists on the RHN Server-- Skipping Upload.... 
  223. Package /var/distro-trees/rhel5.5-x86_64/Server/adaptx-0.9.13-3jpp.1.x86_64.rpm already exists on the RHN Server-- Skipping Upload.... 
  224.  
  225.  
  226.  cp RPM-GPG-KEY-redhat-release /var/www/html/pub/RPM-GPG-KEY-redhat-release-rhel5.5-x86_64 
  227.   

 

你可能感兴趣的:(职场,休闲,rhel5,spacewalk)