> 文章列表 > 【命令大全】自己实际项目中使用到的一些命令总结

【命令大全】自己实际项目中使用到的一些命令总结

【命令大全】自己实际项目中使用到的一些命令总结

  1. docker命令
    进入docker容器:docker exec -it xxx(docker name) bash
    docker重启:docker restart xxx(docker name)
    查看docker详情:runlike xxx(docker name)
    创建docker容器:docker run --name=converterScript --env=TZ=Asia/Shanghai --volume=/etc/localtime:/etc/localtime --volume=/data/converterScript/app:/app --volume=/data/converterScript/etc/hosts:/etc/hosts --volume=/logsScript:/logs --expose=8010 --expose=8011 -p 8082:8081 --restart=no --runtime=runc --detach=true -t boss:v1 java -jar /app/app.jar

  2. Python命令:
    安装Python包:pip3 install xxx
    启动Python程序:nohup python3 app_start.py > nohup.log 2>&1 &
    导出三方依赖到requirements.txt:pipreqs ./ --encoding=utf-8
    安装requirements.txt中的包:pip3 install -r requirements.txt -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host=mirrors.aliyun.com --upgrade

  3. 安装Java环境:
    安装jdk8:sudo yum install java-1.8.0-openjdk* -y

  4. clickhouse命令:
    打开clickhouse客户端:clickhouse-client --user=用户名 --password=密码
    从远程server复制数据到本地:insert into 表名 select * from remote(‘192.168.1.2:9000’,库名,表名,‘用户名’,'密码) where 条件;
    查看clickhouse后台运行任务SQL:
    SELECT database,table,command,create_time,is_done FROM system.mutations where is_done = 0 and command like ‘SELECT%’;
    删除后台运行任务SQL:KILL MUTATION WHERE database = ‘库名’ AND table = ‘表名’;
    clickhouse删除数据:alter table 表名 delete where 条件;
    重启clickhouse:systemctl restart clickhouse-server.service

  5. 查看io:
    监控磁盘io命令:iostat -x 1

  6. JVM:
    查看jvm内存对象占用内存大小和对象个数:jmap -histo 进程ID
    查看jvm线程运行状态:jstack -F 进程ID

  7. C++:
    cmake …
    cmake … -DCMAKE_BUILD_TYPE=Realse
    make
    make install
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:…/lib:/usr/local/lib/third_party:/usr/local/lib/
    ./algoservice -f …/config/dump.xml
    nohup ./algoservice -f …/config/dump_test.xml &

  8. 系统定时任务:
    0 8 * * 1-5 cd /opt/converter/app && ./restartConverter.sh
    0 17 * * 1-5 docker restart converter