Exception in thread “main” NoNodeAvailableException[None of the configured nodes are available: [{#t

Java elasticsearch client 连接ES数据库出现exception 解决办法。 Settings settings = Settings.settingsBuilder().put(“cluster.name”, “elasticsearch”).build(); client = TransportClient.builder().settings(settings).build().addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName(“121.196.223.77″), 9300)); settings设置cluster.name cluster.name的值在“集群节点信息”中   “name”: “5e4e4316ad5c-elasticsearch-elasticsearch-1”, “transport_address”: “192.168.1.122:9300”, “host”: “192.168.1.122”, “ip”: “192.168.1.122”, “version”: “2.3.5”, “build”: “90f439f”, “http_address”: “192.168.1.122:9200”, “settings”: { “cluster”: { “name”: “elasticsearch”     //这个值 }, “node”: { “name”: “5e4e4316ad5c-elasticsearch-elasticsearch-1” }, “path”: { “logs”: “/usr/share/elasticsearch/logs”, “home”: “/usr/share/elasticsearch” }, “name”: “5e4e4316ad5c-elasticsearch-elasticsearch-1”, “client”: { “type”: “node” }, “index”: { “analysis”: {  

usb install centOS

reference:http://www.linuxidc.com/Linux/2014-10/108014.htm 第三步,修改为 3.更改bios启动顺序(即U盘先启动),然后进入此界面,按下tab键,将 vmlinuz initrd=initrd.img inst.stage2=hd:LABEL=CentOS\x207\x20x86_64 rd.live.check quiet 改为: vmlinuz initrd=initrd.img inst.stage2=hd:/dev/sdb1:/ quiet 注意 sdb1是某一个usb接口。(不确定是哪一个)

mvn package failed

mvn package 报错 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (default-test) on project merge: There are test failures. 意思是打包时跑默认test模块,test测试没通过,所以不给继续打包。 解决方法: 跳过测试阶段: mvn package -DskipTests 临时性跳过测试代码的编译: mvn package -Dmaven.test.skip=true maven.test.skip同时控制maven-compiler-plugin和maven-surefire-plugin两个插件的行为,即跳过编译,又跳过测试。 指定测试类 mvn test -Dtest=RandomGeneratorTest 以Random开头,Test结尾的测试类 mvn test -Dtest=Random*Test 用逗号分隔指定多个测试用例 mvn test -Dtest=ATest,BTest 指定即使没有任何测试用例也不要报错 test参数必须匹配至少一个测试类,否则会报错并导致构建失败。此时可使用以下配置来指定即使没有任何测试用例也不要报错。 mvn test -Dtest -DfailIfNoTests = false POM文件配置包含与排除测试用例 使用** / * Test.Java 来匹配所有以Tests结尾的Java类。两个星号**用来匹配任意路径,一个星号*用来获取除路径风格符外的0个或多个字符。还可使用excludes来排除一些测试类。 <plugin>…

post请求重复两次一次options一次post 解决

使用了360网站安全检测 查到有OPTIONS方法 百度了下 https://my.oschina.net/maliang0130/blog/338725 找到这个方法奈何http.conf 找不到无论在tomcat目录里还是linux路径下的/usr/etc或者apache2 最后通过开源中国找到 第一步:修改应用程序的web.xml文件的协议 <?xml version=”1.0″ encoding=”UTF-8″?> <web-app xmlns=”http://java.sun.com/xml/ns/j2ee” xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:schemaLocation=”http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd” version=”2.4″> 第二步:在应用程序的web.xml中添加如下的代码即可 <security-constraint> <web-resource-collection> <url-pattern>/*</url-pattern> <http-method>PUT</http-method> <http-method>DELETE</http-method> <http-method>HEAD</http-method> <http-method>OPTIONS</http-method> <http-method>TRACE</http-method> </web-resource-collection> <auth-constraint> </auth-constraint> </security-constraint> <login-config> <auth-method>BASIC</auth-method> </login-config> 重新部署程序,重启tomcat即可完成 如果用户要验证既可以将POST和GET也添加在其中,重新部署并启动tomcat即可看到效果 以上的代码添加到某一个应用中,也可以添加到tomcat的web.xml中,区别是添加到某一个应用只对某一个应用有效如果添加到tomcat的web.xml中,则对tomcat下所有的应用有效。 <security-constraint>      <web-resource-collection>         <url-pattern>/*</url-pattern>         <http-method>PUT</http-method>   <http-method>DELETE</http-method>   <http-method>HEAD</http-method>   <http-method>OPTIONS</http-method>   <http-method>TRACE</http-method>      </web-resource-collection>      <auth-constraint>      </auth-constraint>    </security-constraint>    <login-config>      <auth-method>BASIC</auth-method>    </login-config>

flume install on windows

reference:http://blog.csdn.net/u012107143/article/details/72638628 创建配置文件:在解压后的文件apache-flume-1.6.0-bin/conf下创建一个example.conf,内容如下。 # example.conf: A single-node Flume configuration # Name the components on this agent a1.sources = r1 a1.sinks = k1 a1.channels = c1 # Describe/configure the source a1.sources.r1.type = netcat a1.sources.r1.bind = localhost a1.sources.r1.port = 44444 # Describe the sink a1.sinks.k1.type = logger # Use a channel which buffers events in memory a1.channels.c1.type =…

big data errors list

大数据常见错误解决方案(转载) 1、用./bin/spark-shell启动spark时遇到异常:java.net.BindException: Can’t assign requested address: Service ‘sparkDriver’ failed after 16 retries! 解决方法:add export SPARK_LOCAL_IP=”127.0.0.1″ to spark-env.sh 2、java Kafka producer error:ERROR kafka.utils.Utils$ – fetching topic metadata for topics [Set(words_topic)] from broker [ArrayBuffer(id:0,host: xxxxxx,port:9092)] failed 解决方法:Set ‘advertised.host.name’ on server.properties of Kafka broker to server’s realIP(same to producer’s ‘metadata.broker.list’ property) 3、java.net.NoRouteToHostException: No route to host 解决方法:zookeeper的IP要配对 4、Fatal…

change domain for wordpress when old domain expired

修改wp-config.php(自动更新地址)   1、在wp-config.php中,添加下面一行内容: define(‘RELOCATE’,true);   2、登录后台地址,WP将自动更新安装地址(SITEURL),手动修改博客地址(HOME)地址即可,成功后一定记得删除上面添加的内容。

git commit content to remote

git status      //check details changed git add .       git add  file1 file2 //add files which you want to be commit git commit -m “comment” git status git push