On 08/10/2017 08:25 AM, Akro wrote:
> This is a really nice idea !
>
> I have played a bit with it; and wanted to start many duplicated vm and connect them. But I failed :/
>
> How can I get that every nodes discover themselves and connects ? (discovery multicast ?)
>
> Also the default cowboy service is only listening on localhost; trying to reach it from outside the vm is then impossible. May be add another instance on port 6465 listening on every ip of the vm ?
>
> Using this live CD, how can I add my own jobs ? Where should my code (for example .beam files) be located since there's no storage ? On a remote share ?
>
> Thanks for this work !
The LiveCD provides 64MB free on the filesystem which is stored in RAM, so that storage isn't permanent and disappears when the machine is turned off. The CloudI configuration provided on the LiveCD is the default one from the installation which doesn't have multicast (or EC2) node discovery turned on, but you can modify the /etc/cloudi/cloudi.conf configuration file to have '{nodes, automatic}.' or '{nodes, [{discovery, [{multicast, []}]}]}.' instead of '{nodes, []}.' to enable LAN multicast node discovery. If you choose to modify /etc/cloudi/cloudi.conf then you should restart cloudi with the command line '/etc/init.d/cloudi restart'. An alternative is to modify the configuration dynamically with a curl command line like 'curl -X POST -d "[{discovery, [{multicast, []}]}]"
http://localhost:6464/cloudi/api/rpc/nodes_set.erl ', however curl is not included on the LiveCD to keep its memory consumption minimal.
To get the cloudi_service_http_cowboy service listening on all the interfaces, add '{ip, {0, 0, 0, 0}}' to the args list. You can always add more instances on separate ports, but it is simpler to stick with one.
To add your own services you can put them on the filesystem, though you may need to compile them if it isn't an interpreted language (all the programming languages that are enabled by the default configuration script settings are supported by the LiveCD, i.e., C/C++, Erlang, Java, Javascript, Perl, PHP, Python, Ruby) using Alpine Linux dependencies. You could also use other storage, like a usb flash drive, so you don't necessarily need to use remote storage.
If you need these changes to the filesystem to be persistent, it would be best to modify the LiveCD creation to include your custom code and configuration. That can be pursued by cloning
https://github.com/CloudI/live_cd and modifying the genapkovl-cloudi.sh script to include custom changes to the filesystem, though it would require going through the steps of building a new custom LiveCD (the README provides a basic guide for doing that).
Best Regards,
Michael