Advertisement
42n4

PROXMOXINIT4CEPH

Jan 8th, 2017
557
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 4.25 KB | None | 0 0
  1. #USE IT IN COMMAND LINE (without #):
  2. #apt-get update; apt-get -y install curl
  3. #curl http://pastebin.com/raw/VJw8vmTa | sed 's/\r//g' > proxmoxinit.sh
  4. #sh proxmoxinit.sh
  5. export HOME=/root
  6. echo "export HOME=/root" >> $HOME/.bashrc
  7. #echo "export SHELL=/bin/bash" >> $HOME/.bashrc
  8. sed -i 's/#\ You/export SHELL=\/bin\/bash #/g' $HOME/.bashrc
  9. sed -i 's/# alias/alias/g' $HOME/.bashrc
  10. sed -i 's/# export/export/g' $HOME/.bashrc
  11. sed -i 's/# eval/eval/g' $HOME/.bashrc
  12. sed -i 's/# PS1/PS1/g' $HOME/.bashrc
  13. sed -i 's/# unmask/unmask/g' $HOME/.bashrc
  14. . $HOME/.bashrc
  15. sed -i 's/hammer/jewel/' /etc/apt/sources.list.d/ceph.list
  16. echo "deb http://download.proxmox.com/debian jessie pve-no-subscription" >> /etc/apt/sources.list
  17. echo "#deb http://download.proxmox.com/debian jessie pvetest" >> /etc/apt/sources.list
  18. sed -i 's/^deb/#deb/g' /etc/apt/sources.list.d/pve-enterprise.list
  19. apt-get update
  20. apt-get dist-upgrade -y
  21. apt-get install -y curl iotop vim git lm-sensors sg3-utils mc ethtool wpagui wireless-tools bonnie++ iperf sysv-rc-conf
  22.  
  23. sed -i 's/DEFAULT="quiet"/DEFAULT="quiet intel_iommu=on vfio_iommu_type1.allow_unsafe_interrupts=1 pci=realloc"/g' /etc/default/grub
  24. update-grub
  25. echo "#etc/modules: kernel modules to load at boot time" > /etc/modules
  26. echo vfio              >> /etc/modules
  27. echo vfio_iommu_type1  >> /etc/modules
  28. echo vfio_pci          >> /etc/modules
  29. echo vfio_virqfd       >> /etc/modules
  30.  
  31. echo "deb http://www.deb-multimedia.org jessie main non-free" >>/etc/apt/sources.list.d/mint.list
  32. apt-get update
  33. apt-get install -y --force-yes deb-multimedia-keyring
  34. apt-get update
  35. apt-get dist-upgrade -y
  36. apt-get update
  37. apt-get autoremove -y
  38. apt-get install -y mate-desktop-environment xorg lightdm
  39. apt-get install -y X11vnc
  40. apt-get install -y firefox-esr-l10n-pl
  41. apt-get install -y openvswitch-switch
  42.  
  43. #KONFIGURACJA HOSTS AKTUALNYMI IP SERWERÓW KLUSTERA
  44. server="proxmox"
  45. host01="1"
  46. host02="2"
  47. host03="3"
  48. host04="4"
  49. echo "127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4" > /etc/hosts
  50. echo "192.168.0.5${host01} ${server}${host01}" >> /etc/hosts
  51. echo "192.168.0.5${host02} ${server}${host02}" >> /etc/hosts
  52. echo "192.168.0.5${host03} ${server}${host03}" >> /etc/hosts
  53. echo "192.168.0.5${host04} ${server}${host04}" >> /etc/hosts
  54. echo "10.10.10.1${host01} osd${host01}" >> /etc/hosts
  55. echo "10.10.10.1${host02} osd${host02}" >> /etc/hosts
  56. echo "10.10.10.1${host03} osd${host03}" >> /etc/hosts
  57. echo "10.10.10.1${host04} osd${host04}" >> /etc/hosts
  58.  
  59. pveceph install -version jewel
  60. apt-get dist-upgrade -y
  61. #JEŚLI MASZ SAMBĘ
  62. [ ! -d /mnt/SambaShare ] && mkdir /mnt/SambaShare
  63. #echo "//192.168.10.22/Images /mnt/SambaShare cifs username=piotr,password=ad_1234,auto 0 0" >> /etc/fstab
  64. echo "mount /mnt/SambaShare/" >> /etc/rc.local
  65. sed -i 's/exit/\#exit/g' /etc/rc.local
  66. echo "exit 0" >> /etc/rc.local
  67. chmod 755 /etc/rc.local
  68. update-rc.d rc.local defaults
  69. update-rc.d rc.local enable
  70. cat << __EOF__ >  /etc/systemd/system/rc-local.service
  71. [Unit]
  72.  Description=/etc/rc.local Compatibility
  73.  ConditionPathExists=/etc/rc.local
  74.  After=network.target
  75. [Service]
  76.  Type=forking
  77.  ExecStart=/etc/rc.local start
  78.  TimeoutSec=0
  79.  StandardOutput=tty
  80.  RemainAfterExit=yes
  81.  SysVStartPriority=99
  82. [Install]
  83.  WantedBy=multi-user.target
  84. __EOF__
  85. systemctl enable rc-local
  86. [ ! -d /etc/ceph ] && mkdir /etc/ceph
  87. ln -sfn /etc/pve/ceph.conf  /etc/ceph/ceph.conf  
  88. /etc/init.d/kmod start  
  89. update-rc.d kmod enable
  90. curl ix.io/client > /usr/local/bin/ix
  91. chmod +x /usr/local/bin/ix
  92. #dodaj użytkownika do logowania, potem w gui stwórz go z opcją PAM Linux i możesz mu nadać prawa
  93. adduser guest
  94. adduser guest users
  95. #passwd guest
  96. ##########################################################################################
  97. #przez GUI skonfiguruj linux bridge z eth2 (tylko autostart ustawiony)
  98. #ustaw NIC1 10.10.10.0 network
  99. #cat /etc/network/interfaces*
  100. #restart serwer i sprawdź ssh osd? w /etc/hosts w razie potrzeby /etc/init.d/networking restart
  101. #na proxmox1 uruchom
  102. #pvecm create kluster
  103. #pvecm help
  104. #pvecm status
  105. #pvecm nodes
  106. #pvecm add proxmox1 # po zalogowaniu ssh na innych od proxmox1 serwerach dołącz je do klustera
  107. #ewentualnie loguj się przez ssh do proxmox2-? i wykonuj powyższe komendy
  108. #od teraz bez hasła logowanie ssh proxmox?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement