cobbler離線安裝

来源:https://www.cnblogs.com/hengjiu/archive/2022/07/19/16494505.html
-Advertisement-
Play Games

半自動化安裝腳本 在可以聯網的機器準備 準備離線裝機包 # 安裝yum-utils # yum-utils是管理repository及擴展包的工具,包含一系列yum工具,我們需要使用yumdownloader來下載cobbler相關的依賴包 yum install -y yum-utils 使用yu ...


半自動化安裝腳本

在可以聯網的機器準備

準備離線裝機包

# 安裝yum-utils
# yum-utils是管理repository及擴展包的工具,包含一系列yum工具,我們需要使用yumdownloader來下載cobbler相關的依賴包
yum install -y yum-utils

使用yumdownlader下載cobbler及相關產品的依賴包

yumdownloader --resolve --destdir=/tmp/offline-cobbler/ cobbler cobbler-web dhcp httpd tftp xinetd pykickstart debmirror

安裝createrepo

yum -y install createrepo

創建yum倉庫文件

cd /tmp/offline-cobbler/
createrepo .

打包cobbler離線安裝文件

cd /tmp
tar -zcvf offline-cobbler.tar.gz offline-cobbler/

我已經打包好的cobbler包,提取碼:w3kb

在無網機器中操作

1. 將打包好的cobbler壓縮包傳入機器

2. 解壓offline-cobbler.tar.gz

tar xvf offline-cobbler.tar.gz -C /tmp/

3. 備份現有yum源

