我如何在AWS EC2实例上安装DataHub?

huangapple go评论73阅读模式
英文:

How can I install DataHub on an AWS EC2 instance?

问题

我想在AWS实例上安装DataHub。我明确不想在Kubernetes集群上运行它。只需本地安装即可。

英文:

I want to install DataHub on an AWS instance. I specifically don't want to run it on a kubernetes cluster. Just a local installation is fine.

答案1

得分: 1

以下是已翻译的内容:


下面的安装指南最后测试于2023年6月5日。
测试是在运行Ubuntu的AWS EC2实例上执行的,该实例配备了2个CPU、8GB内存和30GB存储空间。

下面的代码将指导您完成安装和正确配置DataHub的过程。

如果使用Docker是或将成为您工作的一部分,请从头到尾阅读此指南。

Docker初学者教程(docker-curriculum.com)

除了关于Docker的一般知识外,它还将教您有关Docker Compose和卷的知识。
了解这些知识对于理解设置过程中发生的事情是必要的。

安装Docker:

安装必要的软件

  • sudo apt-get install curl --> 用于在服务器之间传输文件。
  • sudo apt-get install gnupg --> 用于加密服务器之间的通信。
  • sudo apt-get install ca-certificates --> 用于检查服务器的可信度。
  • sudo apt-get install lsb-release --> 用于获取有关Linux分发的信息。

创建用于Docker GPG(加密)文件的文件夹并下载它。

  • sudo mkdir -p /etc/apt/keyrings
  • curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg

引用最新的稳定Docker版本

  • echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

更新实例上的软件包

  • sudo apt-get update

安装Docker

  • sudo apt-get install docker-ce
  • sudo apt-get install docker-ce-cli
  • sudo apt-get install containerd.io
  • sudo apt-get install docker-compose-plugin

检查Docker是否成功安装

  • sudo docker --version --> 将显示Docker的版本。
  • docker compose version --> 将显示Docker Compose的版本。
  • sudo docker run hello-world --> 将运行一个容器,以证明功能正常。

启用Docker以无需root用户权限运行

创建一个Docker权限组

  • sudo groupadd docker

将您的用户添加到docker组

  • sudo usermod -aG docker $USER

更新系统上的组

  • newgrp docker

检查是否可以无需sudo运行Docker

  • docker run hello-world

安装DataHub

在安装pip之前更新软件包列表

  • sudo apt-get update

安装pip

  • sudo apt-get install python3-pip

检查安装是否成功

  • pip3 --version

安装Wheel和setuptools

  • python3 -m pip install --upgrade pip wheel setuptools

安装DataHub

  • python3 -m pip install --upgrade acryl-datahub

将datahub添加到Linux的路径中

  • export PATH="/home/ubuntu/.local/bin:$PATH"

检查是否安装了datahub

  • datahub version

重新启动实例

更改前端根用户凭据

导航到主目录

  • cd

创建datahub文件夹并打开它

  • mkdir datahub
  • cd datahub

创建卷文件夹并打开它

  • mkdir volumes
  • cd volumes

创建frontend-react文件夹并打开它

  • mkdir frontend-react
  • cd frontend-react

创建user.props文件

  • > user.props

编辑user.props

  • nano user.props

复制新的用户凭据

  • // 新的user.props
    datahub:NewPassword

按下CTRL+X,然后按Y,然后按Enter

检查新文件的内容

  • cat user.props

运行datahub快速启动一次以下载.yml文件。

  • datahub docker quickstart

在第一个容器健康后,使用STRG+C停止进程。如果您的终端卡住或显示无休止的运行文本,请重新启动它。

停止所有容器,删除它们并删除所有卷

  • docker stop $(docker ps -a -q)
  • docker rm $(docker ps -a -q)
  • docker volume rm $(docker volume ls -q)

导航到docker compose YAML文件

  • cd
  • cd .datahub
  • cd quickstart

编辑docker-compose.yml文件

  • nano docker-compose.yml

在前端反应容器的卷部分添加以下行

  • - ${HOME}/datahub/volumes/frontend-react/user.props:/datahub-frontend/conf/user.props
  • 我如何在AWS EC2实例上安装DataHub?

按下CTRL+X,然后按Y,然后按Enter

