Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Installing Gearman on windows

Gearman can be installed on Windows through cygwin.

Install Cygwin packages

Install cygwin packages (through setup.exe):

  • gcc
  • make
  • libuuid1-devel
  • libiconv
  • boost
  • libboost-devel
  • libmpfr4

Install libevent

Download and unpack libevent 1.4 sources (to a directory without spaces, e.g. C:\cygwin\tmp), then run:

cd libevent-1.4.14b-stable
./configure
make
make install

Now libevent should be installed on /usr/local/lib, but this path is not in the library path and GCC will not find it automatically.

You can copy the generated libraries to /usr/lib:

cp /usr/local/lib/libevent* /usr/lib

(this is not the cleanest solution, you are welcome to propose an alternative)

Install Gearman

Download gearmand C server sources (to a directory without spaces, e.g. C:\cygwin\tmp). Attention, because of this bug you can' install a version higher than V0.14. Here is a direct link to download V0.14.

Run:

cd gearmand-0.14
./configure
make
make install

Now the server is installed and you can launch it from a cygwin terminal:

/usr/local/sbin/gearmand.exe

Or if you want it to be ultra verbose:

/usr/local/sbin/gearmand.exe -vvv

You can also start the process and detach it from the terminal:

gearmand -d

Test

Open 3 terminals.

In the 1st, start the Gearman server:

/usr/local/sbin/gearmand.exe

In the 2nd, start a worker:

gearman -w -f wc -- wc -l

In the 3rd, send a task to the Gearman server. It will be dispatched to the worker which will process it and return the result to the server, which will return it to you 3rd terminal.

gearman -f wc < /etc/passwd
@maulikkanani1
Copy link

maulikkanani1 commented Jun 3, 2017

when i try to install libevent-2.1.8-stable
this error will occur
$ ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... no
checking whether make supports nested variables... no
checking whether make supports nested variables... (cached) no
checking for style of include used by make... none
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in /tmp/libevent-2.1.8-stable': configure: error: no acceptable C compiler found in $PATH See config.log' for more details

@lexandr
Copy link

lexandr commented Sep 26, 2017

Here is the compiled version of gearmand for windows

@ivanzor
Copy link

ivanzor commented Jan 21, 2019

Fatal error: Class 'GearmanWorker' not found'. any help? thanks in advance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment