MySQL更改用户密码
比如更改root用户密码:
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('mypass');
FLUSH PRIVILEGES;
以上会更改localhost
链接的root用户密码,想要更改所有域的链接的root用户密码,使用:
SET PASSWORD FOR 'root'@'%' = PASSWORD('mypass');
FLUSH PRIVILEGES;
比如更改root用户密码:
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('mypass');
FLUSH PRIVILEGES;
以上会更改localhost
链接的root用户密码,想要更改所有域的链接的root用户密码,使用:
SET PASSWORD FOR 'root'@'%' = PASSWORD('mypass');
FLUSH PRIVILEGES;
类似把大象关进冰箱分为3步:
将物理机迁移至ESXi 7.0虚拟机也需要3步:
VMware vCenter Converter Standalone Client
将物理机打包成VMware Workstation
兼容的vmdk文件;vmkfstools
转换其为ESXi7.0兼容的格式;VMware vCenter Converter Standalone Client
,可能需要注册一个账号VMware vCenter Converter Standalone Client
source type
为This local machine
进入下一步:VMware Workstation
兼容的vmdk文件vmkfstools
转换格式由于打包的vmdk是兼容VMware Workstation的版本,是不兼容ESXi的。如果不转换格式的话,会出现类似报错:
无法打开磁盘 scsi0:m: 磁盘类型 n 不受支持或无效。请确保磁盘已导入。
SSH
服务,详见启用对 ESXi Shell 的访问cd
到第2步存储所在的文件夹,再进一步cd
到上传的vmdk文件所在的文件夹执行vmkfstools
转换格式命令,记得最后要使用-d thin
来使用精简置备模式,以节省空间
# 进入导入vmdk文件所在的文件夹
cd /vmfs/volumes/xxxxx248-xxxx75d-07eb-xxxxd6c0/xxxx
# 转换格式,假定原文件名为orginal.vmdk,转换后的文件名为dest.vmdk
vmkfstools -i orginal.vmdk dest.vmdk -d thin
创建一个新的虚拟机,添加上一步转换出来的vmdk文件为新的硬盘
dest.vmdk
)LEDE的vmdk在esxi下提示scsi0:0的磁盘类型不受支持或无效_Jian Sun_的博客-程序员宝宝
WorkStation 虚拟机迁移到 ESXi的后续处理. 转载
准备一个操作系统,并安装Docker,具体可以参考Docker文档
若是Linux操作系统,应增加docker用户组并将当前作业用户添加进组,否则必须使用sudo
升权执行
sudo groupadd docker
sudo usermod -aG docker ${USER}
退出登陆或重启系统后即可直接运行docker
拉取Jenkins相关Docker镜像并运行
拉取并运行blueocean
版本的Jenkins镜像:
docker run -p 8080:8080 -p 50000:50000 -v jenkins_data:/var/jenkins_home jenkinsci/blueocean
为了支持SSH操作,拉取并运行jenkins/ssh-agent
镜像:
cat pub.key | docker run jenkins/ssh-agent
* pub.key
为配置相关证书密钥中Jenkins容器的公钥
配置Jenkins:
Maven Integration plugin
、GitLab Plugin
和SSH plugin
、Docker Pipeline
这些插件配置相关证书密钥和用户名密码,为连接GitHub、Gitlab,Docker私服、远程服务器做准备:
配置Jenkins自身的证书:进入Jenkins所在容器,创建SSH密钥/证书,并添加进Jenkins系统中(用来从Github/Gitlab下载源码)
# 进入jenkins容器,假设容器ID为abc
docker exec -it abc /bin/bash
# 生成证书,默认在/var/jenkins_home/.ssh/下有id_rsa和id_rsa.pub两个密钥和公钥
ssh-keygen -t rsa
创建Jenkins构建脚本
git@
开头),并选择Jenkins自身密钥作为凭证(Credentials)/etc/nginx/sites-available/domain.name.com
include /etc/nginx/proxy.conf;
limit_req_zone $binary_remote_addr zone=one:10m rate=5r/s;
server_tokens off;
upstream corshapi {
server localhost:5001;
}
add_header X-Frame-Options DENY;
add_header X-Content-Type-Options nosniff;
limit_req zone=one burst=10 nodelay;
location /api {
proxy_pass http://localhost:5001;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection keep-alive;
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
rp is a fast reverse proxy to help you expose a local server behind a NAT or firewall to the Internet. As of now, it supports TCP and UDP, as well as HTTP and HTTPS protocols, where requests can be forwarded to internal services by domain name.
frp also has a P2P connect mode.
FRP分为服务端frps
和客户端frpc
。架构如下:
设置服务端systemd service, /etc/systemd/system/frps.service
:
[Unit]
Description=Frp Server Service
After=network.target
[Service]
Type=simple
User=nobody
Restart=on-failure
RestartSec=5s
ExecStart=/usr/bin/frps -c /etc/frp/frps.ini
LimitNOFILE=1048576
[Install]
WantedBy=multi-user.target
服务端设置好后:
Congratulations, frps install completed!
==============================================
You Server IP : 123.123.123.123
Bind port : 7020
Dashboard port : 7500
vhost http port : 7080
vhost https port: 7443
Privilege token : tokenxxxxx!
Max Pool count : 50
Log level : info
Log max days : 3
Log file : enable
客户端 frpc.ini
:
[common]
server_addr = 123.123.123.123
server_port = 7020
[web]
type = http
local_port = 80
custom_domains = frp.domain.com
nginx 代理:
server {
# 监听nginx 80端口
listen 80;
# 域名配置 记得一定要加上*.frp.xxx.com + frp.xxx.com这个,只加frp.xxx.com是不行的,无法支持泛域名做sub模式
server_name *.frp.xxx.com frp.xxx.com;
location / {
proxy_pass http: //127.0.0.1:7001;
# 这个Host的header一定要加,不然转发后frp拿不到通过哪个域名访问的,导致转发失败
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}