How to install Cobbler in CentOS 7.4

Source: Internet
Author: User

How to install Cobbler in CentOS 7.4

System:
[Root @ cobbler ~] # More/etc/RedHat-release
CentOS Linux release 7.4.1708 (Core)

1. Install basic software:
Yum-y install wget net-tools curl epel-release
Update:
Yum-y update
Disable iptables and selinux:
[Root @ cobbler ~] # Vim/etc/selinux/config
SELINUX = disabled
View after restart:
[Root @ cobbler ~] # Sestatus
SELinux status: disabled

Ii. Install basic services:
Yum-y install dhcp httpd xinetd tftp-server rsync fence-agents pykickstart
Set startup
Systemctl enable xinetd dhcpd httpd rsyncd
Systemctl start xinetd dhcpd httpd rsyncd
1. Install cobbler
[Root @ cobbler ~] # Yum-y install cobbler-web
Set boot start:
Systemctl enable cobblerd
Systemctl start cobblerd

2. Verify cobbler installation conditions
[Root @ cobbler ~] # Cobbler check
The following are potential configuration items that you may be want to fix:

1: comment out 'dists 'on/etc/debmirror. conf for proper debian support
2: comment out 'archies' on/etc/debmirror. conf for proper debian support

Restart cobblerd and then run 'cobbler sync' to apply changes

3. Generate a random password
[Root @ cobbler ~] # Openssl passwd-1-salt "cobbler" "huangzai"
$1 $ cobbler $ zPOuqy9SLOb87DIQb3RbQ.

4. Change the cobbler configuration file
[Root @ cobbler ~] # Vim/etc/cobbler/settings
..........
Default_password_crypted: "$1 $ cobbler $ zPOuqy9SLOb87DIQb3RbQ." # password generated in step 3
Manage_dhcp: 1 # dhcp Service
Manage_tftpd: 1 # xinetd service
Manage_rsync: 1 # rsyncd Service
Next_server: 192.168.3.222 # Replace the IP address of the cost server with the IP address of the dhcp service.
Server: 192.168.3.222 # Replace it with the local IP address and the cobber service address
..........

5. Update the load information:
[Root @ cobbler ~] # Cobbler get-loaders
Task started: 2018-03-06_051434_get_loaders
Task started (id = Download Bootloader Content, time = Tue Mar 6 05:14:34 2018)
Downloading https://cobbler.github.io/loaders/README to/var/lib/cobbler/loaders/README
Downloading https://cobbler.github.io/loaders/COPYING.elilo to/var/lib/cobbler/loaders/COPYING. elilo
Downloading https://cobbler.github.io/loaders/COPYING.yaboot to/var/lib/cobbler/loaders/COPYING. yaboot
Downloading https://cobbler.github.io/loaders/COPYING.syslinux: to/var/lib/cobbler/loaders/COPYING. syslinux
Downloading https://cobbler.github.io/loaders/elilo-3.8-ia64.efi to/var/lib/cobbler/loaders/elilo-ia64.efi
Downloading https://cobbler.github.io/loaders/yaboot-1.3.17 to/var/lib/cobbler/loaders/yaboot
Downloading https://cobbler.github.io/loaders/pxelinux.0-3.86 to/var/lib/cobbler/loaders/pxelinux.0
Downloading https://cobbler.github.io/loaders/menu.c32-3.86 to/var/lib/cobbler/loaders/menu. c32
Downloading https://cobbler.github.io/loaders/grub-0.97-x86.efi to/var/lib/cobbler/loaders/grub-x86.efi
Downloading https://cobbler.github.io/loaders/grub-0.97-x86_64.efi to/var/lib/cobbler/loaders/grub-x86_64.efi
TASK COMPLETE

6. Set the tftp configuration file to 'disable' to 'no'
[Root @ cobbler ~] # Cat/etc/xinetd. d/tftp | grep-v '^ #'
Service tftp
{
Disable = no
Socket_type = dgram
Protocol = udp
Wait = yes
User = root
Server =/usr/sbin/in. tftpd
Server_args =-B 1380-v-s/var/lib/tftpboot
Per_source = 11
CPIs = 100 2
Flags = IPv4
}

