Advertisement
42n4

proxmox_ceph_init

Jun 28th, 2016
344
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.77 KB | None | 0 0
  1. ####PROXMOX
  2. #pvecm create cluster #na głównym serwerze 03 wykonujemy pvecm create cluster
  3. #wykonaj poniższe komendy na hoście 03, potem po zalogowaniu ssh proxmoxhw0? na każdym innym
  4. #curl http://pastebin.com/raw/bcqTc04Q | sed 's/\r$//'  > proxmox_ceph_init.sh      
  5. #cat << __EOF__ >> /root/.ssh/config
  6. #Host *
  7. #    StrictHostKeyChecking no
  8. #    UserKnownHostsFile /dev/null
  9. #__EOF__
  10. #chmod 600 /root/.ssh/config
  11. #ssh-keygen -t rsa -b 2048 -N '' -f /root/.ssh/id_rsa
  12. server="proxmox"
  13. host01="1"
  14. host02="2"
  15. host03="3"
  16. host04="4"
  17. echo "127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4" > /etc/hosts
  18. echo "192.168.0.53 ${server}${host01}" >> /etc/hosts
  19. echo "192.168.0.54 ${server}${host02}" >> /etc/hosts
  20. echo "192.168.0.55 ${server}${host03}" >> /etc/hosts
  21. echo "192.168.0.56 ${server}${host04}" >> /etc/hosts
  22. echo "10.10.10.1${host01} osd${host01}" >> /etc/hosts
  23. echo "10.10.10.1${host02} osd${host02}" >> /etc/hosts
  24. echo "10.10.10.1${host03} osd${host03}" >> /etc/hosts
  25. echo "10.10.10.1${host04} osd${host04}" >> /etc/hosts
  26. apt-get install -y curl iotop vim git lm-sensors
  27.  
  28. pveceph install -version hammer
  29. apt-get dist-upgrade -y
  30. [ ! -d /mnt/SambaShare ] && mkdir /mnt/SambaShare
  31. #echo "//192.168.10.22/Images /mnt/SambaShare cifs username=piotr,password=ad_1234,auto 0 0" >> /etc/fstab
  32. echo "mount /mnt/SambaShare/" >> /etc/rc.local
  33. sed -i 's/exit/\#exit/g' /etc/rc.local
  34. echo "exit 0" >> /etc/rc.local
  35. chmod 755 /etc/rc.local
  36. update-rc.d rc.local defaults
  37. update-rc.d rc.local enable
  38. cat << __EOF__ >  /etc/systemd/system/rc-local.service
  39. [Unit]
  40.  Description=/etc/rc.local Compatibility
  41.  ConditionPathExists=/etc/rc.local
  42.  After=network.target
  43. [Service]
  44.  Type=forking
  45.  ExecStart=/etc/rc.local start
  46.  TimeoutSec=0
  47.  StandardOutput=tty
  48.  RemainAfterExit=yes
  49.  SysVStartPriority=99
  50. [Install]
  51.  WantedBy=multi-user.target
  52. __EOF__
  53. systemctl enable rc-local
  54. [ ! -d /etc/ceph ] && mkdir /etc/ceph
  55. ln -sfn /etc/pve/ceph.conf  /etc/ceph/ceph.conf  
  56. /etc/init.d/kmod start  
  57. update-rc.d kmod enable
  58. curl ix.io/client > /usr/local/bin/ix
  59. chmod +x /usr/local/bin/ix
  60. #pvecm create kluster
  61. #pvecm help
  62. #pvecm status
  63. #pvecm nodes
  64. #pvecm add proxmox2 # po zalogowaniu ssh na innych od proxmox2 serwerach dołącz je do klustera
  65. ##########################################################################################
  66. #loguj się ssh proxmoxhw0? i wykonuj powyższe komendy
  67. #od teraz bez hasła logowanie ssh proxmoxhw0?
  68. ##########################################################################################
  69. #przez GUI skonfiguruj linux bridge z eth1 (tylko autostart ustawiony) i 10.10.10.1?
  70. #set NIC1 10.10.10.1* network
  71. #cat /etc/network/interfaces*
  72. #restart serwer i sprawdź ssh osd? w razie potrzeby /etc/init.d/networking restart
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement