• mac使用Homebrew安装开发工具 lcl


      Homebrew 安装

    /usr/bin/ruby -e "$(curl -fsSL https://cdn.jsdelivr.net/gh/ineo6/homebrew-install/install)"

    一、安装OpenResty

      安装并设置环境变量

    brew install openresty/brew/openresty
    export PATH=/usr/local/Cellar/openresty/1.19.9.1_2/nginx/sbin/:$PATH
    nginx -v
    mkdir -p devtools/nginx/seckillproject/conf
    mkdir -p devtools/nginx/seckillproject/logs
    cd devtools/nginx/seckillproject

      配置文件内容

      在conf目录中创建nginx.conf文件

    vi conf/nginx.conf
    

      添加配置

    worker_processes  1;
    error_log logs/error.log;
    events {
        worker_connections 1024;
    }
    http {
        server {
            listen 8080;
            location / {
                default_type text/html;
                content_by_lua_block {
                    ngx.say("<p>hello, world</p>")
                }
            }
        }
    }

    验证:启动nginx后,访问localhost:8080,可以访问即可。

    # 启动
    nginx -p `pwd`/ -c conf/nginx.conf
    # 查看 ps
    -ef|grep nginx
    # 停止 nginx
    -p pwd -s stop

          

    二、安装MySQL

      安装并设置环境变量

    brew install mysql@5.7
    export PATH=/usr/local/opt/mysql@5.7/bin:$PATH

      验证

    mysql.server start
    mysql_secure_installation
    mysql -uroot -p
    show databases;
    mysql.server stop

    三、安装redis

      安装并验证

    brew install redis
    /usr/local/opt/redis/bin/redis-server /usr/local/etc/redis.conf
    ##另起一个窗口,使用客户端验证
    redis-cli -h 127.0.0.1 -p 6379

     四、安装Nginx

    # 安装
    brew install nginx
    # 启动
    brew services start nginx
    # 停止
    brew services stop nginx
    #重启nginx
    brew services restart nginx
    #重新加载配置文件
    nginx -s reload
    #验证nginx配置文件是否正确
    nginx -t
    #配置文件位置
    /usr/local/etc/nginx/nginx.conf

     五、安装 jenv 管理多版本JDK

      1、安装jenv

    mkdir -p ~/.jenv/versions
    brew install jenv
    echo 'export PATH="$HOME/.jenv/bin:$PATH"' >> ~/.bash_profile
    echo 'eval "$(jenv init -)"' >> ~/.bash_profile

      2、将多版本JDK绑定到jenv

    jenv add /Library/Java/JavaVirtualMachines/jdk-11.0.15.jdk/Contents/Home
    jenv add /Library/Java/JavaVirtualMachines/jdk1.8.0_301.jdk/Contents/Home

      3、查看当前试用版本(*号标记的为当前版本)

    #  jenv versions
    * system (set by /Users/conglongli/.jenv/version)
      1.8
      1.8.0.301
      11
      11.0
      11.0.15
      oracle64-1.8.0.301
      oracle64-11.0.15

      4、切换版本

    #  jenv local 1.8.0.301
    #  jenv versions
      system
      1.8
    * 1.8.0.301 (set by /Users/conglongli/.java-version)
      11
      11.0
      11.0.15
      oracle64-1.8.0.301
      oracle64-11.0.15

      5、移除不需要的版本

    #  jenv remove 11.0
    JDK 11.0 removed

     六、安装wrk

    brew install wrk
    # 使用12个线程,创建400个连接,对baidu首页进行了30秒的压测,并要求在压测结果中输出响应延迟信息
    conglongli@bogon ~ % wrk -t12 -c400 -d30s --latency http://www.baidu.com
    
    Running 30s test @ http://www.baidu.com
      12 threads and 400 connections
      Thread Stats   Avg      Stdev     Max   +/- Stdev
        Latency   145.30ms  210.57ms   1.99s    91.11%
        Req/Sec   129.81     81.56   535.00     73.20%
      Latency Distribution
         50%   64.59ms
         75%  138.06ms
         90%  338.89ms
         99%    1.05s
      20700 requests in 30.11s, 207.19MB read
      Socket errors: connect 158, read 14665, write 0, timeout 47
    Requests/sec:    687.56
    Transfer/sec:      6.88MB
  • 相关阅读:
    小甲鱼与客服的对话,代码与解析
    (role,line_spoken) = each_line.split(':',2) 小甲鱼python 一个任务
    python open() 方法 No such file or directory: 应该怎么解决
    并发编程
    并发编程
    并发编程
    并发编程
    并发编程
    并发编程
    并发编程
  • 原文地址:https://www.cnblogs.com/liconglong/p/16084855.html
Copyright © 2020-2023  润新知