Hi Misha,

Another possibility for starting multiple instances from the packaged builds
is the following:

1. Create a folder to store the relevant files and data for "staging"

mkdir -p ~/staging/etc


2. Create an app.config and vm.args file for "staging"

~/staging/etc/app.config

[

 {riak_core, [

              {ring_state_dir, "data/ring"},

              {web_ip, "127.0.0.1" },

              {web_port, 8091 },

              {handoff_port, 8101 }

             ]},

 {riak_kv, [

            {storage_backend, riak_kv_bitcask_backend},

            {pb_ip,   "127.0.0.1" },

            {pb_port, 8081 }

           ]},

 {bitcask, [

             {data_root, "data/bitcask"}

           ]},

 {sasl, [

         {sasl_error_logger, {file, "log/sasl-error.log"}},

         {errlog_type, error},

         {error_logger_mf_dir, "log/sasl"},      % Log directory

         {error_logger_mf_maxbytes, 10485760},   % 10 MB max file size

         {error_logger_mf_maxfiles, 5}           % 5 files max

         ]}

].


~/staging/etc/vm.args

-name stag...@127.0.0.1

-setcookie riak

+K true

+A 64

-env ERL_MAX_PORTS 4096

-env ERL_FULLSWEEP_AFTER 10


3. Start the "staging" instance using the erl binary installed by the
package

cd ~/staging

/usr/lib/riak/erts-5.7.5/bin/erl \

-config ~/staging/etc/app.config \

-args_file ~/staging/etc/vm.args \

-eval '[application:start(A) || A <- [sasl, crypto, webmachine, riak_core,
luke, erlang_js, bitcask, mochiweb, os_mon, riak_kv]].'



You should now have a running instance accessible at
http://127.0.0.1:8091/riak


Thanks,

Dan


Daniel Reverri
Developer Advocate
Basho Technologies, Inc.
d...@basho.com


On Sun, Jul 25, 2010 at 1:57 PM, Misha Gorodnitzky <mis...@pobox.com> wrote:

> Ya, I changed that in my vm.staging.args config file. However, in the
> process list I see these two processes:
>
>  /usr/lib/riak/erts-5.7.5/bin/run_erl -daemon /var/run/riak-staging/
> /var/log/riak-staging exec /usr/sbin/riak console -
>  /usr/lib/riak/erts-5.7.5/bin/beam.smp -K true -A 5 -- -root
> /usr/lib/riak -progname riak -- -home /var/lib/riak -- -boot
> /usr/lib/riak/releases/0.12.0/riak -embedded -config
> /etc/riak/app.staging.config -name riak_stag...@127.0.0.1 -setcookie
> riak-staging -home /var/lib/riak-staging -- console -
>
> The second one being a child to the first. I can see that the -name is
> being set there, what worries me is that -progname is 'riak', I'm not
> sure if that needs to be unique or not, or how to change it.
>
>
> --M
>
> On 25 July 2010 17:29, Grant Schofield <gr...@basho.com> wrote:
> > Does the second vm.args have the same -name setting as the first node?
> Each node will need to have a unique name configured.
> >
> > Grant Schofield
> > Developer Advocate
> > Basho Technologies, Inc.
> >
> >
> > On Jul 25, 2010, at 9:00 AM, Misha Gorodnitzky wrote:
> >
> >> Hi all,
> >>
> >> I'm trying to run multiple instances of Riak on my server with the
> >> goal to run both the staging environment and eventually the production
> >> environment on the same server (I only have one for this project).
> >> This is an Ubuntu server and if at all possible I'd prefer not to
> >> build Riak from source, although I understand that it would be easier
> >> to have multiple instances running that way. I would rather keep
> >> software managed with the package manager here.
> >>
> >> What I've done is I've modified /usr/sbin/riak to allow specifying the
> >> config files to use (app.config, vm.args), the log dir, run dir (for
> >> the pipe) and the home dir, and I can startup an instance of Riak
> >> using my "staging" environment. However, when I try to start up the
> >> second Riak instance, it fails with just a couple of things
> >> out-of-the-ordinary in it's logs:
> >>
> >>  =INFO REPORT==== 25-Jul-2010::13:54:35 ===
> >>      application: riak_kv
> >>      exited: {shutdown,{riak_kv_app,start,[normal,[]]}}
> >>      type: permanent
> >>  =INFO REPORT==== 25-Jul-2010::13:54:35 ===
> >>      alarm_handler: {clear,system_memory_high_watermark}
> >>  {"Kernel pid
> terminated",application_controller,"{application_start_failure,riak_kv,{shutdown,{riak_kv_app,start,[normal,[]]}}}"}^M
> >>  Kernel pid terminated (application_controller)
> >>
> ({application_start_failure,riak_kv,{shutdown,{riak_kv_app,start,[normal,[]]}}})^M
> >>
> >> And the Riak process that's already running logs this:
> >>
> >>  ** Connection attempt from disallowed node 'riak_stag...@127.0.0.1' **
> >>
> >> Any ideas what this might be? Has anyone managed to do this using the
> >> Riak .deb package?
> >>
> >> Thanks,
> >>
> >> --Misha
> >>
> >> _______________________________________________
> >> riak-users mailing list
> >> riak-users@lists.basho.com
> >> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
> >
> >
>
> _______________________________________________
> riak-users mailing list
> riak-users@lists.basho.com
> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
>
_______________________________________________
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com

Reply via email to