Update pcm_deploy.md
Former-commit-id: e59f2dec60abea6516c11fe1851ec9609b5fc90c
This commit is contained in:
parent
507de87a91
commit
ec4619fd4e
|
@ -1,41 +1,116 @@
|
|||
|
||||
|
||||
## 1 安装部署kubekey
|
||||
通过以下的命令,可以下载 KubeKey 的最新版本。您可以更改命令中的版本号来下载特定的版本。
|
||||
|
||||
```
|
||||
```shell
|
||||
export KKZONE=cn
|
||||
curl -sfL https://get-kk.kubesphere.io | VERSION=v3.0.7 sh -
|
||||
```
|
||||
## 2 mysql部署及数据导入
|
||||
#### 卸载已有的mariadb
|
||||
`yum remove -y mariadb-server mariadb mariadb-libs`
|
||||
#### 下载对应系统版本的mysql包
|
||||
wget https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-8.0.36-1.el7.x86_64.rpm-bundle.tar
|
||||
##### 解压
|
||||
`tar -xvf mysql-8.0.36-1.el7.x86_64.rpm-bundle.tar`
|
||||
##### 安装
|
||||
```shell
|
||||
rpm -ivh mysql-community-libs-8.0.36-1.el7.x86_64.rpm
|
||||
rpm -ivh mysql-community-libs-compat-8.0.36-1.el7.x86_64.rpm
|
||||
rpm -ivh mysql-community-client-plugins-8.0.36-1.el7.x86_64.rpm
|
||||
rpm -ivh mysql-community-client-8.0.36-1.el7.x86_64.rpm
|
||||
rpm -ivh mysql-community-common-8.0.36-1.el7.x86_64.rpm
|
||||
rpm -ivh mysql-community-debuginfo-8.0.36-1.el7.x86_64.rpm
|
||||
rpm -ivh mysql-community-devel-8.0.36-1.el7.x86_64.rpm
|
||||
rpm -ivh mysql-community-server-8.0.36-1.el7.x86_64.rpm
|
||||
```
|
||||
##### 启动服务
|
||||
`systemctl start mysqld`
|
||||
##### 查看初始密码
|
||||
`grep 'temporary password' /var/log/mysqld.log`
|
||||
使用mysql -u root -p 登录
|
||||
##### 修改密码
|
||||
`ALTER USER 'root'@'localhost' IDENTIFIED BY 'Nudt!123';`
|
||||
##### 配置外部访问
|
||||
```sql
|
||||
use mysql;
|
||||
update user set host = '%' where user = 'root';
|
||||
flush privileges;
|
||||
```
|
||||
##### 创建数据库
|
||||
```sql
|
||||
create database pcm;
|
||||
create database pcm_auth;
|
||||
```
|
||||
##### 关闭防火墙
|
||||
`systemctl stop firewalld`
|
||||
##### 下载脚本
|
||||
`wget -O pcm_auth.sql https://www.gitlink.org.cn/attachments/entries/get_file?download_url=https://www.gitlink.org.cn/api/JointCloud/pcm-coordinator/raw/deploy%2Fpcm-auth.sql?ref=master`
|
||||
`wget -O pcm.sql https://www.gitlink.org.cn/attachments/entries/get_file?download_url=https://www.gitlink.org.cn/api/JointCloud/pcm-coordinator/raw/deploy%2Fpcm.sql?ref=master`
|
||||
|
||||
## 2 安装部署k8s集群
|
||||
##### 执行sql脚本导入数据
|
||||
`mysql -u root -p pcm < pcm.sql`
|
||||
`mysql -u root -p pcm_auth < pcm_auth.sql`
|
||||
|
||||
## 3 安装部署k8s集群
|
||||
```
|
||||
./kk create cluster
|
||||
export KKZONE=cn
|
||||
sudo ./kk create cluster
|
||||
```
|
||||
|
||||
执行可能会提示部分软件未安装,直接yum安装即可
|
||||

|
||||
然后重新执行创建集群命令,执行成功后可以验证环境
|
||||

|
||||
eg:
|
||||
`sudo yum install -y conntrack`
|
||||
`sudo yum install -y socat`
|
||||

|
||||
|
||||
然后重新执行创建集群命令,执行成功后可以执行kubectl get pod 验证环境
|
||||

|
||||
|
||||
|
||||
## 3 部署鉴权、pcm-coordinator、前端服务
|
||||
### 3.1 yaml文件下载
|
||||
pcm所有服务的yaml文件包下载地址在[这里](https://www.gitlink.org.cn/attachments/entries/get_file?download_url=https://www.gitlink.org.cn/api/JointCloud/pcm-coordinator/raw/deploy%2Fpcm-yaml.zip?ref=master "这里")
|
||||
或者在服务器上直接执行
|
||||
```shell
|
||||
wget -O yaml.zip https://www.gitlink.org.cn/attachments/entries/get_file?download_url=https://www.gitlink.org.cn/api/JointCloud/pcm-coordinator/raw/deploy%2Fpcm-yaml.zip?ref=master
|
||||
```
|
||||
下载完成解压
|
||||
```shell
|
||||
unzip yaml.zip
|
||||
```
|
||||
### 3.2 yaml执行完成服务、负载、配置文件的部署
|
||||
#### 修改地址
|
||||
需要修改配置文件中的数据库地址为mysql服务安装的地址
|
||||
|
||||
yaml文件下载链接:https://pan.baidu.com/s/1VU1zE2xcFkrz9Hz2MkgDaQ
|
||||
#### 一次性部署所有的文件
|
||||
```shell
|
||||
kubectl apply -f .
|
||||
```
|
||||
#### 或者单模块部署
|
||||
##### 鉴权:
|
||||
`kubectl apply -f pcm-auth.yaml`
|
||||
##### C端:
|
||||
`kubectl apply -f pcm-core-api.yaml`
|
||||
`kubectl apply -f pcm-core-rpc.yaml`
|
||||
##### 前端:
|
||||
`kubectl apply -f pcm-rip.yaml`
|
||||
|
||||
鉴权:
|
||||
kubectl apply -f pcm-auth.yaml
|
||||
C端:
|
||||
kubectl apply -f pcm-core-api.yaml
|
||||
kubectl apply -f pcm-core-rpc.yaml
|
||||
前端:
|
||||
kubectl apply -f pcm-rip.yaml
|
||||
部署情况可以通过以下命令查看
|
||||
`kubectl get pod`
|
||||

|
||||
|
||||
## 4 配置驱动器、集群信息
|
||||
此时前端服务可以通过服务器ip的31149端口访问到
|
||||
默认账号密码为admin/Nudt@123
|
||||
|
||||
新建一个适配器,配置成功后可以获取到对应的adapterId
|
||||

|
||||

|
||||
将对应的id填写到对应的P端配置信息中(configmap 内容)
|
||||

|
||||

|
||||
## 5 部署P端服务
|
||||
P端:
|
||||
### HPC服务端:
|
||||
kubectl apply -f pcm-hpc.yaml
|
||||
### kubernetes适配器:
|
||||
kubectl apply -f pcm-kubernetes.yaml
|
||||
|
||||
## 7.系统使用
|
Loading…
Reference in New Issue