Requirement: when searching for products, you need to search from the index. Because the background needs to update products and insert products, how to insert new indexes and update indexes was taken into consideration, after discussion, we decided to use the httpsqs message to notify you to insert a new index and delete the last merged index of the index to update the product information in real time.
Next I will talk about the installation process of httpsqs and the problems encountered during the installation process.
Preparations:
You need to prepare a virtual machine. Here we use vmware7.1,
In Linux, centos5.4 can be used.
Install httpsqs
Install httpsqs
Libevent-2.0.12-stable.tar.gzand okyocabinet-1.4.47.tar.gz
ulimit -SHn 65535
1. Install libevent-2.0.12-stable.tar.gz
Wget http://httpsqs.googlecode.com/files/libevent-2.0.12-stable.tar.gz?#download tar zxvf libevent-2.0.12-stable.tar.gz # unzip CD libevent-2.0.12-stable/./configure -- prefix =/usr/local/libevent-2.0.12-stable/Makemake installcd ../
Install tokyocabinet-1.4.47.tar.gz
Wget http://httpsqs.googlecode.com/files/tokyocabinet-1.4.47.tar.gztar zxvf tokyocabinet-1.4.47.tar.gzcd tokyocabinet-1.4.47 /. /configure -- prefix =/usr/local/tokyocabinet-1.4.47/# Note: Compile Tokyo cabinet on a 32-bit Linux operating system, please use. /configure -- replace the enable-off64. /configure, which can break the limit of 2 GB for database files. #./Configure -- enable-off64 -- prefix =/usr/local/tokyocabinet-1.4.47/Makemake installcd ../
When the second step is executed, the error is caused by missing bzip2-1.0.6.tar.gz.
Install
Http://www.bzip.org/1.0.6/bzip2-1.0.6.tar.gzinstallation start-up wget http://www.bzip.org/1.0.6/bzip2-1.0.6.tar.gztar-xvzf bzip2-1.0.6.tar.gzcd bzip2-1.0.6.make make install
The re-installation of tokyocabinet-1.4.47.tar.gzis still a failure because zlib-1.2.5.tar.gz is missing.
Install
Http://www.winimage.com/zlibdll/zlib-1.2.5.tar.gzinstallation start-up wget http://www.winimage.com/zLibDll/zlib-1.2.5.tar.gztar-xvzf zlib-1.2.5.tar.gzcd zlib-1.2.5 ../configuremakesudo make instal
Continue Step 1 OK
32.16install httpsqs-1.7.tar.gz
wget http://httpsqs.googlecode.com/files/httpsqs-1.7.tar.gztar zxvf httpsqs-1.7.tar.gzcd httpsqs-1.7/makemake installcd ../
If httpsqs-H is successfully installed
--------------------------------------------------------------------------------------------------HTTP Simple Queue Service - httpsqs v1.7 (April 14, 2011)Author: Zhang Yan (http://blog.s135.com), E-mail: net@s135.comThis is free software, and you are welcome to modify and redistribute it under the New BSD License-l <ip_addr> interface to listen on, default is 0.0.0.0-p <num> TCP port number to listen on (default: 1218)-x <path> database directory (example: /opt/httpsqs/data)-t <second> keep-alive timeout for an http request (default: 60)-s <second> the interval to sync updated contents to the disk (default: 5)-c <num> the maximum number of non-leaf nodes to be cached (default: 1024)-m <size> database memory cache size in MB (default: 100)-i <file> save PID in <file> (default: /tmp/httpsqs.pid)-a <auth> the auth password to access httpsqs (example: mypass123)-d run as a daemon-h print this help and exitUse command "killall httpsqs", "pkill httpsqs" and "kill `cat /tmp/httpsqs.pid`" to stop httpsqs.Please note that don't use the command "pkill -9 httpsqs" and "kill -9 PID of httpsqs"!Please visit "http://code.google.com/p/httpsqs" for more help information.
But none of them appear:
error while loading shared libraries: /usr/local/tokyocabinet-1.4.47/lib/libtokyocabinet.so.9: cannot restore segment prot after reloc: Permission denied
At Google, it is said that it has not been set up with a soft connection:
ln -s /usr/local/tokyocabinet-1.4.47/lib/libtokyocabinet.so.9 /usr/lib/libtokyocabinet.so.9
However, Google still reports an error. The solution is as follows:
VI/etc/sysconfig/SELinux file modify SELinux = disabled
Then restart
Try again
httpsqs -h--------------------------------------------------------------------------------------------------HTTP Simple Queue Service - httpsqs v1.7 (April 14, 2011)Author: Zhang Yan (http://blog.s135.com), E-mail: net@s135.comThis is free software, and you are welcome to modify and redistribute it under the New BSD License-l <ip_addr> interface to listen on, default is 0.0.0.0-p <num> TCP port number to listen on (default: 1218)-x <path> database directory (example: /opt/httpsqs/data)-t <second> keep-alive timeout for an http request (default: 60)-s <second> the interval to sync updated contents to the disk (default: 5)-c <num> the maximum number of non-leaf nodes to be cached (default: 1024)-m <size> database memory cache size in MB (default: 100)-i <file> save PID in <file> (default: /tmp/httpsqs.pid)-a <auth> the auth password to access httpsqs (example: mypass123)-d run as a daemon-h print this help and exitUse command "killall httpsqs", "pkill httpsqs" and "kill `cat /tmp/httpsqs.pid`" to stop httpsqs.Please note that don't use the command "pkill -9 httpsqs" and "kill -9 PID of httpsqs"!Please visit "http://code.google.com/p/httpsqs" for more help information.
Installation successful !!
Close: killall httpsqs
Start: httpsqs-D-l 192.168.3.159-a Kevin-P 1218-x/data0/goods
My Linux IP Address: 192.168.3.159
Data storage location:/data0/goods
Port: 1218
For more information, see:
Reference: http://blog.s135.com/httpsqs/