MC1 headless cluster / initialization

Post Reply
darkalfie
Posts: 5
Joined: Sat Jul 13, 2019 1:45 pm
languages_spoken: english
ODROIDs: c2,xu4,n2
Has thanked: 0
Been thanked: 0
Contact:

MC1 headless cluster / initialization

Unread post by darkalfie » Tue Jan 07, 2020 9:27 pm

I've 8 MC1 to be used for development purposes (kubernetes, salt, etc.) SInce they are headless its been tricky setting them up (I use the UART cables now to manually login to each of them to get the IP, etc..)

Any recommendations on a way I can do one of the following (via the microsd card image)

1. Have them static IP on eth0
2. Make them pull/execute a remote script on boot up (curl http://remote.host.com/script.sh | bash)
3. Have them report their IPs via ddns/curl to a webhost
4. (Best for me) install pre-built .deb / binaries and /etc/rc.local file so the needed services can come up once its powered up and on the network

o_lampe
Posts: 49
Joined: Wed Jan 01, 2020 12:35 am
languages_spoken: english german
ODROIDs: MC1 solo
Has thanked: 1 time
Been thanked: 4 times
Contact:

Re: MC1 headless cluster / initialization

Unread post by o_lampe » Wed Jan 08, 2020 1:59 am

I've connected headless SBC's to my internet router. It shows their IP addresses and it can "fix" them, too ( as long as they stay on that router).

mdrjr
Site Admin
Posts: 11735
Joined: Fri Feb 22, 2013 11:34 pm
languages_spoken: english, portuguese
ODROIDs: -
Location: Brazil
Has thanked: 1 time
Been thanked: 17 times
Contact:

Re: MC1 headless cluster / initialization

Unread post by mdrjr » Sat Jan 11, 2020 10:11 pm

darkalfie wrote:
Tue Jan 07, 2020 9:27 pm
I've 8 MC1 to be used for development purposes (kubernetes, salt, etc.) SInce they are headless its been tricky setting them up (I use the UART cables now to manually login to each of them to get the IP, etc..)

Any recommendations on a way I can do one of the following (via the microsd card image)

1. Have them static IP on eth0
2. Make them pull/execute a remote script on boot up (curl http://remote.host.com/script.sh | bash)
3. Have them report their IPs via ddns/curl to a webhost
4. (Best for me) install pre-built .deb / binaries and /etc/rc.local file so the needed services can come up once its powered up and on the network
Where's what I would do
Since your cluster size is 8 only (small) I would do it all manually
It saves tons of time doing something like that, implementation, debuging, etc..

If you are using our minimal images it already has rc.local enabled so add whatever you want there and live happy.

User avatar
mad_ady
Posts: 7150
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2, Go, Go Advance
Location: Bucharest, Romania
Has thanked: 315 times
Been thanked: 221 times
Contact:

Re: MC1 headless cluster / initialization

Unread post by mad_ady » Sun Jan 12, 2020 3:16 pm

I'd automate it :)
You can do the following - mount the installation image as a loop device with losetup so you can access its partitions (might require you to boot with loop.max_part=16 kernel parameter). Then you can add your bootstrap code to loop0p2/aa_firstboot script which gets called on first boot.

You can start with a dhcp-enabled ip and on first boot you can ask whatever http script to assign you a static ip based on your mac (though it's less work if using it in a static lan to use static dhcp leases). You can use nmcli or /etc/network/interfaces to set the static ip.

The bootstrap code can handle all the image initialization you need. Then flash the same image 8 times and boot each node.

I had to do this for a 30 node setup and used a mixed approach. I manually set up one of the nodes then turned the disk into an image (shrink + dd), flashed the image on all nodes and then used ansible to do the personalized config (set hostname, ssh/vpn keys, etc)

Post Reply

Return to “General Topics”

Who is online

Users browsing this forum: No registered users and 1 guest