windows下安装 crul 以及windows下使用的注意事项
2016-09-02 14:01
806 查看
主要记录在windows下安装 crul 以及windows下使用的注意事项.
1. curl 下载:
http://www.paehl.com/open_source/?CURL_7.49.1
2. curl windows 下可视化工具下载
http://www.paehl.com/open_source/?CURL_7.49.1___GUI_for_CURL_0.1
如果是linux 下, 可以用类似的命令增加一条索引.
程序代码
curl -XPUT 'localhost:9200/mycompany/employee/1' -d '{"first_name":"John","last_name":"Smith","age":25,"about":"Ilovetogorockclimbing","interests":["sports","music"]}'
windows下,要这样做,注意引号. 否则会报错:
{"error":{"root_cause":[{"type":"mapper_parsing_exception","reason":"failed to parse"}],"type":"mapper_parsing_exception","reason":"failed
to parse","caused_by":{"type":"not_x_content_exception","reason":"Compressor detection can only be called on some xcontent bytes or compressed xcontent bytes"}},"status":400}
windows 正确的做法:
程序代码
curl -XPUT "localhost:9200/mycompany/employee/1" -d "{"""first_name""":"""John""","""last_name""":"""Smith""","""age""":25,"""about""":"""Ilovetogorockclimbing""","""interests""":["""sports""","""music"""]}"
程序代码
curl -XPUT "localhost:9200/mycompany/employee/2" -d "{"""first_name""":"""Jane""","""last_name""":"""Smith""","""age""":32,"""about""":"""Iliketocollectrockalbums""","""interests""":["""music"""]}"
程序代码
curl -XPUT "localhost:9200/mycompany/employee/3" -d "{"""first_name""":"""Douglas""","""last_name""":"""Fir""","""age""":35,"""about""":"""Iliketobuildcabinets""","""interests""":["""forestry"""]}"
尝试得到一个索引:
curl -XGET "localhost:9200/mycompany/employee/1"
返回如下内容:
{"_index":"mycompany","_type":"employee","_id":"1","_version":1,"found":true,"_source":{"first_name":"John","last_name":"Smith","age":25,"about":"Ilovetogorockclimbing","interests":["sports","music"]}}
Java client 操作时一定要先修改配置文件:
network.host: 192.168.10.29 或者修改为 0.0.0.0
这里是你机器的IP 地址,不要用localhost 或者 127.0.0.1, 否则很容易报错:
NoNodeAvailableException[None of the configured nodes are available
原文地址:http://www.yihaomen.com/article/java/630.htm
1. curl 下载:
http://www.paehl.com/open_source/?CURL_7.49.1
2. curl windows 下可视化工具下载
http://www.paehl.com/open_source/?CURL_7.49.1___GUI_for_CURL_0.1
如果是linux 下, 可以用类似的命令增加一条索引.
程序代码
curl -XPUT 'localhost:9200/mycompany/employee/1' -d '{"first_name":"John","last_name":"Smith","age":25,"about":"Ilovetogorockclimbing","interests":["sports","music"]}'
windows下,要这样做,注意引号. 否则会报错:
{"error":{"root_cause":[{"type":"mapper_parsing_exception","reason":"failed to parse"}],"type":"mapper_parsing_exception","reason":"failed
to parse","caused_by":{"type":"not_x_content_exception","reason":"Compressor detection can only be called on some xcontent bytes or compressed xcontent bytes"}},"status":400}
windows 正确的做法:
程序代码
curl -XPUT "localhost:9200/mycompany/employee/1" -d "{"""first_name""":"""John""","""last_name""":"""Smith""","""age""":25,"""about""":"""Ilovetogorockclimbing""","""interests""":["""sports""","""music"""]}"
程序代码
curl -XPUT "localhost:9200/mycompany/employee/2" -d "{"""first_name""":"""Jane""","""last_name""":"""Smith""","""age""":32,"""about""":"""Iliketocollectrockalbums""","""interests""":["""music"""]}"
程序代码
curl -XPUT "localhost:9200/mycompany/employee/3" -d "{"""first_name""":"""Douglas""","""last_name""":"""Fir""","""age""":35,"""about""":"""Iliketobuildcabinets""","""interests""":["""forestry"""]}"
尝试得到一个索引:
curl -XGET "localhost:9200/mycompany/employee/1"
返回如下内容:
{"_index":"mycompany","_type":"employee","_id":"1","_version":1,"found":true,"_source":{"first_name":"John","last_name":"Smith","age":25,"about":"Ilovetogorockclimbing","interests":["sports","music"]}}
Java client 操作时一定要先修改配置文件:
network.host: 192.168.10.29 或者修改为 0.0.0.0
这里是你机器的IP 地址,不要用localhost 或者 127.0.0.1, 否则很容易报错:
NoNodeAvailableException[None of the configured nodes are available
原文地址:http://www.yihaomen.com/article/java/630.htm
相关文章推荐
- mongodb在windows上安装以及注意事项
- windows下Redis的安装配置以及注意事项
- UEFI模式下,Windows 10专业版 和 Ubuntu 16.0.4 LTS双系统安装以及注意事项
- PHP环境搭建:Windows 7下安装配置PHP+Apache+Mysql环境教程以及注意事项
- CocoaPods安装和使用教程以及RVM、RuBy的安装配置以及注意事项
- MYSQL5.6数据库ZIP安装以及VS中使用注意事项
- InstallUtil在windows服务中的使用(转)+ 服务安装的注意事项
- 【caffe-Windows】微软官方caffe之matlab接口配置,以及安装caffe的注意事项
- 在服务器上安装、使用MySQL的注意事项
- 关于使用存储过程的一些好处以及注意事项[转]
- [Windows编程] 使用API函数GetProcAddress的注意事项
- 在服务器上安装、使用MySQL的注意事项
- 在服务器上安装、使用MySQL的注意事项
- windows下使用postgresql8.01的几个注意事项
- SWFupload使用注意事项以及附带页面变量
- [Windows编程] 使用API函数GetProcAddress的注意事项
- boost.python和python-dev的ubuntu 8.10下的安装,版本以及注意事项(7)
- 在服务器上安装、使用的注意事项(2)
- 在AIX操作系统上安装使用VIM的注意事项
- solaris工具的安装,使用和注意事项(gcc,gzip,make,nmap,wget)