7. Modify the dhcp configuration file
[Root @ cobbler ~] # Vim/etc/cobbler/dhcp. template
Ddns-update-style interim;
Allow booting;
Allow bootp;
Ignore client-updates;
Set vendorclass = option vendor-class-identifier;
Option pxe-system-type code 93 = unsigned integer 16;
Subnet 192.168.3.0 netmask 255.255.255.0 {
Option routers 192.168.3.222;
Option domain-name-servers 202.96.209.5, 202.96.209.20;
Option subnet-mask limit 255.0;
Range dynamic-bootp 192.168.3.60 192.168.3.100;
Default-lease-time 21600;
Max-lease-time 43200;
Next-server $ next_server;
Class "pxeclients "{
Match if substring (option vendor-class-identifier, 0, 9) = "PXEClient ";
If option pxe-system-type = 00:02 {
Filename "ia64/elilo. efi ";
} Else if option pxe-system-type = 00:06 {
Filename "grub/grub-x86.efi ";
} Else if option pxe-system-type = 00:07 {
Filename "grub/grub-x86_64.efi ";
} Else if option pxe-system-type = 00:09 {
Filename "grub/grub-x86_64.efi ";
} Else {
Filename "pxelinux.0 ";
}
}

}
.........

3. Import the image for configuration
1. upload an iso image to the server
2. Create a folder
Mkdir-p/data/centos7.0
3. Mount or copy an image file to a folder
[Root @ cobbler ~] # Mount/dev/cdrom/data/centos7.0/

4. Import the content in the mnt directory of the mounted CD image to cobbler.
[Root @ cobbler ~] # Cobbler import -- path =/data/centos7.0/-- name = cent7.0
Task started: 2018-03-06_055628_import
Tasks started (id = Media import, time = Tue Mar 6 05:56:28 2018)
Found a candidate signature: breed = redhat, version = rhel6
Found a candidate signature: breed = redhat, version = rhel7
Found a matching signature: breed = redhat, version = rhel7
Adding distros from path/var/www/cobbler/ks_mirror/cent7.0:
Creating new distro: cent7.0-x86_64
Trying symlink:/var/www/cobbler/ks_mirror/cent7.0->/var/www/cobbler/links/cent7.0-x86_64
Creating new profile: cent7.0-x86_64
Associating repos
Checking for rsync repo (s)
Checking for rhn repo (s)
Checking for yum repo (s)
Starting descent into/var/www/cobbler/ks_mirror/cent7.0 for cent7.0-x86_64
Processing repo at:/var/www/cobbler/ks_mirror/cent7.0
Need to process repo/comps:/var/www/cobbler/ks_mirror/cent7.0
Looking for/var/www/cobbler/ks_mirror/cent7.0/repodata/comps. xml
Keeping repodata as-is:/var/www/cobbler/ks_mirror/cent7.0/repodata
TASK COMPLETE

5. view the import information in the cobber report
[Root @ cobbler ~] # Cobbler report
Distros:

Name: cent7.0-x86_64
Architecture: x86_64
TFTP Boot Files :{}
Breed: redhat
Comment:
Fetchable Files :{}
Initrd:/var/www/cobbler/ks_mirror/cent7.0/images/pxeboot/initrd. img
Kernel:/var/www/cobbler/ks_mirror/cent7.0/images/pxeboot/vmlinuz
Kernel Options :{}
Kernel Options (Post Install ):{}
Kickstart Metadata: {'tree': 'http: // @ http_server @/cblr/links/cent7.0-x86_64 '}
Management Classes: []
OS Version: rhel7
Owners: ['admin']
Red Hat Management Key: <inherit>
Red Hat Management Server: <inherit>
Template Files :{}

Name: rhel7.0-x86_64
Architecture: x86_64
TFTP Boot Files :{}
Breed: redhat
Comment:
Fetchable Files :{}
Initrd:/var/www/cobbler/ks_mirror/rhel7.0/images/pxeboot/initrd. img
Kernel:/var/www/cobbler/ks_mirror/rhel7.0/images/pxeboot/vmlinuz
Kernel Options :{}
Kernel Options (Post Install ):{}
Kickstart Metadata: {'tree': 'http: // @ http_server @/cblr/links/rhel7.0-x86_64 '}
Management Classes: []
OS Version: rhel7
Owners: ['admin']
Red Hat Management Key: <inherit>
Red Hat Management Server: <inherit>
Template Files :{}

Profiles:

