# 解决Docker时区问题 RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo'Asia/Shanghai' >/etc/timezone
USER jenkins # 解决时区问题 ENV JAVA_OPTS -Duser.timezone=Asia/Shanghai
USER root # 安装 docker-compose 因为等下构建环境的需要 RUN curl -L https://github.com/docker/compose/releases/download/1.21.1/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
RUNchmod +x /usr/local/bin/docker-compose
注:可能出现
1 2 3 4 5
[root@localhost Desktop]# curl -L https://github.com/docker/compose/releases/download/1.16.1/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 00000000 --:--:-- --:--:-- --:--:-- 0 curl: (35) Peer reports incompatible or unsupported protocol version.
[root@localhost Desktop]# docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 0c63f3ce79b5 auto-jenkins "/bin/tini -- /usr/l…"12 seconds ago Up 5 seconds 0.0.0.0:8080->8080/tcp, 0.0.0.0:50000->50000/tcp jenkins
概念:服务器并发处理能力的量化描述,单位是reqs/s,指的是某个并发用户数下单位时间内处理的请求数。某个并发用户数下单位时间内能处理的最大请求数,称之为最大吞吐率。 计算公式:总请求数 / 处理完成这些请求数所花费的时间,即 Request per second = Complete requests / Time taken for tests
并发连接数(The number of concurrent connections)
概念:某个时刻服务器所接受的请求数目,简单的讲,就是一个会话。
并发用户数(The number of concurrent users,Concurrency Level)
概念:要注意区分这个概念和并发连接数之间的区别,一个用户可能同时会产生多个会话,也即连接数。
用户平均请求等待时间(Time per request)
计算公式:处理完成所有请求数所花费的时间/ (总请求数 / 并发用户数),即 Time per request = Time taken for tests /( Complete requests / Concurrency Level)
服务器平均请求等待时间(Time per request: across all concurrent requests)
计算公式:处理完成所有请求数所花费的时间 / 总请求数,即 Time taken for / testsComplete requests 可以看到,它是吞吐率的倒数。 同时,它也=用户平均请求等待时间/并发用户数,即 Time per request / Concurrency Level
Server Software: Apache Server Hostname: baidu.com Server Port: 80
文档信息
所在位置“/”,文档的大小为338436 bytes(此为http响应的正文长度)
1 2
Document Path: / Document Length: 81 bytes
重要信息
1 2 3 4 5 6 7 8 9 10
Concurrency Level: 10 Time taken for tests: 2.584 seconds Complete requests: 100 Failed requests: 0 Total transferred: 38100 bytes HTML transferred: 8100 bytes Requests per second: 38.70 [#/sec] (mean) Time per request: 258.374 [ms] (mean) Time per request: 25.837 [ms] (mean, across all concurrent requests) Transfer rate: 14.40 [Kbytes/sec] received
Percentage of the requests served within a certain time (ms) 50% 217 66% 224 75% 246 80% 249 90% 595 95% 604 98% 609 99% 609 100% 609 (longest request)
我们只需要填写3个地方:1. host name 2.user name 3.password。hostname是虚拟机的IP地址。 最好是填写root用户时的用户名和密码。点击登陆就进入到Linux系统了 界面中,左边属于windows操作系统的目录,右边属于Linux(CentOS)操作系统的目录。可以用鼠标直接把文件拖过来拖过去的。
[root@localhost /]# cd /etc/nginx #定位到nginx安装目录 [root@localhost nginx]# vim nginx.conf #通过vim打开nginx.conf配置文件进行配置
在http节点中,添加配置
1 2 3 4 5 6 7
#设定负载均衡的服务器列表 upstream load_balance_server { #weigth参数表示权值,权值越高被分配到的几率越大 server 192.168.1.131:5100 weight=5; server 192.168.1.132:5100 weight=1; server 192.168.1.130:5100 weight=6; }
[root@localhost nginx]# service nginx restart Redirecting to /bin/systemctl restart nginx.service Job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journalctl -xe"for details. [root@localhost nginx]# systemctl status nginx -l ● nginx.service - The nginx HTTP and reverse proxy server Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor preset: disabled) Active: failed (Result: exit-code) since Thu 2017-05-18 09:34:41 CST; 6s ago Process: 121270 ExecStartPre=/usr/sbin/nginx -t (code=exited, status=1/FAILURE) Process: 121265 ExecStartPre=/usr/bin/rm -f /run/nginx.pid (code=exited, status=0/SUCCESS) Main PID: 117382 (code=exited, status=0/SUCCESS)
May 18 09:34:41 localhost.localdomain systemd[1]: Starting The nginx HTTP and reverse proxy server... May 18 09:34:41 localhost.localdomain nginx[121270]: nginx: the configuration file /etc/nginx/nginx.conf syntax is ok May 18 09:34:41 localhost.localdomain nginx[121270]: nginx: [emerg] bind() to 0.0.0.0:5100 failed (13: Permission denied) May 18 09:34:41 localhost.localdomain nginx[121270]: nginx: configuration file /etc/nginx/nginx.conf test failed May 18 09:34:41 localhost.localdomain systemd[1]: nginx.service: control process exited, code=exited status=1 May 18 09:34:41 localhost.localdomain systemd[1]: Failed to start The nginx HTTP and reverse proxy server. May 18 09:34:41 localhost.localdomain systemd[1]: Unit nginx.service entered failed state. May 18 09:34:41 localhost.localdomain systemd[1]: nginx.service failed.
[toor@localhost bin]$ netstat -tunpl | grep 6379 (Not all processes could be identified, non-owned process info will not be shown, you would have to be root to see it all.) tcp 0 0 127.0.0.1:6379 0.0.0.0:* LISTEN - [toor@localhost bin]$ sudo netstat -tunpl | grep 6379 [sudo] password for toor: toor is not in the sudoers file. This incident will be reported. [toor@localhost bin]$ su root Password: [root@localhost bin]# netstat -tunpl | grep 6379 tcp 0 0 127.0.0.1:6379 0.0.0.0:* LISTEN 101598/./redis-serv
[root@localhost bin]# pkill redis-server [root@localhost bin]# netstat -tunpl | grep 6379 [root@localhost bin]# pstree -p | grep redis [root@localhost bin]# redis-cli Could not connect to Redis at 127.0.0.1:6379: Connection refused Could not connect to Redis at 127.0.0.1:6379: Connection refused not connected>