Spacewalk on Centos 7


Index


  1. Spacewalk on Centos 7
    1. Index
    2. architecture
    3. Nodige repositories
      1. Jpackage repository
      2. Spacewalk repository
      3. Epel repository
    4. Installatie Spacewalk
    5. Enable firewall
    6. Voldoende ruimte voor Spacewalk
    7. Spacewalk setup
    8. Resources

architecture


Spacewalk
Op Triton - De Centos 7 doos moet Spacewalk komen.

Nodige repositories

Er zijn in totaal 3 repositories nodig voor de installatie van spacewalk

Jpackage repository

[root@triton ~]#
cat > /etc/yum.repos.d/jpackage-generic.repo << EOF
[jpackage-generic]
name=JPackage generic
#baseurl=http://mirrors.dotsrc.org/pub/jpackage/5.0/generic/free/
mirrorlist=http://www.jpackage.org/mirrorlist.php?dist=generic&type=free&release=5.0
enabled=1
gpgcheck=1
gpgkey=http://www.jpackage.org/jpackage.asc
EOF

Spacewalk repository

Even de juiste repositories toevoegen.

[root@triton ~]# rpm -Uvh http://yum.spacewalkproject.org/2.5/RHEL/7/x86_64/spacewalk-repo-2.5-3.el7.noarch.rpm
Retrieving http://yum.spacewalkproject.org/2.5/RHEL/7/x86_64/spacewalk-repo-2.5-3.el7.noarch.rpm
warning: /var/tmp/rpm-tmp.5JzG9O: Header V4 DSA/SHA1 Signature, key ID b8002de1: NOKEY
Preparing...                          ################################# [100%]
Updating / installing...
   1:spacewalk-repo-2.5-3.el7         ################################# [100%]
[root@triton ~]#

Epel repository

[root@triton ~]# rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
Retrieving https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
warning: /var/tmp/rpm-tmp.BVP3HM: Header V3 RSA/SHA256 Signature, key ID 352c64e5: NOKEY
Preparing...                          ################################# [100%]
Updating / installing...
   1:epel-release-7-7                 ################################# [100%]
[root@triton ~]#

Installatie Spacewalk

En dan nu de uiteindelijke installatie van spacewalk

[root@triton yum.repos.d]# yum install spacewalk-setup-postgresql spacewalk-postgresql perl dojo
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirror.fusioncloud.co
 * epel: mirror.metrocast.net
 * extras: mirror.fusioncloud.co
 * jpackage-generic: ftp.heanet.ie
 * updates: mirror.fusioncloud.co
Package 4:perl-5.16.3-286.el7.x86_64 already installed and latest version
Resolving Dependencies
--> Running transaction check
---> Package dojo.noarch 0:1.8.3-4.el7 will be installed
---> Package spacewalk-postgresql.noarch 0:2.5.1-1.el7 will be installed
--> Processing Dependency: spacewalk-common = 2.5.1-1.el7 for package: spacewalk-postgresql-2.5.1-1.el7.noarch
--> Processing Dependency: postgresql-contrib >= 8.4 for package: spacewalk-postgresql-2.5.1-1.el7.noarch
--> Processing Dependency: postgresql >= 8.4 for package: spacewalk-postgresql-2.5.1-1.el7.noarch
--> Processing Dependency: perl(DBD::Pg) for package: spacewalk-postgresql-2.5.1-1.el7.noarch
--> Processing Dependency: /usr/bin/psql for package: spacewalk-postgresql-2.5.1-1.el7.noarch
...
  velocity.noarch 0:1.7-10.el7                                       velocity-dvsl.noarch 0:1.0-2.jpp5
  velocity-tools.noarch 0:1.4-1.jpp5                                 ws-jaxme.noarch 0:0.5.2-10.el7
  xpp3.noarch 0:1.1.3.8-11.el7

Complete!
[root@triton yum.repos.d]#


Enable firewall


even de juiste poorten openzetten.

80, 443 en 5222 en 5269.
UDP 69 voor als we willen tftp'en

[root@triton yum.repos.d]# firewall-cmd --add-service=http
Warning: ALREADY_ENABLED
[root@triton yum.repos.d]# firewall-cmd --add-service=https
Warning: ALREADY_ENABLED
[root@triton yum.repos.d]#
Push to client machines
[root@triton yum.repos.d]# firewall-cmd --add-port=5222/tcp
success

Push to spacewalk proxy
[root@triton yum.repos.d]# firewall-cmd --add-port=5269/tcp
success

Use tftp
[root@triton yum.repos.d]# firewall-cmd --add-port=69/udp
success
[root@triton yum.repos.d]#

Controle:
[root@triton yum.repos.d]# firewall-cmd --list-services
dhcpv6-client http https smtp ssh
[root@triton yum.repos.d]# firewall-cmd --list-ports
69/udp 5222/tcp 5269/tcp
[root@triton yum.repos.d]#


Voldoende ruimte voor Spacewalk


Uitbreiden naar 50Gb


Breidt disk 1uit van 30 naar 50 Gb


wow, het lukt.


[root@triton data]# fdisk -l

Disk /dev/sda: 32.2 GB, 32212254720 bytes, 62914560 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x000dc8ab

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048     1026047      512000   83  Linux
/dev/sda2         1026048    62914559    30944256   8e  Linux LVM

Disk /dev/mapper/centos_triton-swap: 2164 MB, 2164260864 bytes, 4227072 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mapper/centos_triton-root: 29.5 GB, 29519511552 bytes, 57655296 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

[root@triton data]#
[root@triton data]# echo '1' > /sys/class/scsi_disk/0\:0\:0\:0/device/rescan
[root@triton data]# fdisk -l