mkdir /etc/yum.repos.d/bak
mv /etc/yum.repos.d/*.repo /etc/yum.repos.d/bak

4. 編寫本地yum源

# 掛載本地iso鏡像,需要本地yum源不然安裝的時候會少依賴
# 先使用u盤傳一個iso鏡像最好與本機系統版本一致
# 具體掛載位置看你上傳的鏡像位置,虛擬機操作是/dev/sr0
$ mount /dev/sr0  /mnt 

$ vi /etc/yum.repos.d/cobbler.repo
[cobbler]
name=cobbler local repo
baseurl=file:///tmp/offline-cobbler/
gpgcheck=0
enalbed=1

# 本機鏡像源
$  vi /etc/yum.repos.d/Centos.repo
[centos]
name=centos
baseurl=file:///mnt/
gpgcheck=0
enalbed=1

5. 生成yum緩存

yum clean all
yum makecache

6. 安裝cobbler

# 關閉selinux和防火牆
# -i 直接修改文件
# s 查找替換
# g 完成所有匹配值的替換
$ sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
$ setenforce 0
$ systemctl disable firewalld.service 
$ systemctl stop firewalld.service
# 安裝cobbler
$ yum install cobbler -y

7. 安裝dhcp和httpd

# 移除cobbler yum源之後安裝

rm -f /etc/yum.repos.d/cobbler.repo

yum install dhcp httpd -y

8. 啟動服務

$ systemctl enable httpd.service tftp.socket cobblerd.service 
$ systemctl start httpd.service tftp.socket cobblerd.service

9. 檢查cobbler

$ cobbler check

The following are potential configuration items that you may want to fix:

1 : The 'server' field in /etc/cobbler/settings must be set to something other than localhost, or kickstarting features will not work. This should be a resolvable hostname or IP for the boot server as reachable by all machines that will use it.

2 : For PXE to be functional, the 'next_server' field in /etc/cobbler/settings must be set to something other than 127.0.0.1, and should match the IP of the boot server on the PXE network.

3 : SELinux is enabled. Please review the following wiki page for details on ensuring cobbler works correctly in your SELinux environment:

 	https://github.com/cobbler/cobbler/wiki/Selinux 

4 : change 'disable' to 'no' in /etc/xinetd.d/tftp

5 : Some network boot-loaders are missing from /var/lib/cobbler/loaders, you may run 'cobbler get-loaders' to download them, or, if you only want to handle x86/x86_64 netbooting, you may ensure that you have installed a *recent* version of the syslinux package installed and can ignore this message entirely. Files in this directory, should you want to support all architectures, should include pxelinux.0, menu.c32, elilo.efi, and yaboot. The 'cobbler get-loaders' command is the easiest way to resolve these requirements.

6 : enable and start rsyncd.service with systemctl

7 : debmirror package is not installed, it will be required to manage debian deployments and repositories

8 : ksvalidator was not found, install pykickstart

9 : The default password used by the sample templates for newly installed machines (default_password_crypted in /etc/cobbler/settings) is still set to 'cobbler' and should be changed, try: "openssl passwd -1 -salt 'random-phrase-here' 'your-password-here'" to generate new one

10 : fencing tools were not found, and are required to use the (optional) power management features. install cman or fence-agents to use them

 

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

解釋:

1、/etc/cobbler/settings中的“server”欄位必須設置為localhost以外的地址,否則kickstarting特性將不起作用。其應該是一個可解析的主機名或IP,所有機器都可達的地址。
2、為了使PXE正常工作,必須將/etc/cobbler/settings中的“next_server”欄位設置為除127.0.0.1之外的其他欄位,並且應該與PXE網路上的引導伺服器的IP匹配。
3、SELinux已啟用。請查看下麵的Wiki頁面以確保在您的SELinux環境下cobbler可以正確工作;
4、 在/etc/xinetd.d/tftp文件中將 'disable' 設置為 'no';
Xinetd:即extended internet daemon,是新一代的網路守護進程服務程式,又叫超級Internet伺服器,常用來管理多種輕量級Internet服務。Xinetd提供類似於inetd+tcp_wrapper的功能,但是更加強大和安全。
5、一些網路引導載入程式在/var/lib/cobblerZ/loaders中丟失,您可以運行“cobbler get-loaders”來下載它們,如果您只想處理x86/x86_64 網路引導,確保您已經安裝了最近的syslinux包,安裝後可以忽略此消息。如果希望支持所有體繫結構,則此目錄中的文件應該包括pxelinux.0(預啟動linux引導程式)、menu.c32(顯示菜單界面引導程式)、elilo.efi(ELILO 是一種基於 EFI 開發的 boot loader)和yaboot(Macintosh的引導程式)。“cobbler get-loaders”命令是解決這些需求最簡單的方法。
6、使用systemctl命令開啟rsyncd.service服務(rsync(remote [rɪˈmoʊt] sync [sɪŋk])是linux系統下的數據鏡像備份工具)並設置開機自啟
7、debmirror包沒有安裝,它用來管理Debian系統的部署和存儲庫
8、ksvalidator (validator [ˈvælədeɪtər]驗證器)沒有發現,要安裝pykickstart
9、新安裝的機器的預設密碼設置為cobbler,你可以使用"openssl passwd -1 -salt 'random phrase-here' 'your-password-here'"得到新得密碼
10、fencing([ˈfensɪŋ] 擊劍/(用柵欄、籬笆或圍欄)圍住) tools 沒有找到,它被用來電源管理功能(可選),安裝cman或者fence-agents 來使用

按步驟修複即可,基本想搞離線安裝的肯定都會接下來的操作,我這邊就不寫了.


您的分享是我們最大的動力!

-Advertisement-
Play Games
更多相關文章
  • 本篇文章主要介紹了1、Java 中的異常2、如何處理函數拋出的異常3、處理異常的原則4、異常處理時,性能開銷大的地方 ...
  • 二、Seata學習 2.1、Seata介紹 ###2.1.1、Seata背景 Seata是 2019 年 1 月份螞蟻金服和阿裡巴巴共同開源的==分散式事務解決方案==。致力於提供高性能和簡單易用的分散式事務服務,為用戶打造一站式的分散式解決方案 官網地址:http://seata.io/,其中的文 ...
  • 大家好,又見面了。 在我前面的文章《吃透JAVA的Stream流操作,多年實踐總結》中呢,對Stream的整體情況進行了細緻全面的講解,也大概介紹了下結果收集器Collectors的常見用法 —— 但遠不是全部。 本篇文章就來專門剖析collect操作,一起解鎖更多高級玩法,讓Stream操作真正的 ...
  • 創建一個數組 int[] array = new int[10]; 給數組中的第一個格子進行賦值 array[0] = 99; 創建一個動態數組 ArrayList arrayList = new ArrayList(); 動態數組添加一個值類型的數據 arrayList.Add(1); 動態數組添 ...
  • 訪問修飾符 public 公有的,外部可以進行訪問的 protected派生的,聲明protected元素能在本類和其派生類中進行訪問 private私有的,只能再本類中進行訪問 封裝 C#中的屬性提供了對象的封裝,屬性內部包含一個get訪問器和一個set訪問器。 點擊查看代碼 class Test ...
  • 錯誤:CS0518 預定義的類型“System.Object”未定義或未導入 出現情況: 更新visual studio夠突然出現很多原來沒有問題的類出現問題,下劃紅色波浪線,且在錯誤tab中提示。嘗試編譯可以正常編譯,且也能正常運行。 看著難受,想辦法解決。自行嘗試了重啟在內的各種方案還是不行。 ...
  • Steinberg Cubase Pro是一款多功能音樂創作軟體,此次迎來了Cubase 12版本,功能有很大提升,從經典的閃避效果到令人興奮的節奏模式,它提供了全新的創意方式,創建自定義形狀的 LFO 並一次調製多達六個集成效果模塊,為您的創作增添更棒的效果。 詳情:Steinberg Cubas ...
  • Binary Ninja是一個互動式反彙編器、反編譯器和二進位分析平臺,Vector 35 為多種架構的反彙編提供第一方支持,包括 x86、x86-64、ARMv7(帶有 Thumb2)、ARMv8 (AArch64)、PowerPC、6502、Z80 和 MIps,我們的反編譯器輸出到 C 和 B ...
一周排行
    -Advertisement-
    Play Games
  • 示例項目結構 在 Visual Studio 中創建一個 WinForms 應用程式後,項目結構如下所示: MyWinFormsApp/ │ ├───Properties/ │ └───Settings.settings │ ├───bin/ │ ├───Debug/ │ └───Release/ ...
  • [STAThread] 特性用於需要與 COM 組件交互的應用程式,尤其是依賴單線程模型(如 Windows Forms 應用程式)的組件。在 STA 模式下,線程擁有自己的消息迴圈,這對於處理用戶界面和某些 COM 組件是必要的。 [STAThread] static void Main(stri ...
  • 在WinForm中使用全局異常捕獲處理 在WinForm應用程式中,全局異常捕獲是確保程式穩定性的關鍵。通過在Program類的Main方法中設置全局異常處理,可以有效地捕獲並處理未預見的異常,從而避免程式崩潰。 註冊全局異常事件 [STAThread] static void Main() { / ...
  • 前言 給大家推薦一款開源的 Winform 控制項庫,可以幫助我們開發更加美觀、漂亮的 WinForm 界面。 項目介紹 SunnyUI.NET 是一個基於 .NET Framework 4.0+、.NET 6、.NET 7 和 .NET 8 的 WinForm 開源控制項庫,同時也提供了工具類庫、擴展 ...
  • 說明 該文章是屬於OverallAuth2.0系列文章,每周更新一篇該系列文章(從0到1完成系統開發)。 該系統文章,我會儘量說的非常詳細,做到不管新手、老手都能看懂。 說明:OverallAuth2.0 是一個簡單、易懂、功能強大的許可權+可視化流程管理系統。 有興趣的朋友,請關註我吧(*^▽^*) ...
  • 一、下載安裝 1.下載git 必須先下載並安裝git,再TortoiseGit下載安裝 git安裝參考教程:https://blog.csdn.net/mukes/article/details/115693833 2.TortoiseGit下載與安裝 TortoiseGit,Git客戶端,32/6 ...
  • 前言 在項目開發過程中,理解數據結構和演算法如同掌握蓋房子的秘訣。演算法不僅能幫助我們編寫高效、優質的代碼,還能解決項目中遇到的各種難題。 給大家推薦一個支持C#的開源免費、新手友好的數據結構與演算法入門教程:Hello演算法。 項目介紹 《Hello Algo》是一本開源免費、新手友好的數據結構與演算法入門 ...
  • 1.生成單個Proto.bat內容 @rem Copyright 2016, Google Inc. @rem All rights reserved. @rem @rem Redistribution and use in source and binary forms, with or with ...
  • 一:背景 1. 講故事 前段時間有位朋友找到我,說他的窗體程式在客戶這邊出現了卡死,讓我幫忙看下怎麼回事?dump也生成了,既然有dump了那就上 windbg 分析吧。 二:WinDbg 分析 1. 為什麼會卡死 窗體程式的卡死,入口門檻很低,後續往下分析就不一定了,不管怎麼說先用 !clrsta ...
  • 前言 人工智慧時代,人臉識別技術已成為安全驗證、身份識別和用戶交互的關鍵工具。 給大家推薦一款.NET 開源提供了強大的人臉識別 API,工具不僅易於集成,還具備高效處理能力。 本文將介紹一款如何利用這些API,為我們的項目添加智能識別的亮點。 項目介紹 GitHub 上擁有 1.2k 星標的 C# ...