Linux常用命令
top
free
java -jar admin.jar --spring.profiles.active=dev
netstat -tunlp|grep 8091
kill -9 5204
cat startup.sh
vim deploy.sh
ps -ef | grep /opt/prd/admin/boxlife_admin.jar
有防火墙问题
docker exec -it redis-master bash
top
/marvel/deploy/
开启端口号:
iptables -I INPUT -p tcp --dport 22 -j ACCEPT
docker-compose down 关闭服务
rm -rf da* 删除数据
docker rmi de25a81a5a0b 移除镜像
docker-compose up -d 下载启动
tail -1000f logs/user_2019-12-12.log
./one_deploy.sh marvel-service-user ybsh
tail -10000f eureka_2019-12-12.log
chmod +x one_deploy.sh
curl -L https://github.com/docker/compose/releases/download/1.22.0/docker-compose-uname -s
-uname -m
> /usr/local/bin/docker-compose
vi docker-compose.yml
docker-compose up -d
docker-compose up -d --build
chmod +x /usr/local/bin/docker-compose
cd /marvel/local/docker/sentinel/
vi sentinel3.conf
cd redis/
cd /marvel/local/docker/redis/
tail -1000f logs/zuul_2019-12-12.log
ps -ef | grep jar
./one_deploy.sh marvel-zuul ybsh
netstat -aptn
lsof -i:80
ps -ef | grep 443
ps -ef | grep 80
./one_deploy.sh marvel-zuul ybsh
tail -1000f config_2019-12-12.log
./one_deploy.sh marvel-config ybsh
vi one_deploy.sh
./one_deploy.sh marvel-zuul
export LANG="en_US.UTF-8";export LANGUAGE="en_US.UTF-8";top
iptables -A OUTPUT -p tcp --dport 26379 -j DROP
iptables -A OUTPUT -p tcp --dport 6379 -j DROP
cd /marvel/local/docker/redis/
/etc/init.d/redis-server stop
cd /etc/init.d/
ps -ef | grep 6379
kill -HUP 1887
ps ajx | grep "/usr/bin/redis-server" | grep -v "grep" |awk '{print $2}'
./src/redis-cli shutdown
杀死进程 kill -9 1637
kill -9 861
docker network create redis_sentinel-master-ybsh
cd ../sentinel/
cd /marvel/local/docker/redis
eureka 9001
./one_deploy.sh marvel-eureka ybsh
tail -1000f logs/eureka_2019-12-13.log
config
./one_deploy.sh marvel-config ybsh
tail -1000f logs/config_2019-12-13.log
lcn
./one_deploy.sh marvel-lcn-manager ybsh
tail -1000f logs/lcn_2019-12-13.log
zuul
./one_deploy.sh marvel-zuul ybsh
tail -1000f logs/zuul_2019-12-13.log
redis 没有启动 所有的哨兵躺下啦// 所有哨兵都被击落,无法确定我的主机ybsh主机在哪里运行。
./one_deploy.sh marvel-service-redis ybsh
tail -1000f logs/redis_2019-12-13.log
citymaster
./one_deploy.sh marvel-service-citymaster ybsh
tail -1000f logs/citymaster_2019-12-13.log
notice
./one_deploy.sh marvel-service-notice ybsh
tail -1000f logs/notice_2019-12-13.log
facade 9040
./one_deploy.sh marvel-facade ybsh
tail -1000f logs/facade_2019-12-13.log
sso 9220
./one_deploy.sh marvel-sso-server ybsh
tail -1000f logs/sso_2019-12-13.log
loan
./one_deploy.sh marvel-service-loan ybsh
tail -1000f logs/service_loan_2019-12-13.log
channel 9470
./one_deploy.sh marvel-service-channel ybsh
tail -1000f logs/channel_2019-12-13.log
payment 9060 不行 重新上传
./one_deploy.sh marvel-service-payment ybsh
tail -1000f logs/payment_2019-12-13.log
user
./one_deploy.sh marvel-service-user ybsh
tail -1000f logs/user_2019-12-13.log
repayment 服务有redis 异常
./one_deploy.sh marvel-service-repayment ybsh
tail -1000f logs/repayment_2019-12-13.log
rm -rf 文件夹
ss -s
ss -a | wc -l
ss | more
ss -t
ss -lt
ss -ltn
tail -f service.log
grep -r "{关键字}" {路径}
例如:
grep -r "test" /data/reports
cat -n service.log | grep 13888888888
,如下图我们就可以查到对应的行号了
sed -n "29496,29516p" service.log
:从29496行开始检索,到29516行结束
cat -n service.log | tail -n +29496 | head -n 20
:从29496行开始检索,往前推20条
cat service.log | wc -l :日志输出了多少行
telnet 10.1.49.6 11211
ps aux|grep sleep
find -name card.png
查进程有两个命令:
-
ps -ef
-
ps aux
上面两个命令都是列出所有的进程,我们还是通过 |
管道和grep
来过滤掉想要查的进程,比如说:ps -ef |grep java
把进程查出来干嘛?知道它的进程ID了,我们可以把他给杀掉。
-
kill -9 processId
:杀掉某个进程
查端口也是一个很常见的操作,常见命令:netstat -lntup
:
-
cat service.log
-
tail -f service.log
-
vim serivice.log
-
cat service.log | grep 13888888888
cat -n service.log | grep 13888888888 行号
Linux常用命令:cd,cp,mv,rm,ps(进程),tar,cat(查看内容),chmod,vim,find,ls
查进程有两个命令下面列出所有的进程:
ps -ef
ps aux
我们还是通过 |
管道和grep
来过滤掉想要查的进程
ps -ef |grep java
把进程查出来干嘛?知道它的进程ID了
kill -9 processId
:杀掉某个进程
查端口也是一个很常见的操作
netstat -lntup
查看某个端口详细的信息
lsof -i:4000
mkdir marvel-eureka
docker rmi id
docker-compose images
docker-compose down
iptables -A OUTPUT -p tcp --dport 6379 -j DROP 开放端口
iptables -A OUTPUT -p tcp --dport 26379 -j DROP
source profile
chmod +x /usr/local/bin/docker-compose
curl -L https://github.com/docker/compose/releases/download/1.22.0/docker-compose-uname -s
-uname -m
> /usr/local/bin/docker-compose
sudo systemctl enable docker
sudo apt-get update
echo $JAVA_HOME
sudo apt-get install openjdk-8-jdk
sudo apt-get update
mvn -v
chmod a+x /usr/java/apache-maven-3.6.1/bin/mvn
ssh root@106.15.189.121
ssh-copy-id -i /root/.ssh/id_rsa.pub root@106.15.189.121
ssh root@47.100.240.217
ssh-copy-id -i /root/.ssh/id_rsa.pub root@139.196.126.110
df -lh
mount /dev/vdb1 /mnt
cp /etc/fstab /etc/fstab.bak
fdisk -lu /dev/vdb
telnet 172.19.165.77 8787
ping 106.15.189.121
ifconfig
vi rabbitmq.config
ssh-keygen -t rsa
fdisk -lu /dev/vdb
netstat -anp
docker images
docker rmi nginx:latest
cd ssl-key/
docker-compose up -d
域名 -nginx -106.15.106.189:443()-