Disk /dev/sda: 53.7 GB, 53687091200 bytes, 104857600 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x000dc8ab

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048     1026047      512000   83  Linux
/dev/sda2         1026048    62914559    30944256   8e  Linux LVM

Disk /dev/mapper/centos_triton-swap: 2164 MB, 2164260864 bytes, 4227072 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mapper/centos_triton-root: 29.5 GB, 29519511552 bytes, 57655296 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

[root@triton data]#
[root@triton data]# fdisk -l

Disk /dev/sda: 53.7 GB, 53687091200 bytes, 104857600 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x000dc8ab

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048     1026047      512000   83  Linux
/dev/sda2         1026048    62914559    30944256   8e  Linux LVM

Disk /dev/mapper/centos_triton-swap: 2164 MB, 2164260864 bytes, 4227072 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mapper/centos_triton-root: 29.5 GB, 29519511552 bytes, 57655296 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

[root@triton data]# fdisk /dev/sda
Welcome to fdisk (util-linux 2.23.2).

Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): n
Partition type:
   p   primary (2 primary, 0 extended, 2 free)
   e   extended
Select (default p): p
Partition number (3,4, default 3):
First sector (62914560-104857599, default 62914560):
Using default value 62914560
Last sector, +sectors or +size{K,M,G} (62914560-104857599, default 104857599):
Using default value 104857599
Partition 3 of type Linux and of size 20 GiB is set

Command (m for help): t
Partition number (1-3, default 3): 3
Hex code (type L to list all codes): 8e
Changed type of partition 'Linux' to 'Linux LVM'

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
Syncing disks.
[root@triton data]#


[root@triton ~]# pvcreate /dev/sda3
  Physical volume "/dev/sda3" successfully created
[root@triton ~]# vgdisplay
  --- Volume group ---
  VG Name               centos_triton
  System ID
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  3
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                2
  Open LV               2
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               29.51 GiB
  PE Size               4.00 MiB
  Total PE              7554
  Alloc PE / Size       7554 / 29.51 GiB
  Free  PE / Size       0 / 0
  VG UUID               2Bdq9K-H6e1-6jvj-ZeaH-qGzB-3Zv5-flrqcA

[root@triton ~]#
[root@triton ~]# vgextend centos_triton /dev/sda3
  Volume group "centos_triton" successfully extended
[root@triton ~]# vgdisplay centos_triton | grep "Free"
  Free  PE / Size       5119 / 20.00 GiB
[root@triton ~]#

[root@triton ~]# lvcreate -n lvdata -L 15G centos_triton
  Logical volume "lvdata" created.
[root@triton ~]#

[root@triton ~]# mkfs.ext4 /dev/centos_triton/lvdata
mke2fs 1.42.9 (28-Dec-2013)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
983040 inodes, 3932160 blocks
196608 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=2151677952
120 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208

Allocating group tables: done
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

[root@triton ~]#

[root@triton ~]# vi /etc/fstab
/dev/centos_triton/lvdata       /var/lib/pgsql/data       ext4    defaults        1 1


Even de rechten goedzetten
[root@triton ~]# chown postgres:postgres  /var/lib/pgsql/data
[root@triton ~]# ls -l /var/lib/pgsql/
total 4
drwx------ 2 postgres postgres    6 Mar  2 18:52 backups
drwxr-xr-x 3 postgres postgres 4096 Jun 28 14:41 data
[root@triton ~]#


Spacewalk setup

Spacewalk geinstalleerd, en nu nog draaien.

[root@triton ~]# vi /var/log/rhn/rhn_installation.log
Installation log of Spacewalk
Command: /usr/bin/spacewalk-setup

ERROR: diskspace does not meet minimum system requirements:
           Mountpoint: /
           Relevant paths serviced by mountpoint: /var/lib/pgsql/data
           Disk space needed:    12884901888 bytes (app. 12.0G)
           Disk space available: 11868712960 bytes (app. 11.0G)

Opnieuw.... nadat de disk uitgebreidt is.

[root@triton pgsql]# spacewalk-setup
** Database: Setting up database connection for PostgreSQL backend.
** Database: Installing the database:
** Database: This is a long process that is logged in:
** Database:   /var/log/rhn/install_db.log
*** Progress: ##
Could not install database.
[root@triton pgsql]# vi /var/log/rhn/install_db.log
[root@triton pgsql]# cd /var/lib/pgsql/data/pg_log
[root@triton pg_log]# cd ..
[root@triton data]# rm -Rf pg_log/

Nog een keer

[root@triton data]# spacewalk-setup
** Database: Setting up database connection for PostgreSQL backend.
** Database: Installing the database:
** Database: This is a long process that is logged in:
** Database:   /var/log/rhn/install_db.log
*** Progress: ###
** Database: Installation complete.
** Database: Populating database.
*** Progress: ###########################
* Configuring tomcat.
* 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? spacewalk@domainname.com
* Performing initial configuration.
* 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 jabberd.
* Creating SSL certificates.
CA certificate password? --> Woensdag123
Re-enter CA certificate password?
Organization? Thuis
Organization Unit [triton.fritz.box]? Ge Janssen
Email Address [spacewalk@domainname.com]?
City? Sevenum
State? Limburg
Country code (Examples: "US", "JP", "IN", or type "?" to see a list)? NL
** 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]?
* Restarting services.
Installation complete.
Visit https://triton.fritz.box to create the Spacewalk administrator account.
[root@triton data]#

Initial setup Spacewalk






 












Resources

Gevonden, gejat en geplakt van

http://yum.spacewalkproject.org/2.5/RHEL/7/x86_64/spacewalk-repo-2.5-3.el7.noarch.rpm

http://www.server-world.info/en/note?os=CentOS_7&p=spacewalk&f=1

https://fedorahosted.org/spacewalk/wiki/HowToInstall