Linux 常用命令及项目部署软件
harbor
wget https://github.com/goharbor/harbor/releases/download/v2.2.1/harbor-offline-installer-v2.2.1.tgz
vi/vim下如何搜索字符串
:/user 下行n 上行 N
高亮
命令模式下,输入:nohlsearch 也可以:set nohlsearch; 当然,可以简写,noh或者set noh
:set number 显示行号
日志搜索查看
grep -rn 'xxx' auth.out
查看端口 占用情况
netstat -np||grep 6379
查看资源占用
df -h
目录内文件排序
du -sh * | sort -nr
zk启动
启动
sh /data/zk1/bin/zkServer.sh start
查看状态
sh /data/zk1/bin/zkServer.sh stauts
kafka
启动
./bin/kafka-server-start.sh -daemon config/server.properties
nginx
./nginx -s reload
./sbin/nginx -c ./conf/nginx.confng
postgresql:5432
https://www.postgresql.org/download/linux/redhat/
修改配置:
vim /var/lib/pgsql/13/data/postgresql.conf
vim /var/lib/pgsql/13/data/pg_hba.conf
重启
systemctl restart postgresql-13.service
java8:
wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" https://download.oracle.com/otn-pub/java/jdk/8u201-b09/42970487e3af4f5aa5bca3f542482c60/jdk-8u201-linux-x64.tar.gz
sonar
https://www.cnblogs.com/dkx3510/p/14667586.html
第一步,数据库
CREATE USER 'sonar' IDENTIFIED BY 'sonar';
GRANT ALL ON sonar.* TO 'sonar'@'%' IDENTIFIED BY 'sonar';
FLUSH PRIVILEGES;
或者需要postgresql
第二部,安装
https://binaries.sonarsource.com/Distribution/sonarqube/sonarqube-8.5.1.38104.zip
配置 启动
访问
canal命令
第一步,先开启bin-log
log-bin=mysql-bin
binlog-format=ROW
server_id=1
第二步,授权
create user canal identified by 'canal';
grant all privileges on *.* to 'canal'@'%';
flush privileges;
如果用canaladmin 还需要执行sql文件
第三步,安装:
wget https://github.com/alibaba/canal/releases/download/canal-1.1.4/canal.admin-1.1.4.tar.gz
wget https://github.com/alibaba/canal/releases/download/canal-1.1.4/canal.deployer-1.1.4.tar.gz
第四步,启动
bin/start.sh
tidb启动
1、./bin/pd-server --data-dir=/data/pd --log-file=/data/logs/pd.log &
ps -ef|grep pd-server
2、./bin/tikv-server --pd="127.0.0.1:2379" --data-dir=/data/tikv --log-file=/data/logs/tikv.log &
ps -ef|grep tikv-server
3、./bin/tidb-server --store=tikv --path="127.0.0.1:2379" --log-file=/data/logs/tidb.log &
ps -ef|grep tidb-server
4、mysql -h127.0.0.1 -P4000 -uroot -D TEST
jenkins安装:
1、wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo
2、rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key
3、yum install jenkins
4、vi /etc/init.d/jenkins
5、vi /etc/sysconfig/jenkins
6、systemctl daemon-reload
7、service jenkins start
访问端口
8、cat /var/lib/jenkins/secrets/initialAdminPassword
systemctl start jenkins.service 启动jenkins
systemctl enable jenkins.service 设置jenkins开机启动
systemctl stop jenkins.service 关闭jenkins
systemctl status jenkins.service 查看jenkins的状态
jenkins设置远程
/root/.ssh/id_rsa
nacos启动
wget https://github.com/alibaba/nacos/releases/download/2.0.1/nacos-server-2.0.1.tar.gz
tar -xvf nacos-server-1.0.0.tar.gz
nacos sh startup.sh -m standalone
redis 启动
redis-server …/redis.conf
防火墙
添加指定端口到防火墙中
iptables -I INPUT -p tcp --dport 8080 -j ACCEPT
# 查看防火墙状态
service iptables status
systemctl status firewalld
# 停止防火墙
service iptables stop
# 启动防火墙
service iptables start
# 重启防火墙
service iptables restart
# 永久关闭防火墙
chkconfig iptables off
# 永久关闭后重启
chkconfig iptables on
docker命令:
yum install docker 安装
systemctl start docker 启动
systemctl enable docker 开机自启
systemctl status docker 状态
pip install -U docker-compose
安装vim
yum -y install vim*
pip
如果新系统尚未安装工具pip,可通过以下三步快速安装pip
1. yum -y install epel-release
2. yum -y install python-pip
3. pip --version 查看pip版本
若要更新pip,可以使用命令pip install --upgrade pip

浙公网安备 33010602011771号