分类 未分类 下的文章

redis cluster遇到的问题

在做redis集群的时候遇到了一些问题:
1:(error) CLUSTERDOWN The cluster is down
确保其它节点正常工作
2:connection refused 和Could not get a resource from the pool
单节点链接没问题,集群的时候链接就不行了,通过外面IP单独访问端口都是通的,核心现象是集群通过外网IP访问就会报错,无奈最后放弃,直接通过局域网的IP访问才可以使用,也就是说集群在局域网没问题,目前这个问题待解决。

aws常见问题

1:账号资源达到最大限制
例如Your AWS account is pending verification. Sorry, you've reached your current Lightsail resource maximum limit of Instance : 0
解决方法:
提交case,解除最大限制 ,大多数服务限制可通过 AWS 支持中心(https://console.aws.amazon.com/support/home)申请,方法是选择 Create Case(创建案例),再选择 Service Limit Increase(提高服务限制)

2:aws lightsail不允许ping
其实是可以,networking>firewall: Allow TCP+UDP 0-65535

利用iperf测试服务器之间的网络带宽

1:下载安装(以ubuntu为例)

sudo wget -O /usr/lib/libiperf.so.0 https://iperf.fr/download/ubuntu/libiperf.so.0_3.1.3
sudo wget -O /usr/bin/iperf3 https://iperf.fr/download/ubuntu/iperf3_3.1.3
sudo chmod +x /usr/bin/iperf3

2:测试
A服务器执行(内网IP为172.26.22.201)
iperf3 -s
B服务器上执行
iperf3 -s 172.26.22.201
结果为:

Connecting to host 172.26.22.201, port 5201
[  4] local 172.26.29.32 port 53560 connected to 172.26.22.201 port 5201
[ ID] Interval           Transfer     Bandwidth       Retr  Cwnd
[  4]   0.00-1.00   sec   117 MBytes   984 Mbits/sec   42    454 KBytes       
[  4]   1.00-2.00   sec   112 MBytes   939 Mbits/sec   34    315 KBytes       
[  4]   2.00-3.00   sec   115 MBytes   965 Mbits/sec   38    437 KBytes       
[  4]   3.00-4.00   sec   111 MBytes   931 Mbits/sec   28    341 KBytes       
[  4]   4.00-5.00   sec   115 MBytes   965 Mbits/sec   36    332 KBytes       
[  4]   5.00-6.00   sec   114 MBytes   960 Mbits/sec   29    428 KBytes       
[  4]   6.00-7.00   sec   115 MBytes   963 Mbits/sec   38    385 KBytes       
[  4]   7.00-8.00   sec   115 MBytes   963 Mbits/sec   39    358 KBytes       
[  4]   8.00-9.00   sec   113 MBytes   950 Mbits/sec   38    306 KBytes       
[  4]   9.00-10.00  sec   115 MBytes   966 Mbits/sec   37    393 KBytes       
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bandwidth       Retr
[  4]   0.00-10.00  sec  1.12 GBytes   959 Mbits/sec  359             sender
[  4]   0.00-10.00  sec  1.11 GBytes   957 Mbits/sec                  receiver

另外,如果用外网IP,速率会慢很多

参考:
https://iperf.fr/iperf-download.php

springboot常见问题

1:springboot定时任务不执行
原因可能为:
1)没添加@EnableScheduling或者定时任务类没添加@Component
2)定时任务类所在的package不对,不在启动类的的子包下

ELK常见问题

1:kibana无法外网访问
设置server.host = "0.0.0.0"
2:kibana7.x首次无法启动
Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'unsafe-eval' 'nonce-SK5LdJc4MkeDocgq'". Either the 'unsafe-inline' keyword, a hash ('sha256-SHHSeLc0bp6xt4BoVVyUy+3IbVqp3ujLaR+s+kSP5UI='), or a nonce ('nonce-...') is required to enable inline execution.
设置logging.verbose: true
重启后文件解决
2:elasticsearch7.x启动报错
修改了network.host为0.0.0.0怎么都启动不起来,到/var/log/elasticsearch/查看错误日志如下

the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must be configured

解决步骤如下:(以ubuntu16.04为例)

vi /etc/security/limits.conf
添加:
* soft nofile 65534
* hard nofile 65534
root soft nofile 65534
root hard nofile 65534
重启电脑
vi  /etc/sysctl.conf
vm.max_map_count=262144
保存退出,sysctl  -p  
修改elasticsearch.yml
cluster.initial_master_nodes: ["node-1"]
 curl -H "Content-Type: application/json" -XPUT localhost:9200/_settings -d '{ "index" : { "refresh_interval" : -1, "number_of_replicas" : 0 } }'

3:删除filebeat对文件的记录
/var/lib/filebeat/registry
删除这个里面的东西重启即可

相关讨论:https://discuss.elastic.co/t/problems-with-access-to-elasticsearch-form-outside-machine/172450

4:logstash进程杀不掉
initctl stop logstash