Bash Shell只支持一维数组(不支持多维数组),初始化时不需要定义数组大小(与PHP类似)。与大部分编程语言类似,数组元素的下标由0开始。Shell数组用括号来表示,元素用
空格
符号分割开。
一、基础
二、使用
自己写代码做压测
使用Jmeter等工具做压测
使用官方工具rally(网上大部分的文章都是几年前的,最新的rally已经不支持比如configure命令了)
安装
pip3 install esrally
esrally -h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31usage: esrally [-h] [--version]
{race,list,info,create-track,generate,compare,download,install,start,stop}
...
____ ____
/ __ \____ _/ / /_ __
/ /_/ / __ `/ / / / / /
/ _, _/ /_/ / / / /_/ /
/_/ |_|\__,_/_/_/\__, /
/____/
You Know, for Benchmarking Elasticsearch.
optional arguments:
-h, --help show this help message and exit
--version show program's version number and exit
subcommands:
{race,list,info,create-track,generate,compare,download,install,start,stop}
race Run a benchmark
list List configuration options
info Show info about a track
create-track Create a Rally track from existing data
generate Generate artifacts
compare Compare two races
download Downloads an artifact
install Installs an Elasticsearch node locally
start Starts an Elasticsearch node locally
stop Stops an Elasticsearch node locally
Find out more about Rally at https://esrally.readthedocs.io/en/2.3.0/查看版本
esrally --version
,博主最新的esrally 2.3.0
- 配置java环境变量
esrally configure
,对于最新版本的rally已经不支持了 - 指定es版本
esrally --distribution-version=5.0.0
,也不支持了
- 配置java环境变量
根据官方仓库README来操作,或官方博客
esrally race --distribution-version=6.5.3 --track=geonames
,报错1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25____ ____
/ __ \____ _/ / /_ __
/ /_/ / __ `/ / / / / /
/ _, _/ /_/ / / / /_/ /
/_/ |_|\__,_/_/_/\__, /
/____/
[WARNING] No Internet connection detected. Automatic download of track data sets etc. is disabled.
[INFO] Race id is [52257024-97e9-49bb-94f4-dafd8a1dfe0f]
[ERROR] Cannot race. Traceback (most recent call last):
...
...
...
Please run:
git -C /Users/liuyulong/.rally/benchmarks/tracks/default init
Getting further help:
*********************
* Check the log files in /Users/liuyulong/.rally/logs for errors.
* Read the documentation at https://esrally.readthedocs.io/en/2.3.0/.
* Ask a question on the forum at https://discuss.elastic.co/tags/c/elastic-stack/elasticsearch/rally.
* Raise an issue at https://github.com/elastic/rally/issues and include the log files in /Users/liuyulong/.rally/logs.
--------------------------------
[INFO] FAILURE (took 15 seconds)
手动下载资源
- cd ~/.rally/benchmarks
- git clone https://github.com/elastic/rally-tracks.git
- cd tracks
- rm -rf default
- cd ..
- cp -r rally-tracks ./tracks/
- mv rally-tracks default
sudo esrally list tracks
1 | ____ ____ |
sudo esrally --distribution-version=6.0.0 --track=geopoint
cd .rally/benchmarks
git clone https://github.com/elastic/rally-teams.git
mkdir teams
cp -r rally-teams ./teams/
mv rally-teams default
- 重试
sudo esrally --distribution-version=6.0.0 --track=geopoint