执行docker compose up(如果终端在容器不健康或遇到错误后卡住,请多次执行相同的命令,直到所有容器都正常启动)

  • docker compose -f docker-compose.yml up -d

运行docker ps命令时,现在应该看到以下内容:
我如何在AWS EC2实例上安装DataHub?

英文:

The below installation guide has been tested last on 06.05.2023.
Tests were executed on an AWS EC2 instance running Ubuntu with 2 CPUs, 8 GB of RAM and 30GB of storage.

The below code will guide you through the process of installing and properly configuring DataHub.

If working with Docker is or will become part of your job please read this guide from start to end.

A Docker Tutorial for Beginners (docker-curriculum.com)

In addition to general knowledge about Docker it will teach you about Docker Compose and volumes.
This knowledge is needed to understand what happens during the set up process.

Install Docker:

Install necessary software

  • sudo apt-get install curl --> Enables file transfer between
    servers.
  • sudo apt-get install gnupg --> For encrypting communication
    between server.
  • sudo apt-get install ca-certificates --> For checking
    trustworthyness of servers.
  • sudo apt-get install lsb-release --> To
    get info about linux distribution.

Create folder for docker GPG (encryption) file and download it.

  • sudo mkdir -p /etc/apt/keyrings
  • curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg

Reference the latest stable docker release

  • echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

Update packages on the instance

  • sudo apt-get update

Install Docker

  • sudo apt-get install docker-ce
  • sudo apt-get install docker-ce-cli
  • sudo apt-get install containerd.io
  • sudo apt-get install docker-compose-plugin

Check whether docker was installed successfully

  • sudo docker --version --> Will show version of Docker.
  • docker compose version --> Will show version of Docker compose.
  • sudo docker run hello-world --> Will run a container and therefor
    proof functionality.

Enable Docker to run without requiring root user privileges

Create a docker permission group

  • sudo groupadd docker

Add your user to the docker group

  • sudo usermod -aG docker $USER

Update groups on your system

  • newgrp docker

Check whether docker runs without sudo

  • docker run hello-world

Install DataHub

Update the package list before installing pip

  • sudo apt-get update

Install pip

  • sudo apt-get install python3-pip

check for success

  • pip3 --version

Install Wheel and setuptools

  • python3 -m pip install --upgrade pip wheel setuptools

Install datahub

  • python3 -m pip install --upgrade acryl-datahub

Add datahub to the path of linux

  • export PATH="/home/ubuntu/.local/bin:$PATH"

Check whether datahub was installed

  • datahub version

Restart the instance

Change frontend root user credentials

Navigate to home

  • cd

Create datahub folder and open it

  • mkdir datahub
  • cd datahub

Create volumes folder and open it

  • mkdir volumes
  • cd volumes

Create frontend-react folder and open it

  • mkdir frontend-react
  • cd frontend-react

Create user.props file

  • > user.props

Edit user.props

  • nano user.props

Copy new user credentials

  • // new user.props 
    datahub:NewPassword
    

Pres CTRL+X then Y and then Enter

Check contents of new file

  • cat user.props

Run datahub quickstart once to download the .yml file.

  • datahub docker quickstart

After the first container is healthy, stop the process with STRG+C. If your terminal gets stuck or is showing running text without end, restart it.

Stop all containers, remove them and also delete all volumes

  • docker stop $(docker ps -a -q)
  • docker rm $(docker ps -a -q)
  • docker volume rm $(docker volume ls -q)

Navigate to the docker compose YAML file

  • cd
  • cd .datahub
  • cd quickstart

Edit the docker-compose.yml file

  • nano docker-compose.yml

Add the below line in the volume section of the frontend react container

  • - ${HOME}/datahub/volumes/frontend-react/user.props:/datahub-frontend/conf/user.props
  • 我如何在AWS EC2实例上安装DataHub?

Press CTRL+X then Y and then Enter

Execute docker compose up (If the terminal gets stuck afte a container was unhealthy or ran into an error execute the same command again until all containers are up)

  • docker compose -f docker-compose.yml up -d

When running the docker ps command you should see the follwing now:
我如何在AWS EC2实例上安装DataHub?

huangapple
  • 本文由 发表于 2023年6月5日 14:28:03
  • 转载请务必保留本文链接:https://go.coder-hub.com/76403970.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定