You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@linkis.apache.org by ca...@apache.org on 2022/10/28 02:08:37 UTC

[incubator-linkis-website] branch dev updated: feat:add linkis container deployment (#556)

This is an automated email from the ASF dual-hosted git repository.

casion pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-linkis-website.git


The following commit(s) were added to refs/heads/dev by this push:
     new a3c1545d45 feat:add linkis container deployment (#556)
a3c1545d45 is described below

commit a3c1545d451215a8626cab2e8f9d9a142dd9a64d
Author: jacktao007 <zh...@apache.org>
AuthorDate: Fri Oct 28 10:08:32 2022 +0800

    feat:add linkis container deployment (#556)
---
 docs/deployment/deploy-linkis-to-kbernetes.md      | 109 ++++++++++++++++++++
 .../deployment/deploy-linkis-to-kbernetes.md       | 110 +++++++++++++++++++++
 static/Images/deployment/kubernetes/linkis.jpg     | Bin 0 -> 43701 bytes
 static/Images/deployment/kubernetes/pods.jpg       | Bin 0 -> 58739 bytes
 4 files changed, 219 insertions(+)

diff --git a/docs/deployment/deploy-linkis-to-kbernetes.md b/docs/deployment/deploy-linkis-to-kbernetes.md
new file mode 100644
index 0000000000..e452a42b12
--- /dev/null
+++ b/docs/deployment/deploy-linkis-to-kbernetes.md
@@ -0,0 +1,109 @@
+---
+title: linkis Container deployment
+sidebar_position: 12
+---
+This article describes how to deploy a Linkis service in a Kind Kubernetes environment for easier learning and debugging.
+
+## 1. Dependencies and versions
+kind github:https://github.com/kubernetes-sigs/kind   
+kind web site:[kind.sigs.k8s.io/](https://kind.sigs.k8s.io/)
+
+### versions:
+kind 0.14.0  
+docker 20.10.17  
+centos 7.6  
+helm 3.x  
+
+### notice:
+1. Ensure that the component depends on the version  
+2.kind means that the machine simulating node with docker container is restarted and the container has changed and the scheduler is not working anymore. This is a kind limitation and there is a detailed explanation in the official document.
+
+## 2.Install the docker
+### 2.1 Install the tutorial
+```
+sudo yum install -y yum-utils device-mapper-persistent-data lvm2
+sudo yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
+sudo sed -i 's+download.docker.com+mirrors.aliyun.com/docker-ce+' /etc/yum.repos.d/docker-ce.repo
+sudo yum makecache fast
+sudo yum -y install docker-ce
+systemctl start docker
+systemctl enable docker
+```
+
+### 2.2 Setting a Domestic Image
+```
+vi /etc/docker/daemon.json
+{
+"registry-mirrors": ["http://hub-mirror.c.163.com"],
+"insecure-registries": ["https://registry.mydomain.com","http://hub-mirror.c.163.com"]
+}
+```
+
+## 3. Install the kind
+
+### (1)Manually download the kind binary
+```
+https://github.com/kubernetes-sigs/kind/releases
+```
+### (2)Install kind Binary
+```
+chmod +x ./kind
+mv kind-linux-amd64 /usr/bin/kind
+```
+## 4. Install linkis
+### 0.Download linkis1.3.0 deployment package
+```
+apache-linkis-1.3.0-incubating-bin.tar.gz
+```
+### 1.Build directory
+```
+mkdir -p /opt/data/common/extendlib
+```
+### 2.Copy driver to /opt/data/common/extendlib
+```
+curl https://repo1.maven.org/maven2/mysql/mysql-connector-java/8.0.28/mysql-connector-java-8.0.28.jar -o /opt/data/common/extendlib/[mysql-connector-java-8.0.28.jar](https://repo1.maven.org/maven2/mysql/mysql-connector-java/8.0.28/mysql-connector-java-8.0.28.jar)
+```
+### 3.Reset kind (not necessary)
+```
+./bin/install-linkis-to-kubernetes.sh reset
+```
+### 4.Pull the image
+```
+./bin/install-linkis-to-kubernetes.sh pull -mghcr.dockerproxy.com
+```
+### 5.Install linkis to kind
+```
+./bin/install-linkis-to-kubernetes.sh install -l -mghcr.dockerproxy.com
+```
+### 6.Run commands to view services and wait until all services are successfully started
+```
+kubectl get pods -A
+```
+![](/Images/deployment/kubernetes/pods.jpg)
+
+### 7.Copy the ldh environment to linkis
+```
+./helm/scripts/prepare-for-spark.sh
+```
+### 8.Enabling Port Mapping
+```
+./helm/scripts/remote-proxy.sh start
+```
+### 9.Access to the system
+```
+linkis-web: http://10.0.2.101:8088/
+eureka: http://10.0.2.101:20303/
+```
+### 10.Into the container
+```
+./helm/scripts/login-pod.sh cg-engineconnmanager
+Executing shell tests
+sh ./bin/linkis-cli -engineType shell-1 -codeType shell -code "echo "hello" "  -submitUser hadoop -proxyUser hadoop
+Executing hive Tests
+sh ./bin/linkis-cli -engineType hive-2.3.3 -codeType hql -code "show tables"  -submitUser hadoop -proxyUser hadoop
+Executing spark Tests
+sh ./bin/linkis-cli -engineType spark-2.4.3 -codeType sql -code "show tables"  -submitUser hadoop -proxyUser hadoop
+Executing python Tests
+sh ./bin/linkis-cli -engineType python-python2 -codeType python -code "print(\"hello\")"  -submitUser hadoop -proxyUser hadoop  -confMap  python.version=python
+```
+![](/Images/deployment/kubernetes/linkis.jpg)
\ No newline at end of file
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/deployment/deploy-linkis-to-kbernetes.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/deployment/deploy-linkis-to-kbernetes.md
new file mode 100644
index 0000000000..25b129048e
--- /dev/null
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/deployment/deploy-linkis-to-kbernetes.md
@@ -0,0 +1,110 @@
+---
+title: Linkis 容器化部署
+sidebar_position: 13
+---
+这篇文章介绍一下如何在就Kind的Kubernetes的环境中部署 Linkis 服务,以方便更轻量化的学习使用和调试。
+
+## 1. 依赖版本
+kind github:https://github.com/kubernetes-sigs/kind  
+kind官网:[kind.sigs.k8s.io/](https://kind.sigs.k8s.io/)
+
+### 版本:
+kind 0.14.0
+docker 20.10.17
+centos 7.6
+helm 3.x
+
+### 注意:
+1.确保组件依赖版本
+2.kind是用docker容器模拟节点的 机器重启回来容器都变了 调度器就不工作了 这个是kind的limitation,官方文档有详细说明。
+
+## 2.安装docker
+### 2.1 安装教程
+```
+sudo yum install -y yum-utils device-mapper-persistent-data lvm2
+sudo yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
+sudo sed -i 's+download.docker.com+mirrors.aliyun.com/docker-ce+' /etc/yum.repos.d/docker-ce.repo
+sudo yum makecache fast
+sudo yum -y install docker-ce
+systemctl start docker
+systemctl enable docker
+```
+
+### 2.2 设置国内镜像
+```
+vi /etc/docker/daemon.json
+{
+"registry-mirrors": ["http://hub-mirror.c.163.com"],
+"insecure-registries": ["https://registry.mydomain.com","http://hub-mirror.c.163.com"]
+}
+```
+
+## 3. 安装kind
+### (1)手工下载kind二进制
+```
+https://github.com/kubernetes-sigs/kind/releases
+```
+### (2)安装kind二进制
+```
+chmod +x ./kind
+mv kind-linux-amd64 /usr/bin/kind
+```
+## 4. 安装linkis
+### 0.下载或自行编译linkis1.3.0部署包
+使用版本:dev1.3.0分支编译版本
+```
+apache-linkis-1.3.0-incubating-bin.tar.gz
+```
+### 1.建立目录
+```
+mkdir -p /opt/data/common/extendlib
+```
+### 2.拷贝驱动到 /opt/data/common/extendlib
+```
+curl https://repo1.maven.org/maven2/mysql/mysql-connector-java/8.0.28/mysql-connector-java-8.0.28.jar -o /opt/data/common/extendlib/[mysql-connector-java-8.0.28.jar](https://repo1.maven.org/maven2/mysql/mysql-connector-java/8.0.28/mysql-connector-java-8.0.28.jar)
+```
+### 3.重置kind(非必要)
+```
+./bin/install-linkis-to-kubernetes.sh reset
+```
+### 4.拉取镜像
+```
+./bin/install-linkis-to-kubernetes.sh pull -mghcr.dockerproxy.com
+```
+### 5.安装linkis到kind中
+```
+./bin/install-linkis-to-kubernetes.sh install -l -mghcr.dockerproxy.com
+```
+### 6.使用命令查看服务,等待全部启动成功
+```
+kubectl get pods -A
+```
+![](/Images/deployment/kubernetes/pods.jpg)
+
+
+### 7.拷贝ldh环境到linkis
+```
+./helm/scripts/prepare-for-spark.sh
+```
+### 8.开启端口映射
+```
+./helm/scripts/remote-proxy.sh start
+```
+### 9.访问系统
+```
+linkis-web: http://10.0.2.101:8088/
+eureka: http://10.0.2.101:20303/
+```
+### 10.进入容器
+```
+./helm/scripts/login-pod.sh cg-engineconnmanager
+执行shell测试
+sh ./bin/linkis-cli -engineType shell-1 -codeType shell -code "echo "hello" "  -submitUser hadoop -proxyUser hadoop
+执行hive测试
+sh ./bin/linkis-cli -engineType hive-2.3.3 -codeType hql -code "show tables"  -submitUser hadoop -proxyUser hadoop
+执行spark测试
+sh ./bin/linkis-cli -engineType spark-2.4.3 -codeType sql -code "show tables"  -submitUser hadoop -proxyUser hadoop
+执行python测试
+sh ./bin/linkis-cli -engineType python-python2 -codeType python -code "print(\"hello\")"  -submitUser hadoop -proxyUser hadoop  -confMap  python.version=python
+```
+![](/Images/deployment/kubernetes/linkis.jpg)
diff --git a/static/Images/deployment/kubernetes/linkis.jpg b/static/Images/deployment/kubernetes/linkis.jpg
new file mode 100644
index 0000000000..ab69a84900
Binary files /dev/null and b/static/Images/deployment/kubernetes/linkis.jpg differ
diff --git a/static/Images/deployment/kubernetes/pods.jpg b/static/Images/deployment/kubernetes/pods.jpg
new file mode 100644
index 0000000000..3ba034b26c
Binary files /dev/null and b/static/Images/deployment/kubernetes/pods.jpg differ


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@linkis.apache.org
For additional commands, e-mail: commits-help@linkis.apache.org