You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Zekeriya KOÇ <ze...@gmail.com> on 2012/03/20 07:53:36 UTC

automatic installation on windows

Hi,

At work we are planning to use couchdb and it's superior replication
features with our point of sales software. there will be 200 clients
replicating data from/to a central couchdb. We will use couchdb on a linux
box at data center but i have no choice on clients but ms windows.

we are testing with this[1] installer and there is no problem. But we need
to make the installation process automatic so we can install couchdbs on
200 remote windows machines. we may want to customize some steps of
installation (like changing some values at local.ini), we may need to do
installation via batch script with something like "silent" option etc.

so what about the source code of the installer that mentioned[1]? can we
reach it? modify it? or are there a binary package for windows that can be
used with just extracting the zip archive?

Reg.

[1]:  http://wiki.apache.org/couchdb/Installing_on_Windows

-- 
Zekeriya "zekUs" KOÇ

Re: automatic installation on windows

Posted by Dave Cottlehuber <da...@muse.net.nz>.
On 21 March 2012 11:02, Zekeriya KOÇ <ze...@gmail.com> wrote:
> David,
>
> thanks for this very detailed explanations. I got the general idea and
> going deeper (slowly).
>
> i understand that slim_couch.cmd does the cleaning stuff that described
> at Quirks_on_Windows wiki page. and as i understand it prepares to be
> packaged with a tool like inno. so i take  the files after slim_couch
> execution, add vcredist add service registration and package with some tool
> like inno. right?

Yup. You can re-use the inno config file already in the couchdb source code.
Just remember to repackage off a freshly extracted image so you don't
get any contaminated var/ etc/ run/ files.

The 2 main decisions you need to make are:
- do you need to distribute/include vcredist?
If you control the domain then I'd use a GPO and distribute that separately.
It will ensure future updates are small and easy.

- do you need to distribute a service?

Some things to be aware of;
- there is no inbuilt log control so make sure you manage
var/log/couchdb/couch.log appropriately
- in 1.2.0 there will be auto-compaction to set up yourself, but in
1.1.1 you will need to manage this
yourself.

- if you run as a service, ensure you have auto-restart configured
whether you use erlsrv or call erl.exe directly.

There's nothing stopping you from distributing a preset couchdb,
including config files, for example
a replication set up so that on install and launch it immediately
begins syncing from your master Couch.

> again thanks for all.

np!

> For 1.1.1 I updated the slimming [9] and you could easily repackage
>> that as an sfx.exe. Make sure (for this 1.1.1 build) to include [10] as it
>> is
>> compiled against this vcredist specifically, no other will work.
>>
>> [9]:
>> https://github.com/downloads/dch/couchdb/couchdb-1.1.1_js185_otp_R14B03+fix-win32-crypto_slim.7z
>> [10]:
>> http://download.microsoft.com/download/5/D/8/5D8C65CB-C849-4025-8E95-C3966CAFD8AE/vcredist_x86.exe
>>
>> A+
>> Dave
>>
>
>
>
> --
> Zekeriya "zekUs" KOÇ - http://zekzekus.com/

Re: automatic installation on windows

Posted by Zekeriya KOÇ <ze...@gmail.com>.
David,

thanks for this very detailed explanations. I got the general idea and
going deeper (slowly).

i understand that slim_couch.cmd does the cleaning stuff that described
at Quirks_on_Windows wiki page. and as i understand it prepares to be
packaged with a tool like inno. so i take  the files after slim_couch
execution, add vcredist add service registration and package with some tool
like inno. right?

again thanks for all.

For 1.1.1 I updated the slimming [9] and you could easily repackage
> that as an sfx.exe. Make sure (for this 1.1.1 build) to include [10] as it
> is
> compiled against this vcredist specifically, no other will work.
>
> [9]:
> https://github.com/downloads/dch/couchdb/couchdb-1.1.1_js185_otp_R14B03+fix-win32-crypto_slim.7z
> [10]:
> http://download.microsoft.com/download/5/D/8/5D8C65CB-C849-4025-8E95-C3966CAFD8AE/vcredist_x86.exe
>
> A+
> Dave
>



-- 
Zekeriya "zekUs" KOÇ - http://zekzekus.com/

Re: automatic installation on windows