Name: cent7.0-x86_64
TFTP Boot Files :{}
Comment:
DHCP Tag: default
Distribution: cent7.0-x86_64
Enable gPXE? : 0
Enable PXE Menu? : 1
Fetchable Files :{}
Kernel Options :{}
Kernel Options (Post Install ):{}
Kickstart:/var/lib/cobbler/kickstarts/sample_end.ks
Kickstart Metadata :{}
Management Classes: []
Management Parameters: <inherit>
Name Servers: []
Name Servers Search Path: []
Owners: ['admin']
Parent Profile:
Internal proxy:
Red Hat Management Key: <inherit>
Red Hat Management Server: <inherit>
Repos: []
Server Override: <inherit>
Template Files :{}
Virt Auto Boot: 1
Virt Bridge: xenbr0
Virt CPUs: 1
Virt Disk Driver Type: raw
Virt File Size (GB): 5
Virt Path:
Virt RAM (MB): 512
Virt Type: kvm

Name: rhel7.0-x86_64
TFTP Boot Files :{}
Comment:
DHCP Tag: default
Distribution: rhel7.0-x86_64
Enable gPXE? : 0
Enable PXE Menu? : 1
Fetchable Files :{}
Kernel Options :{}
Kernel Options (Post Install ):{}
Kickstart:/var/lib/cobbler/kickstarts/sample_end.ks
Kickstart Metadata :{}
Management Classes: []
Management Parameters: <inherit>
Name Servers: []
Name Servers Search Path: []
Owners: ['admin']
Parent Profile:
Internal proxy:
Red Hat Management Key: <inherit>
Red Hat Management Server: <inherit>
Repos: []
Server Override: <inherit>
Template Files :{}
Virt Auto Boot: 1
Virt Bridge: xenbr0
Virt CPUs: 1
Virt Disk Driver Type: raw
Virt File Size (GB): 5
Virt Path:
Virt RAM (MB): 512
Virt Type: kvm

6. view the import list
[Root @ cobbler ~] # Cobbler distro list
Cent7.0-x86_64
Rhel7.0-x86_64

7. Synchronize all cobber configurations
[Root @ cobbler ~] # Cobbler sync
Task started: 2018-03-06_061140_sync
Task started (id = Sync, time = Tue Mar 6 06:11:40 2018)
Running pre-sync triggers
Cleaning trees
Removing:/var/www/cobbler/images/cent7.0-x86_64
Removing:/var/lib/tftpboot/pxelinux. cfg/default
Removing:/var/lib/tftpboot/grub/images
Removing:/var/lib/tftpboot/grub/efidefault
Removing:/var/lib/tftpboot/images/cent7.0-x86_64
Removing:/var/lib/tftpboot/s390x/profile_list
Copying bootloaders
Copying:/var/lib/cobbler/loaders/pxelinux.0->/var/lib/tftpboot/pxelinux.0
Copying:/var/lib/cobbler/loaders/menu. c32->/var/lib/tftpboot/menu. c32
Copying:/var/lib/cobbler/loaders/yaboot->/var/lib/tftpboot/yaboot
Copying:/usr/share/syslinux/memdisk->/var/lib/tftpboot/memdisk
Copying:/var/lib/cobbler/loaders/grub-x86.efi->/var/lib/tftpboot/grub/grub-x86.efi
Copying:/var/lib/cobbler/loaders/grub-x86_64.efi->/var/lib/tftpboot/grub/grub-x86_64.efi
Copying distros to tftpboot
Copying files for distro: cent7.0-x86_64
Trying hardlink/var/www/cobbler/ks_mirror/cent7.0/images/pxeboot/vmlinuz->/var/lib/tftpboot/images/cent7.0-x86_64/vmlinuz
Trying hardlink/var/www/cobbler/ks_mirror/cent7.0/images/pxeboot/initrd. img->/var/lib/tftpboot/images/cent7.0-x86_64/initrd. img
Copying images
Generating PXE configuration files
Generating PXE menu structure
Copying files for distro: cent7.0-x86_64
Trying hardlink/var/www/cobbler/ks_mirror/cent7.0/images/pxeboot/vmlinuz->/var/www/cobbler/images/cent7.0-x86_64/vmlinuz
Trying hardlink/var/www/cobbler/ks_mirror/cent7.0/images/pxeboot/initrd. img->/var/www/cobbler/images/cent7.0-x86_64/initrd. img
Writing template files for cent7.0-x86_64
Rendering TFTPD files
Generating/etc/xinetd. d/tftp
Processing boot_files for distro: cent7.0-x86_64
Cleaning link caches
Running post-sync triggers
Running python triggers from/var/lib/cobbler/triggers/sync/post/
Running python trigger cobbler. modules. sync_post_restart_services
Running shell triggers from/var/lib/cobbler/triggers/sync/post/
Running python triggers from/var/lib/cobbler/triggers/change/
Running python trigger cobbler. modules. scm_track
Running shell triggers from/var/lib/cobbler/triggers/change/
TASK COMPLETE

