1、到 /usr/local/src 目录,运行下面指令下载、解压安装包cd /usr/local/src
wget http://www.xunsearch.com/download/xunsearch-full-latest.tar.bz2
tar -xjf xunsearch-full-latest.tar.bz2
2、执行安装脚本,根据提示进行操作,主要是输入 xunsearch 软件包的安装目录,强烈建议单独 规划一个目录,而不是混到别的软件目录中。cd xunsearch-full-1.4.13/
sh setup.sh
第一次安装的话,过程可能会稍显漫长,请不必着急,您大可泡杯茶一边喝一边等待即可。默认安装目录为:/usr/local/xunsearch
3、出现如下界面证明安装完成
4、安装完成后就可以启动/重新启动 xunsearch 的后台服务,下面命令中的 $prefix 请务必替换为您的安装目录,而不是照抄。cd $prefix ; bin/xs-ctl.sh restart
// 我的安装路径是/usr/local/xunsearch
cd /usr/local/xunsearch
bin/xs-ctl.sh -b local start // 监听在本地回环地址 127.0.0.1 上
bin/xs-ctl.sh -b inet start // 监听在所有本地 IP 地址上
bin/xs-ctl.sh -b a.b.c.d start // 监听在指定 IP 上
bin/xs-ctl.sh -b unix start // 分别监听在 tmp/indexd.sock 和 tmp/searchd.sock
5、设置开机启动,编辑文件:vim /etc/rc.local,我这是个软连指向到的路径是 /etc/rc.d/rc.localvim /etc/rc.local
显示如下内容,把开机启动的路径添加进去#!/bin/bash
# THIS FILE IS ADDED FOR COMPATIBILITY PURPOSES
#
# It is highly advisable to create own systemd services or udev rules
# to run scripts during boot instead of using this file.
#
# In contrast to previous versions due to parallel execution during boot
# this script will NOT be run after all other services.
#
# Please note that you must run 'chmod +x /etc/rc.d/rc.local' to ensure
# that this script will be executed during boot.
# 完整启动的路径 && 启动命令
/usr/local/xunsearch/bin/ && ./xs-ctl.sh -b inet start
***划重点***
如果重启服务器发现讯搜服务没有启动,那是因为 /etc/rc.d/rc.local 文件没有执行权限,给予执行权限就可以了# 给予执行权限
chmod +x /etc/rc.d/rc.local
重启服务器就可以开机启动了,至此完成