Spacewalk - установка, настройка

СУБД Oracle

Check if you have swap > 1GB because Oracle XE RPM will need it. You can create temporary one (or grow existing) with

 dd if=/dev/zero of=/var/swapfile bs=1M count=1100
 mkswap /var/swapfile
 swapon /var/swapfile

Создадим пользователя oracle

 /usr/sbin/groupadd -r dba
 /usr/sbin/useradd -r -M -g dba -d /usr/lib/oracle/xe -s /bin/bash oracle

Скачаем и установим необходимые пакеты с оф. сайта

 rpm -Uvh oracle-xe-univ-
 rpm -Uvh oracle-instantclient-basic-*.rpm 
 rpm -Uvh oracle-instantclient-sqlplus-*.rpm

Установим необходимые пакеты

 yum install oracle-lib-compat
 yum install oracle-xe-selinux oracle-instantclient-selinux oracle-instantclient-sqlplus-selinux

Сконфигурируем СУБД Oracle

 /etc/init.d/oracle-xe configure

Here are some sane values for the configure:

 HTTP port for Oracle Application Express: 9055
 Database listener port: 1521
 Password for SYS/SYSTEM: <password>
 Start at boot: y

Define the service name in /etc/tnsnames.ora

 cat >> /etc/tnsnames.ora << 'EOF'
 XE =
        (ADDRESS_LIST =
           (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
        (CONNECT_DATA =
           (SERVICE_NAME = xe)
 restorecon -v /etc/tnsnames.ora

Create the spacewalk database user

 sqlplus 'sys@xe as sysdba'
 SQL> create user spacewalk identified by password default tablespace users;
 SQL> grant dba to spacewalk;
 SQL> quit  

Additional Oracle configuration

 sqlplus spacewalk/password@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

Log Oracle

 tail -f /usr/lib/oracle/xe/app/oracle/admin/XE/bdump/alert_XE.log


Install Spacewalk client (на сервере подключить репозитарий клиента)

rhel/centos 5:

 rpm -ivh
 rpm -ihv`uname -i`/spacewalk-client-repo-1.5-1.el5.noarch.rpm

rhel/centos 6:

 rpm -ivh
 rpm -ihv`uname -i`/spacewalk-client-repo-1.5-1.el6.noarch.rpm

Import Redhat's RPM GPG key

 wget -O /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release && rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

Registering clients

В панели Spacewalk
  • создать канал ПО
  • создать ключ активации (с привязкой к необходимому каналу)
В терминале
 yum install rhn-setup
 rhnreg_ks --serverUrl= --activationkey=<key-with-custom-channel>

Install Spacewalk server

 BASEARCH=$(uname -i)
 rpm -Uvh$BASEARCH/spacewalk-repo-1.2-0.el5.noarch.rpm
 yum install spacewalk-oracle

Configuring Spacewalk server

 spacewalk-setup --disconnected

An example session is as follows:

 * Setting up Oracle environment.
 * Setting up database.
 ** Database: Setting up database connection for Oracle backend.
 DB User? spacewalk
 DB Password? пароль к БД
 DB hostname? localhost
 DB port [1521]? 
 DB protocol [TCP]? 
 ** Database: Testing database connection.
 ** Database: Populating database.
 *** Progress: ########################################################
 * Setting up users and groups.
 ** GPG: Initializing GPG and importing key.
 ** GPG: Creating /root/.gnupg directory
 You must enter an email address.
 Admin Email Address?
 * Performing initial configuration.
 * Activating Spacewalk.
 ** Loading Spacewalk Certificate.
 ** Verifying certificate locally.
 ** Activating Spacewalk.
 * Enabling Monitoring.
 * Configuring apache SSL virtual host.
 Should setup configure apache's default ssl server for you (saves original ssl.conf) [Y]? 
 ** /etc/httpd/conf.d/ssl.conf has been backed up to ssl.conf-swsave
 * Configuring tomcat.
 ** /etc/tomcat5/tomcat5.conf has been backed up to tomcat5.conf-swsave
 ** /etc/tomcat5/server.xml has been backed up to server.xml-swsave
 ** /etc/tomcat5/web.xml has been backed up to web.xml-swsave
 * Configuring jabberd.
 * Creating SSL certificates.
 CA certificate password? 
 Re-enter CA certificate password? пароль к сертификату
 Organization? TOMTEL
 Organization Unit []? 
 Email Address []? 
 City? Tomsk
 State? Tomskaya obl.
 Country code (Examples: "US", "JP", "IN", or type "?" to see a list)? RU
 ** SSL: Generating CA certificate.
 ** SSL: Deploying CA certificate.
 ** SSL: Generating server certificate.
 ** SSL: Storing SSL certificates.
 * Deploying configuration files.
 * Update configuration in database.
 * Setting up Cobbler..
 Cobbler requires tftp and xinetd services be turned on for PXE provisioning functionality. Enable these services [Y/n]?
 cobblerd does not appear to be running/accessible
 * Restarting services.
 Installation complete.
 Visit to create the Spacewalk administrator account.

Manage Spacewalk

 /usr/sbin/rhn-satellite [stop|start|restart].

Import Pubkeys for channels

 wget -O /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL
 rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL
 wget -O /etc/pki/rpm-gpg/RPM-GPG-KEY-spacewalk
 rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-spacewalk
 wget -O /etc/pki/rpm-gpg/RPM-GPG-KEY-ETHZ
 rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-ETHZ
 wget -O /etc/pki/rpm-gpg/RPM-GPG-KEY-dell
 wget -O /etc/pki/rpm-gpg/RPM-GPG-KEY-libsmbios
 rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-dell
 rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-libsmbios
 wget -O /etc/pki/rpm-gpg/RPM-GPG-Key-OpenVZ
 rpm --import /etc/pki/rpm-gpg/RPM-GPG-Key-OpenVZ
 wget -O /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-testing
 rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-testing

Update client profile

 rhn-profile-sync -v

p.s. This command need run after update base channels in Spacewalk panel, else systems not seen updates in Spacewalk panel.



blog/2011/11/25-spacewalk_-_установка_настройка.txt · Последние изменения: 2012/05/15 12:06 — Антон Бугреев · []