Gearman is a tool used for distributed batch processing. ##Prerequisites
All the files in this repo must be kept in the same directory
##GLOBAL
"GLOBAL" file contains the list of global variables and functions used by all the scripts
##Driver script
Run the following command inside the source file directory
sudo ./driver.sh
You can select the tools you want to install by making a check in the dialog.
###1. Gearman Server
- Download and compile Gearman source code.
###2. Gearman Manager
- Download Gearman Manager source code
- Install PHP gearman libraries
- Compile pcntl extension for PHP
###3. Gearman UI
- Gearman UI source code written in PHP
- Download and install Node Package Manager(npm)
- Download and install Bower
- Install Composer for PHP
##Individual files can also be run in the following manner
sudo ./install_php.sh
will compile and install php alongwith pear, pcntl and mysql extensions as per GLOBAL
sudo ./install_gearman.sh
will install gearman version as mentioned in GLOBAL
sudo ./install_gearman_manager.sh
will install Gearman manager based on PHP version present
sudo ./install_gearman_ui.sh
will install gearman web ui
##Post Installation
###1. Gearman Server
###2. Gearman Manager
- Copy pcntl.so and gearman.so in php.ini file
###3. Gearmanui
- You need to copy gearmanui folder downloaded in
GEARMAN_UI_DIR
inGLOBAL
file to the document root of your web server. Also the document root should point togearmanui/web
- Make sure appropriate php version is enabled in your web server conf file
- In case of Apache server, set
AllowOverride All
in httpd.conf file.
##Using Gearman and other tools
###1. Gearman Server
- Start the gearmand daemon by running
sudo service gearmand start
. - This will start the daemon on port number 4730 by default
- You can verify by
telnet 127.0.0.1 4730
.
###2. Gearman Manager
- Start the gearman manager daemon by running
sudo service gearman-manager start
. - By default, it will launch 3 workers for each of the functions
fetch_url
andreverse_string
. These workers are located in${GEARMAN_MANAGER_DOWNLOAD_DIR}
/GearmanManager/lib/pecl-workers as specified in GLOBAL - The conf file for gearman manager is located in
GEARMAN_MANAGER_CONF
in GLOBAL - You can check if the workers are launched by the following command
telnet 127.0.0.1 4730
Once you are connected run status
command. The output should be following:
status
reverse_string 0 0 3
fetch_url 0 0 3
The same can also be seen through gearmanui
###3. Gearman UI
- Once, you have followed the post installation steps, check the config file in
${GEARMAN_UI_DIR}
/gearmanui/config.yml - referGLOBAL
. By default the UI points to gearman server on localhost. - Once you hit the url in the browser, you should be able to see the same thing as the telnet interface.
##ToDo
Add init scripts forgearmand
andgearman-manager
.- Replace yum update with only the needed packages.