8. Restart all services

9. After the installation is successful, start the client:

10. Modify the cobber logon password:
[Root @ cobbler ~] # Htdigest/etc/cobbler/users. digest "Cobbler" cobbler
Changing password for user cobbler in realm Cobbler
New password:
Re-type new password:

11. Open cobber web

Cobblerd startup Error
[Root @ cobbler conf. d] # systemctl status cobblerd
● Cobblerd. service-Cobbler Helper Daemon
Loaded: loaded (/usr/lib/systemd/system/cobblerd. service; enabled; vendor preset: disabled)
Active: inactive (dead) since Mon 2013-3-12 07:09:51 EDT; 18 s ago
Process: 1644 ExecStartPost =/usr/bin/touch/usr/share/cobbler/web/cobbler. wsgi (code = exited, status = 0/SUCCESS)
Process: 1643 ExecStart =/usr/bin/cobblerd-F (code = exited, status = 0/SUCCESS)
Main PID: 1643 (code = exited, status = 0/SUCCESS)

Mar 12 07:09:51 cobbler cobblerd [1643]: Traceback (most recent call last ):
Mar 12 07:09:51 cobbler cobblerd [1643]: File "/usr/bin/cobblerd", line 75, in main
Mar 12 07:09:51 cobbler cobblerd [1643]: api = cobbler_api.BootAPI (is_cobblerd = True)
Mar 12 07:09:51 cobbler cobblerd [1643]: File "/usr/lib/python2.7/site-packages/cobbler/api. py",... it __
Mar 12 07:09:51 cobbler cobblerd [1643]: "authn_configfile"
Mar 12 07:09:51 cobbler cobblerd [1643]: File "/usr/lib/python2.7/site-packages/cobbler/api. py",... file
Mar 12 07:09:51 cobbler cobblerd [1643]: return module_loader.get_module_from_file (section, name, f... ack)
Mar 12 07:09:51 cobbler cobblerd [1643]: File "/usr/lib/python2.7/site-packages/cobbler/modulelo... file
Mar 12 07:09:51 cobbler cobblerd [1643]: raise CX ("Failed to load module for % s/% s") % (categor... ld ))
Mar 12 07:09:51 cobbler cobblerd [1643]: CX: 'failed to load module for authentication/module'
Hint: Some lines were ellipsized, use-l to show in full.
Solution:
[Root @ cobbler ~] # Vim/etc/cobbler/modules. conf
[Authentication]
Module = authn_configfile
Restart the cobber Service
Systemctl restart cobblerd

Verification error:
[Root @ cobbler ~] # Cobbler check
Httpd does not appear to be running and proxying cobbler, or SELinux is in the way. Original traceback:
Traceback (most recent call last ):
File "/usr/lib/python2.7/site-packages/cobbler/cli. py", line 251, in check_setup
S. ping ()
File "/usr/lib64/python2.7/xmlrpclib. py", line 1233, in call
Return self. send (self. name, args)
File "/usr/lib64/python2.7/xmlrpclib. py", line 1587, in request
Verbose = self. verbose
File "/usr/lib64/python2.7/xmlrpclib. py", line 1273, in request
Return self. single_request (host, handler, request_body, verbose)
File "/usr/lib64/python2.7/xmlrpclib. py", line 1321, in single_request
Response. msg,
ProtocolError: <ProtocolError for 127.0.0.1: 80/cobbler_api: 503 Service Unavailable>

Solution:
Disable selinux:
[Root @ cobbler ~] # Vim/etc/selinux/config
SELINUX = disabled
Restart the server

This article permanently updates link: https://www.bkjia.com/Linux/2018-03/151347.htm

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.