Keeping the latest erlang but running riak's make devrel - erlang

I'm reading this tutorial:
http://docs.basho.com/riak/1.1.4/tutorials/fast-track/Building-a-Development-Environment/
I installed riak from the .deb package in ubuntu. If I run riak start it will say "node is already running!" the second time I do it. I downloaded the riak source. The tutorial wants me to do make devrel. It gives me a long erlang error. I think I need to compile from source first before I can run that. if I try to compile riak from source it will complain I have the latest version of erlang. I tried to alias erl=/usr/lib/riak/erts-5.9.1/bin/erl to use the older version bundled with riak but it still gives same error. I tried to remove the vsn requirements from the rebar.config.
Is there a way to run multiple nodes using riak start after installing riak from the .deb package? Is there a way to compile riak without removing the latest version of erlang?

I had this same problem with Riak installed under Homebrew.
The easiest thing is to use Kerl to install multiple versions of Erlang/OTP, then build Riak from source with the devrel target. You can find the instructions for getting the Erlang installation right at Basho's docs on installing Erlang using Kerl.
make devrel will get you multiple complete, self-contained instances of Riak.

Related

Is it possible to run a private Hex (Erlang) dependency manager (and if so how)?

I'm working in an Erlang environment. I'm looking to establish a dependency manager so that our build server can publish binaries for reuse instead of using source code dependencies. The Hexpm GitHub project implies that it is possible to run it outside of the hex.pm website, but I don't see any instructions for doing so. Specifically, I would like my build server to be able to publish packages either directly (via the filesystem) or via rebar3, and for subsequent rebar3 builds to be able to use those published packages
Is it possible to run Hex on my own server?
If so, where would I find some documentation on how to set it up (or provide the instructions directly)?
If you look at https://github.com/hexpm/hex_web there are instructions in the README.md for both installing and running it. It's a phoenix application, so it should all be relatively familiar ground if you've looked at the phoenix framework before.
As for getting rebar3 to work with your installation, there is documentation here as to the config values to use for setting the URLs to use for hex packages: http://www.rebar3.org/docs/hex-package-management.
HTH.

erlang zero dependencies installer for Debian and Ubuntu

In order to ease the installation process of RabbitMQ, I want to use a simple, zero dependencies installer for erlang.
There is a great project on Github from the guys at RabbitMQ - erlang-rpm, but this is RPM only.
I'm aware of erlang-solutions, but it not a single, no dependencies installer.
EDIT: Adding some context here. I need this to be able to prepare a simple, offline install to my app, which needs RabbitMQ. Offline means NO access to internet for downloading dependencies.
Any ideas?
There is no Zero-dependency Erlang Ubuntu/Debian for RabbitMQ.
But the Erlang Solution package can be installed easily.
We built the Centos package because the dependencies are hard to install on Centos (if you don't want to use the epel)
If you want to create an offline setup, you can do it like for other packages (https://askubuntu.com/questions/974/how-can-i-install-software-or-packages-without-internet-offline). Or you can create your own package by building Erlang from source code.
Note also RabbitMQ has dependencies as socat

Industry standard for running daemonized Erlang/OTP applications?

Some of modern infrastructure components such as Yaws and CouchDB can be installed on Ubuntu with
sudo apt-get install
and then they can be started with
{service_name} start or simply {service_name}
I wonder if there are any differences between this approach and the Erlang/OTP way, that is uploading an OTP release to the production server and then starting it with a rebar-generated script.
What is the industry standard? Install/start a repository-based binary or upload/start a rebar-generated release?
Also, do the repository-based binaries have all the OTP functionality in place, like OTP applications structure, supervision and the option to attach to the live application via console?
Every time, you are starting erlang, you are starting a release. Even, if you only type erl in terminal, it runs a release (you can find the .boot, .rel and .script files in erlang_rootdir/releases/name_of_release.
I think this answers your last question: packages installed from repository still have the OTP structure, supervision and all the goodies. There are just couple of bash scripts, that make starting and stopping them more friendly to someone used to service_name start. You should also be able to find a script similar to the one generated by rebar.
Check, where are those files and simply cat them. You should see, they simply start Erlang release.
The only thing, that you can't do with package managers, is hot code upgrade. Most package managers simply stop the running application, install new version and start it back. In Erlang, you can upgrade running release, but this is quite advanced stuff. Besides that - there are no disadvantages of using OS packages.

Installing Erlang without GTK

I'm trying to get Erlang working on my Fedora server, specifically to run rabbitmq, but when I yum install erlang yum complains that wxGTK requires a bunch of packages.
Wtf? Why is erlang trying to install a GUI? I intend to deploy this on a headless server.
Do I need to compile erlang from source? Is there no GUI-less version of erlang I can use?
I like to use the kurl script created by the folk at Basho to install Erlang. It works very well on ubuntu. I hope this will be ok on Fedora too.
This will actually automatically download the source code, and compile it. If you dont have Wx installed, it will not compile this library and will work perfectly without (as long as you dont use tools which need it, of course)
I guess by default your erlang installation has wxErlang enabled and so those packages are required for installation.
On https://github.com/erlang/otp/wiki/Installation you can find instructions on how to manually install Erlang/OTP.
In the configure part you can disable the wxErlang part. Usually no extra config is required since the wxErlang-support will be disabled by default when the required packages are not installed.

Distribute CouchDB as part of a Rails app?

I am working on a Rails project and the Architect has asked me to investigate bundling CouchDB into to application so that it can be deployed by Capistrano across multiple platforms and managed by Rake.
My expectation was that I could set up the Erlang VM on the various environments and then distribute the CouchDB application with Capistrano. However I can't find any option to download CouchDB without the Erlang runtime. I can, however see an option to build CouchDB from source which I assume is platform dependent.
I am new to Erlang and CouchBD, am I missing something? Is there a way to bundle CouchDB into a Rails app and distribute it across multiple platforms?
Have a look at some of the tools for provisioning Rails services (such as passenger_stack). Passenger Stack will download, make and install the ancillary services for your Rails app ... might be something you can adapt or use as a base to install Erlang and CouchDB.
There are a bunch of alternatives to this as well. Deprec contains recipes for provisioning with Capistrano. Essential idea is the same though.
I think you will not find a silver bullet. Distributing Erlang is similar to distributing Ruby; however Ruby has the advantage of being included in many default OS installs.
I know ejabberd has pre-built binaries for many distros. You might investigate how they do it.
The correct solution probably depends on how many "multiple platforms" you are targeting. If it's "Ubuntu 8.04 plus Ubuntu 10.04" that is different from several Linux distros, plus OSX, plus FreeBSD. Typically only open source projects support those many platforms and ideally you can get patches from the community. For internal projects, I have seen teams standardize on a Linux build and use virtualization on Mac/Windows.
But back to your question:
Building from source is a reasonable option. You could build when you deploy, or pre-build for all platforms and then deploy the binaries. Both Erlang and CouchDB use Autoconf which means you can --prefix them to a dedicated location (more-or-less standalone apps). It will take some trial and error but your build script can
Platform-specific dependency setup: gcc, make, autoconf, everything you need. apt-get on Ubuntu, yum on RHEL, Macports, whatever you need to get a common platform on your development and deployment system
Compile and install the rest using the tools from step 1. Use configure --prefix=/opt/my_software to keep it all in one place. (You can totally uninstall with rm -rf.)
This is an medium-level challenge--mostly trial and error. If possible, work within a build framework such as Rake or Toby's suggestion passenger_stack. Good luck!

Resources