Posted by Dave Cottlehuber <da...@muse.net.nz>.
On 20 March 2012 09:58, Dave Cottlehuber <da...@muse.net.nz> wrote:
> On 20 March 2012 07:53, Zekeriya KOÇ <ze...@gmail.com> wrote:
>> Hi,
>>
>> At work we are planning to use couchdb and it's superior replication
>> features with our point of sales software. there will be 200 clients
>> replicating data from/to a central couchdb. We will use couchdb on a linux
>> box at data center but i have no choice on clients but ms windows.
>
> Great! While the performance is not as good as on linux, functionally it should
> be the same.
>
>> we are testing with this[1] installer and there is no problem. But we need
>> to make the installation process automatic so we can install couchdbs on
>> 200 remote windows machines. we may want to customize some steps of
>> installation (like changing some values at local.ini), we may need to do
>> installation via batch script with something like "silent" option etc.
>
> It's an inno installer so all their parameters work OOB [4],[5]. You could
> easily deploy this with GPOs.
>
>> so what about the source code of the installer that mentioned[1]? can we
>> reach it? modify it? or are there a binary package for windows that can be
>> used with just extracting the zip archive?

For 1.1.1 I updated the slimming [9] and you could easily repackage
that as an sfx.exe. Make sure (for this 1.1.1 build) to include [10] as it is
compiled against this vcredist specifically, no other will work.

[9]: https://github.com/downloads/dch/couchdb/couchdb-1.1.1_js185_otp_R14B03+fix-win32-crypto_slim.7z
[10]: http://download.microsoft.com/download/5/D/8/5D8C65CB-C849-4025-8E95-C3966CAFD8AE/vcredist_x86.exe

A+
Dave

Re: automatic installation on windows

Posted by Dave Cottlehuber <da...@muse.net.nz>.
On 20 March 2012 07:53, Zekeriya KOÇ <ze...@gmail.com> wrote:
> Hi,
>
> At work we are planning to use couchdb and it's superior replication
> features with our point of sales software. there will be 200 clients
> replicating data from/to a central couchdb. We will use couchdb on a linux
> box at data center but i have no choice on clients but ms windows.

Great! While the performance is not as good as on linux, functionally it should
be the same.

> we are testing with this[1] installer and there is no problem. But we need
> to make the installation process automatic so we can install couchdbs on
> 200 remote windows machines. we may want to customize some steps of
> installation (like changing some values at local.ini), we may need to do
> installation via batch script with something like "silent" option etc.

It's an inno installer so all their parameters work OOB [4],[5]. You could
easily deploy this with GPOs.

> so what about the source code of the installer that mentioned[1]? can we
> reach it? modify it? or are there a binary package for windows that can be
> used with just extracting the zip archive?

Both, source is available [2] and the relevant makefile [3].

There are some short tips on embedding [6] but in a nutshell, run the
installer somewhere
use [7] to clean it up, add in an erl.ini (that matches your erts version):

more ./erts-5.9/bin/erl.ini
[erlang]
Bindir=..\\erts-5.9\\bin
Progname=erl
Rootdir=..

If you need/want a service then I'd probably go for a simple windows
service with auto-restart
set. Erlang comes with a nifty erlsrv.exe to handle this, but unless
you need multiple
erlang apps on the same host it's overkill. Make sure your start
folder is %COUCH%/bin.

Other than handling the service, you can then simply zip this up.
is in erl.ini. You need 2 copies, one in erts-5.9/bin/erl.ini and one
in bin/erl.ini. All other stuff
is relative.

slim_couch.cmd [7] IIRC is still OK on 1.1.1 but needs some changes
for 1.2.0, and then I should be
able to hook this in as a proper build target into the source [8]

The 1.2.0 binary release will remove *most* of the dependency on a
specific vcredist_x86.exe
version so assuming you are current with MS patching and already have
a VC++10 runtime deployed,
you could drop another 4MB from the package.

I am hacking on this at the moment so let me know if you have any problems.

A+
Dave

[2]: https://github.com/apache/couchdb/blob/1.2.x/etc/windows/couchdb.iss.tpl
[3]: https://github.com/apache/couchdb/blob/1.2.x/etc/Makefile.am
[4]: http://unattended.sourceforge.net/InnoSetup_Switches_ExitCodes.html
[5]: http://www.jrsoftware.org/ishelp/
[6]: https://www.dropbox.com/sh/jeifcxpbtpo78ak/su5OLiAyiI/misc/slim_couch.cmd
[7]: http://wiki.apache.org/couchdb/Quirks_on_Windows
[8]: https://issues.apache.org/jira/browse/COUCHDB-1181