如何在Ubuntu 20.04上安装Ralph资产管理系统

Ralph是用于数据中心和后台的免费,开源,简单而强大的资产管理,DCIM和CMDB系统。它建立在Django,Python3之上,用于跟踪资产购买及其生命周期。它带有一个用户友好的Web界面,可让您生成灵活而准确的成本报告。

在本教程中,我们将向您展示如何在Ubuntu 20.04上使用Docker安装Ralph Asset Management System。

先决条件

  • 运行Ubuntu 20.04的服务器。
  • 在您的服务器上设置了root密码。

入门

在开始之前,最好将系统的软件包更新为最新版本。您可以使用以下命令更新它们:

apt-get update -y
apt-get upgrade -y

更新所有软件包后,请重新启动系统以应用更改。

安装Docker和Docker Compose

默认情况下,Ubuntu 20.04服务器默认存储库中提供了最新版本的Docker和Docker Compose。您可以通过运行以下命令来安装它们:

apt-get install docker.io docker-compose -y

在安装两个软件包之后,启动Docker服务,并使用以下命令使其在系统重启后启动:

systemctl start docker
systemctl enable docker

接下来,使用以下命令验证Docker的状态:

systemctl status docker

您应该获得以下输出:

docker.service-Docker应用容器引擎
     已加载:已加载(/lib/systemd/system/docker.service;已禁用;供应商预设:已启用)
     活动:自UTC 2020-04-29 08:06:11 UTC起活动(运行);6s前
触发者:docker.socket
       文件:https://docs.docker.com
   主PID:3371(dockerd)
      任务:10
     记忆体:36.0M
     CGroup:/system.slice/docker.service
             3371 / usr / bin / dockerd -H fd:// --containerd = / run / containerd / containerd.sock

4月29日08:06:11 ubuntu20 dockerd [3371]:time =“ 2020-04-29T08:06:11.552343504Z” level = warning msg =“您的内核不支持交易所内存limi>
Apr 29 08:06:11 ubuntu20 dockerd [3371]:time =“ 2020-04-29T08:06:11.552406263Z” level = warning msg =“您的内核不支持cgroup blkio wei>
Apr 29 08:06:11 ubuntu20 dockerd [3371]:time =“ 2020-04-29T08:06:11.552423110Z” level = warning msg =“您的内核不支持cgroup blkio wei>
4月29日08:06:11 ubuntu20 dockerd [3371]:time =“ 2020-04-29T08:06:11.552769597Z” level = info msg =“正在加载容器:开始。”
4月29日08:06:11 ubuntu20 dockerd [3371]:time =“ 2020-04-29T08:06:11.710947740Z” level = info msg =“默认网桥(docker0)被分配了IP>
“ 4月29日08:06:11 ubuntu20 dockerd [3371]:time =” 2020-04-29T08:06:11.793048851Z“ level = info msg =”正在加载容器:已完成。“
4月29日08:06:11 ubuntu20 dockerd [3371]:time =“ 2020-04-29T08:06:11.819265563Z” level = info msg =“ Docker daemon” commit = afacb8b7f0 graphdriver(s)=>
4月29日08:06:11 ubuntu20 dockerd [3371]:time =“ 2020-04-29T08:06:11.819655292Z” level = info msg =“守护程序已完成初始化”
4月29日08:06:11 ubuntu20 systemd [1]:启动了Docker应用容器引擎。
4月29日08:06:11 ubuntu20 dockerd [3371]:time =“ 2020-04-29T08:06:11.874074016Z” level = info msg =“ API在/run/docker.sock上监听”
线1-21 / 21(结束)

接下来,使用以下命令检查Docker的安装版本:

docker -v

您应该获得以下输出:

Docker版本19.03.8,构建afacb8b7f0

接下来,使用以下命令检查Docker-compose的版本:

docker-compose -v

您应该获得以下输出:

docker-compose版本1.25.0,构建未知

使用Docker安装Ralph

首先,使用以下命令安装git软件包:

apt-get install git -y

接下来,使用以下命令从Git存储库下载最新版本的Ralph:

git clone https://github.com/allegro/ralph.git

下载完成后,将目录更改为ralph / docker并使用以下命令初始化Ralph:

cd ralph/docker
docker-compose run web init

接下来,使用以下命令下载并构建Ralph的容器:

docker-compose up -d

Once all the containers are downloaded, you can check the running containers with the following command:

docker ps

You should see the following output:

CONTAINER ID        IMAGE                               COMMAND                  CREATED             STATUS              PORTS                     NAMES
6d99415b9569        allegro/ralph:latest                "/var/local/ralph/do…"   40 seconds ago      Up 38 seconds       0.0.0.0:32771->8000/tcp   docker_web_1
fcede6c8a3d3        allegro/inkpy:latest                "/bin/sh -c 'supervi…"   40 seconds ago      Up 38 seconds                                 docker_inkpy_1
c93bf3a397d5        redis:3.0                           "docker-entrypoint.s…"   6 minutes ago       Up 6 minutes        0.0.0.0:32770->6379/tcp   docker_redis_1
ac4f4c278443        mysql:5.7                           "docker-entrypoint.s…"   6 minutes ago       Up 6 minutes        3306/tcp, 33060/tcp       docker_db_1
b0e6a7beeb61        allegro/ralph-static-nginx:latest   "nginx -g 'daemon of…"   6 minutes ago       Up 3 seconds        0.0.0.0:80->80/tcp        docker_nginx_1

You can also check the ports of the all running container with the following command:

docker-compose ps

You should see the following output:Advertisements.banner-1{text-align:center; padding-top:10px !important;padding-bottom:10px !important;padding-left:0px !important;padding-right:0px !important;width:100% !important;box-sizing:border-box !important;background-color:#eeeeee !important;border: 1px solid #dfdfdf}

     Name                   Command               State            Ports         
---------------------------------------------------------------------------------
docker_db_1      docker-entrypoint.sh mysql ...   Up      3306/tcp, 33060/tcp    
docker_inkpy_1   /bin/sh -c supervisord -n        Up                             
docker_nginx_1   nginx -g daemon off;             Up      0.0.0.0:80->80/tcp     
docker_redis_1   docker-entrypoint.sh redis ...   Up      0.0.0.0:32770->6379/tcp
docker_web_1     /var/local/ralph/docker-en ...   Up      0.0.0.0:32771->8000/tcp

Access Ralph Web Interface

Now, open your web browser and type the URL http://your-server-ip. You should see the Ralph login page:

资产管理登录

Provide the default username as ralph and password as ralph, and click on the Log in button. You should see the Ralph default dashboard in the following page:

拉尔夫资产管理

Conclusion

恭喜你您已经在Ubuntu 20.04上成功安装了带有Docker的Ralph Asset Management System。现在,您可以从中央位置轻松管理您的IT资产。如有任何疑问,请随时问我。Advertisements.large-leaderboard-2{text-align:center; padding-top:10pximportant; padding-bottom:10pximportant; padding-left:0pximportant; padding-right:0pximportant; width:100%important; box-sizing:border-boximportant; background -color:#eeeeeeimportant; border:1px实心#dfdfdf}

 

资讯来源:由0x资讯编译自HOWTOFORGE,版权归作者所有,未经许可,不得转载
你可能还喜欢