Linux 常用命令笔记-2
注意事项:
沟通项目需求:
1.项目背景和目的
哪个团队、项目Wiki?
数据库登陆:mysql -uroot -pabc@0326 -h127.0.0.1 -P4004 -A
set names utf8;
SELECT count(*) FROM `g_map` WHERE ((status = 1 or status = 3) and name like 'zhong中%');
SELECT count(*) FROM `g_map` WHERE ((status = 1 or status = 3) and name='中');
SELECT `id`, `area`, `product_type`, `airport`, `type`, `source`, `name`, `status`, `send_status`, `online_status`, `admin_user_id`, `create_time`, `update_time`, `validate_time`, `admin_user_en`, `admin_user_cn`, `is_admin`, `is_parent`, `dead_line`, `canonical_country_code` FROM `g_map` WHERE ((status = 1 or status = 3) and name like '中%') ORDER BY id DESC LIMIT 4;
1. 登陆服务器:
ssh -p 35000 -o StrictHostKeyChecking=no -o ServerAliveInterval=60 whywanghaiyang@gzrelay.sys.dayunmotuo.com
dssh hostname
sudo -iu username
2. 下载线上文件:
> 下载文件到跳板机器
dscp whywanghaiyang@hostname:/home/log.wf.2018121916 ./
python -m SimpleHTTPServer 8100
> 在跳板机上启动HTTP服务
python -m SimpleHTTPServer 8100
3. 查询文件中关键字条数
grep key log.info | wc -l9655
4. 查看机器启动时间:
date -d "$(awk -F. '{print $1}' /proc/uptime) second ago" +"%Y-%m-%d %H:%M:%S"
2. 查询进程:
ps -aux | grep nginx | grep -v apache // 抓去nginx关键子,过滤掉包含apache关键字的条目
kill -9 nginx //直杀进程
5.
ifind -b hostname
ifind -t clustername
irun -c 'egrep 703687549066689 /home/log/log.error' | egrep -v Warning
irun -c 'egrep 703687549066689 /home/log/log.log' | egrep -v Warning
3. Redis 查询Geofence-updater key
hget key_601 207601
hgetall key_601
hval key_601 207601
4.
netstat -lntup |grep geofen
export GOPATH=/home//app/namespace
export GOROOT=/usr/local/go
ps -ef |grep name
pwdx 37830
netsta -atl | grep 8081
nc -l ip:port > a.txt
5. 测试工具
wrk -t8 -c200 -d30s --latency "http://www.bing.com"
6. 配置Gitlab的SSH
ssh-keygen -t rsa -C 'xxx@xxx.com'
复制内容:~/.ssh/id_rsa.pub
git更新单个文件:
git fetch
git checkout origin/master -- path/to/file
g
groupadd hadoop
useradd -d /home/hadoop -m hadoop -g hadoop
passwd hadoop
find /home -name filename
8. 查Linux版本
cat /etc/issue
7. 端口占用
Linux如何查看端口
1、lsof -i:端口号 用于查看某一端口的占用情况
2. netstat -tunlp |grep 端口号
SELECT `id`, `area`, `product_type`, `airport`, `type`, `source`, `name`, `status`, `send_status`, `online_status`, `admin_user_id`, `create_time`, `update_time`, `validate_time`, `admin_user_en`, `admin_user_cn`, `is_admin`, `is_parent`, `dead_line`, `canonical_country_code` FROM `table_name` WHERE `id`=? LIMIT 1 []interface {}{246023}
UPDATE `table_name` SET `area` = ?, `product_type` = ?, `type` = ?, `source` = ?, `name` = ?, `status` = ?, `send_status` = ?, `online_status` = ?, `admin_user_en` = ?, `admin_user_cn` = ?, `dead_line` = ?, `update_time` = ? WHERE (id = ?) []interface {}{41, 106, 116, 1, "城0719_3eebbc244be40c876afefe87da271df9", 1, 2, 1, "wangyajuanjessy", "王雅娟", "2019-06-10 18:08:06", "2018-12-11 16:36:21", 246023}
DELETE FROM `table_anme` WHERE (map_id = ?) []interface {}{246023}
BEGIN TRANSACTION
BEGIN TRANSACTION
INSERT INTO `table_name` (`map_id`, `map_item`, `name`, `center`, `radius`, `fence_type`, `administrative`, `create_time`, `update_time`, `canonical_country_code`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) []interface {}{246023, "[\"111.509439,40.784006\",\"111.515619,40.774127\",\"111.589090,40.788685\",\"111.621363,40.757485\",\"111.644708,40.746561\",\"111.687280,40.740839\",\"111.733286,40.753324\",\"111.742899,40.785565\",\"111.776544,40.803759\",\"111.794397,40.832859\",\"111.844522,40.856753\",\"111.889154,40.913857\",\"111.891901,40.935647\",\"111.871301,40.936165\",\"111.789591,40.893098\",\"111.725733,40.894655\",\"111.685221,40.888426\",\"111.626856,40.881158\",\"111.611063,40.871293\",\"111.608316,40.853637\",\"111.571237,40.835457\"]", "poly-item-1", "", 0, 1, 0, "2018-12-11 16:36:21", "2018-12-11 16:36:21", ""}
COMMIT
SELECT `id`, `map_id`, `map_item`, `name`, `center`, `radius`, `fence_type`, `administrative`, `create_time`, `update_time`, `canonical_country_code` FROM `table_name` WHERE (map_id = ?) []interface {}{246023}
ROLL BACK
### 压力测试
siege -c20 -r2 -H "Cache-Control: no-cache" -H "Postman-Token: c6eda32d-1f30-775f-6796-95383011bacc" -H "Content-Type: application/x-www-form-urlencoded" -d 'coords=39.8845,116.3256,40.8845,117.3256&token=3CF4BA9BDC761BA0&logid=1234567' "http://100.69.93.36:7081/fenceservice/infence"
Elasticsearch
集群如何启动:
ZenDiscovery 多数选主算法
lucen 倒排索引
mainconfig.GetMainConfig().UPM.Url + "/user/get/info?"
url = url + GetUpmParams() + "&userName=" + userName + "&withDefaultGrant=1"
appid=1802
appkey=eea2596baa8eb356f4db54ce990681de
url=http://100.69.238.12:8000/sec/upmapi
http://100.69.238.102:8000/sec/upmapi/user/get/info?appId=1802&appKey=eea2596baa8eb356f4db54ce990681de&time=1545196498&sign=d5cf954721e2392d392d1b56899baef7&userName=nimei&withDefaultGrant=1
egrep -o '\btoken:\S*\b' geofence-updater.log.wf | sort |uniq -c
egrep -o 'role=[0-9]+' | sort | uniq -c
Linux 常用命令笔记-2的更多相关文章
- Linux 常用命令笔记
Linux 常用命令笔记 1. locate locate:用来定位文件的位置,如:locate a.txt 但是这个命令有延迟,也就是新建的文件不一定能搜索到,如果非要找到新建的文件可以使用 upd ...
- Linux常用命令 笔记
Linux常用命令 笔记 一.文件处理命令 1. ls命令:显示目录文件 -a 显示所有文件,包括隐藏文件.(all) ...
- Windows&Linux常用命令笔记
目录 linux windows Linux: 1.查找文件 find / -name filename.txt 根据名称查找/目录下的filename.txt文件. find . -name &qu ...
- Linux常用命令笔记一
笔记1:查看ubuntu是32位还是64位的方法及其版本号 查看ubuntu是64还是32的命令如下: uname -m 如果是i386到i686,那就是32位系统:如果是x86_64 ,那就是64系 ...
- Linux常用命令笔记总结(待补充)
问题实际场景:遇到告警磁盘利用率不足,检查根目录下各文件大小 Linux查看磁盘利用率 df –h 查找磁盘占用情况 find / -size +100M 从根目录往下找大于100M大小的文件 du ...
- Linux 常用命令笔记 (持续更新)
声明:本文是转载前辈的,地址:http://www.cnblogs.com/tovep/articles/2473147.html 在tomcat的bin目录下执行 ./shutdown.sh 为了查 ...
- linux 常用 命令 笔记二
wget 下载,得到网络上的内容 grep 文件搜索工具 EveryThing is a file in the linux system 安装 cowsay sudo apt-get install ...
- Linux常用命令笔记
~ 我的home目录/ 系统根目录进入home目录:cd \进入跟目录:cd /Maven编译:mvn clean deploy -U -Dmaven.test.skip=true dependenc ...
- 《精通Linux C编程》1.3Linux系统的常用命令-笔记
[toc] 1.3.1了解Shell Linux常用命令的运行环境就是Shell,它是一种命令解析器,在用户和操作系统之间提供了一个交互接口. 用户在命令行输入命令,然后Shell对该命令进行解析并将 ...
随机推荐
- C语言实现过滤ASCII在0~127范围内的字符,并去除重复的字符
#include <stdio.h> #include <string.h> /* 1.以字符串作为参数 2.找出ASCII在1~127范围内的字符 3.去掉重复字符 */ i ...
- (03) spring Boot 的配置
1. spring boot 的核心配置 spring boot 项目建立之后,已经创建好了application.properties 配置文件 其实, 配置文件还支持*.yml 格式的: 2. 多 ...
- mongodb数据库操作方法
// Schema.Model.Entity或者Documents的关系请牢记,Schema生成Model,Model创造Entity,Model和Entity都可对数据库操作造成影响,但Model比 ...
- 【技巧】EasyUI分页组件pagination显示项控制
我们使用easyui分页时,分页组件显示项有很多,默认如下是这样的: 有时候我们并不想显示这么多控制项,我们可以通过属性来控制:如下来自EasyUI官网: 如下写法,在datagrid中使用,如下控制 ...
- 后端程序员必会常用Linux命令总结
1. 调整终端窗口大小: ctrl + '-' 缩小, ctrl + shift + '=' 放大. 2. command --help 查询命令详细 或者 man command 3.ls命令, ...
- openssl 检测链路完整
D:\openssl\bin>openssl s_client -connect www.xxxx.com:443
- 记一次用express手写博客
1.req.session时一直是undefined 解决方法: // sesssion应用的配置 app.use(session({ secret:'blog', cookie: ('name', ...
- Windows浏览器无法连接VM虚拟机Centos并打开nginx页面
装的是centos6.7minimal版本,搜了下,需要关闭防火墙 于是 yum install iptables 然后关闭防火墙 service iptables stop 再打开浏览器,成功进入页 ...
- Linux VPS自动定时备份网站文件和MYSQL数据库到FTP空间(LNMP)
如果我们网站更新不是很频繁,我们可以定期手动进行备份网站文件和MYSQL数据库导出.如果我们网站数据更新频繁,且数据尤为重要,建议要采用定期自动 备份,至少需要多备份数据,无论我们选择何种优秀的VPS ...
- Spark在StandAlone模式下提交任务,spark.rpc.message.maxSize太小而出错
1.错误信息org.apache.spark.SparkException: Job aborted due to stage failure:Serialized task 32:5 was 172 ...