Friday, December 14, 2012

How to Install Spacewalk


This page describes how to install Spacewalk server. 
Document Owner: Todd Walters 

Manage Spacewalk (stop-start all services) 
  • /usr/sbin/spacewalk-service [stop|start|restart]. 

How to Install SpaceWalk 

  1. Configure machine (VM) with at least 4gb ram and 60gb disk space. 
  2. Install (default kickstart) or as needed for your site. 
  3. Add the appropriate repo's 
    • Red Hat Enterprise Linux 5, CentOS 
    • Red Hat Enterprise Linux 6, CentOS 
    • EPEL 5 (use for RHEL 5)  
  4. CentOS 5 additional repos 
Begin install of Oracle Client. 
  1. Create Oracle User ID. 
    1. [root@ussd-dev-smx01 ~]# /usr/sbin/groupadd -r dba 
    [root@ussd-dev-smx01 ~]# /usr/sbin/useradd -r -M -g dba -d /usr/lib/oracle/xe -s /bin/bash oracle  
  2. Download Oracle XE  from Oracle; will need to register. Also download the Oracle Instant Client 
    • yum localinstall --nogpgcheck  oracle-xe-univ-10.2.0.1-1.0.i386.rpm rpm -Uvh oracle-instantclient11.2-basic-11.2.0.2.0.*.rpm  rpm -Uvh oracle-instantclient11.2-sqlplus-11.2.0.2.0.*.rpm  

    • May also need to install these two packages 
      •  rpm -ivh python-dmidecode-3.10.13-1.el5_5.1.x86_64.rpm 
      •  rpm -ivh pyOpenSSL-0.6-2.el5.x86_64.rpm  
  3. Install the following packages from the Spacewalk repository:  
    1. yum install oracle-lib-compat 
    2. yum install oracle-xe-selinux oracle-instantclient-selinux oracle-instantclient-sqlplus-selinux  

  1. Configure the Oracle database:  
    1. /etc/init.d/oracle-xe configure  
    2. Set port  9055 instead of 8080 
    3. Set db password to spacewalk 

  2. Test connection to Oracle 
    [root@smx01 space]# sqlplus 'sys/spacewalk@//localhost/XE as sysdba' 

    SQL*Plus: Release 11.2.0.2.0 Production on Mon Jan 9 10:51:12 2012 

    Copyright (c) 1982, 2010, Oracle.  All rights reserved. 


    Connected to: 
    Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production   
  3. Create the spacewalk database user 
    # sqlplus 'sys/<password>@//localhost/XE as sysdba' SQL> create user spacewalk identified by spacewalk default tablespace users; SQL> grant dba to spacewalk; SQL> quit 

    1. Test that connection 
      1. [root@smx01 space]# sqlplus spacewalk/spacewalk@//localhost/XE 

  4. Modify database for Spacewalk 
    # sqlplus spacewalk/spacewalk@//localhost/XE SQL> alter system set processes = 400 scope=spfile;  SQL> alter system set "_optimizer_filter_pred_pullup"=false scope=spfile;  SQL> alter system set "_optimizer_cost_based_transformation"=off scope=spfile;  SQL> quit   # /sbin/service oracle-xe restart  

  5. Optional. (for sql history, etc..) 
    • yum install rlwrap You can then do  
    • rlwrap sqlplus spacewalk/spacewalk@//localhost/XE  
Installing Spacewalk 

  1. Use yum to install 
    1. yum install spacewalk-oracle 

  2. Once complete, configure spacewalk 
    [root@smx01 space]# spacewalk-setup --disconnected 
    * Setting up Oracle environment. 
    * Setting up database. 
    ** Database: Setting up database connection for Oracle backend. 
    Database service name (SID)? XE 
    Username? spacewalk 
    Password? 
    ** Database: Testing database connection. 
    ** Database: Populating database. 
    *** Progress: ##################### 

    ...then generate certificate... 


  1. Verify connection and finalize configuration via WebUI 


  1. If you want manage all spacewalk services at once use  
    • /usr/sbin/spacewalk-service [stop|start|restart].  

  2. you can then proceed to the next step: Uploading Content 


Configure PAM Authentication 

  1. Modify /etc/rhn/rhn.conf and add the following line: 
    1. pam_auth_service = rhn-satellite 

  2. Edit the /etc/pam.d/rhn-satellite file and use this for SSSD 
    [root@ussd-dev-smx01 pam.d]# more rhn-satellite 
    auth        required      pam_env.so 
    auth        sufficient    pam_sss.so no_user_check 
    auth        required      pam_deny.so 
    account     required      pam_sss.so no_user_check 

  3. Restart spacewalk 
    1.  /usr/sbin/spacewalk-service restart 
  4. In SpaceWalk web, when you add new user, you should see PAM check box.  
  5. Create new User account that matches AD user. Test login 

















  


2 comments:

  1. Nice Guide. I`m installing spacewalk 1.9 on centos 5.8 using oracle 10g as db backend. I get the following error message when it tries to generate the SSL certificate.

    Have you seen this before.

    /var/lib/rhn/rhn-satellite-prep/etc/rhn/rhn.conf -> /etc/rhn/rhn.conf
    * Making backup of /etc/rhn/rhn.conf to /etc/sysconfig/rhn/backup-2013-05-15-14:00/etc/rhn/rhn.conf
    /var/lib/rhn/rhn-satellite-prep/etc/rhn/cluster.ini -> /etc/rhn/cluster.ini

    ERROR: unhandled exception occurred:
    Traceback (most recent call last):
    File "/usr/bin/rhn-satellite-activate", line 42, in ?
    sys.exit(abs(mod.main() or 0))
    File "/usr/lib/python2.4/site-packages/spacewalk/satellite_tools/rhn_satellite_activate.py", line 572, in main
    rhnSQL.initDB()
    File "/usr/lib/python2.4/site-packages/spacewalk/server/rhnSQL/__init__.py", line 102, in initDB
    __init__DB(backend, host, port, username, password, database)
    File "/usr/lib/python2.4/site-packages/spacewalk/server/rhnSQL/__init__.py", line 55, in __init__DB
    __DB.connect()
    File "/usr/lib/python2.4/site-packages/spacewalk/server/rhnSQL/driver_cx_Oracle.py", line 387, in connect
    self.dbh = self._connect()
    File "/usr/lib/python2.4/site-packages/spacewalk/server/rhnSQL/driver_cx_Oracle.py", line 413, in _connect
    dbh = cx_Oracle.Connection(self.username, self.password, self.database)
    TypeError: expecting string, unicode or buffer object

    ReplyDelete
    Replies
    1. Can you check the oracle connection and ,make sure you cnass connect? Also try the disconnected mode?

      Delete