Skip to content

Instantly share code, notes, and snippets.

@CauanCabral
Last active January 5, 2017 21:09
Show Gist options
  • Select an option

  • Save CauanCabral/5967374 to your computer and use it in GitHub Desktop.

Select an option

Save CauanCabral/5967374 to your computer and use it in GitHub Desktop.
Install Gearman 1.1.12 on OpenSuse 13.1
[Unit]
Description=Gearman Job Server
Wants=network.target
[Service]
ExecStart=/usr/local/sbin/gearmand \
--daemon \
--listen=127.0.0.1 \
--pid-file=/var/run/gearman/gearmand.pid \
--log-file=/var/log/gearman/gearmand.log
# Example with MySQL Persistent
# -q MySQL \
# --mysql-host=localhost \
# --mysql-port=3306 \
# --mysql-user=mygearman \
# --mysql-password=mypass \
# --mysql-db=gearman \
# --mysql-table=gearman_queue
# Example with Postgres Persistent
# -q Postgres \
# --libpq-conninfo "hostaddr=127.0.0.1 port=5432 dbname=gearman user=mygearman password=mypass"
# --libpq-table=queue
Type=forking
[Install]
WantedBy=multi-user.target
#!/bin/bash
clear
echo "Install gearman dependencies ------------------------------"
zypper in -l --recommends gcc-g++ boost-devel gperf libevent-devel postgresql-devel libmysqlclient-devel libuuid-devel
clear
echo "Download gearman-------------------------------------------"
wget https://launchpad.net/gearmand/1.2/1.1.12/+download/gearmand-1.1.12.tar.gz
clear
echo "Upnziping gearman------------------------------------------"
tar -zxf gearmand-1.1.12.tar.gz
cd gearmand-1.1.12
clear
echo "Configure gearman------------------------------------------"
./configure --with-postgresql=/usr/bin/pg_config --with-mysql=/usr/bin/mysql_config
clear
echo "Compile and install----------------------------------------"
make && make install
clear
echo "Create user and group--------------------------------------"
useradd -r -s /bin/bash -g gearman gearman
echo "Create system directories----------------------------------"
mkdir -p /var/run/gearman /var/log/gearman
chown gearman /var/run/gearman
chown gearman /var/log/gearman
clear
echo "Install Sytemd Service for Gearman"
cd ..
wget https://gist.github.com/CauanCabral/5967374/raw/9ca1a323ccc6c58fecbba7b6fe60420f255a46cd/gearmand.service
cp gearmand.service /etc/systemd/system/gearmand.service
systemctl enable gearmand.service
clear
echo "Install PHP extension for gearman--------------------------"
pecl install gearman
src=`find /usr/ -name 'gearman.so' 2> /dev/null`
echo extension=\"$src\" >> /etc/php5/conf.d/gearman.ini
@yaerox
Copy link
Copy Markdown

yaerox commented Apr 3, 2014

Is there a reason why "./configure --with-postgresql=/usr/bin/pg_config --with-mysql=/usr/bin/mysql_config" instead of ./configure only? Regards.

@CauanCabral
Copy link
Copy Markdown
Author

Without that configure didn't found PostgreSQL and MySQL info and queue is not avaliable after install.

@yaerox
Copy link
Copy Markdown

yaerox commented Jun 5, 2014

I'm not sure if your interested in feedback, for me this didn't worked on OpenSUSE 13.1 (clean new installation). Had to install: gcc and clang librarys, uuid-devel libuuid libuuid-devel boost-devel libevent libevent-devel libconfig-devel libconfig++9 libconfig9 gcc48-c++ to get this running.

On my older SUSE I can start gearamnd-jobserver by using "gearmand" or "gearmand -d" command. Don't get this running here. Any idea?

@CauanCabral
Copy link
Copy Markdown
Author

Don't have any idea.
For me that's not working anymore - today I've to install version 1.0.6 ( https://gist.github.com/CauanCabral/6a2dc367a7695c89b0b4 ).

I'll try again with your advices, thank you.

@CauanCabral
Copy link
Copy Markdown
Author

I've changed a litle bit the script and it's working for me now. Please, try again.

@bdowling
Copy link
Copy Markdown

I think you meant gcc-c++ on your zypper install.. Not sure exactly what a compiler for google plus would do.. ;)

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