xunsearch 在 window 下测试实践(1)

# 1,配置文件,这里我自己为laravel项目名配置了一个, 拿一个测试表的字段来用(注意这个配置文件window和linux上都要放一份一模一样的)

有个问题就是: 服务端我使用云服务器的, 用 ip addr 或者 ifconfig 命令获取到的ip是内网ip, 但是本地用  telnet x.x.x.x(服务器ip地址) 8383 连接不通,但是用它的外网ip就可以了(如果连接通了,cmd直接跳入黑框就证明是通的);

project.name = laravel
project.default_charset = utf-8
server.index = 服务器ip地址:8383
server.search = 服务器ip地址:8384

[id]
type = id

[authorid]

[title]
type = title

[body]
type = body
cutlen = 30

[published_at]
type = date

 # 2,打开服务器的8383和8384端口,设置xunsearch服务器监听索引的IP的访问,因为默认安装的时候只监听本机的访问;

[root@VM_0_8_centos sysconfig]# vi /etc/sysconfig/iptables

 

 

 # 3,然后执行下 nestat -antp 命令, 看到端口号前面是0.0.0.0,如果是127.0.0.1的话就重新执行上面的 -b 的那个命令;

如果还是127.0.0.1就检查下 /etc/sysconfig/iptables 这文件里面的两个端口是不是复制错了,复制22端口的那条,我就是因为复制了 3306 端口的那条,搞了很久;

再不然只能重启试试;

 

# 4, Linux服务器上 导入 mysql 数据源

[root@VM_0_8_centos php]# util/Indexer.php --rebuild --source=mysql://用户名:密码@localhost/数据库名 --sql="select * from 表名" --project=laravel(项目名,即laravel.ini中的project.name)

 # 5,用Xunsearch文档上面的, 在 windows下 生成测试骨架代码

 

 

 

 

# 6,效果测试

 

 

posted @ 2020-04-21 14:29  一粒小米-博客  阅读(399)  评论(0编辑  收藏  举报