Guacamole1.1.0 初探 - 安装

一、新特性

    1. 产品延续了1.0.0已有的功能,增加了最大头的功能便是"访问K8s-POD终端"功能,同时迁移FreeRDP至2.0。(传送门:http://guacamole.apache.org/releases/1.1.0/)

    相信以后对Win的支持会更好,新增加K8的支持,也是应了现在的普遍需求。

 

二、场景验证

    1. Guaca对K8s-POD终端远程的效果

 

三、基础架构说明 (官方传送门: http://guacamole.apache.org/doc/gug/guacamole-architecture.html#guacamole-protocol-architecture

        

             

四、 Guacamole部署

        1) 基于容器部署Guaca, 官方三件套:

                - Guacamole  https://hub.docker.com/r/guacamole/guacamole

                - Guacd        https://hub.docker.com/r/guacamole/guacd

                - Postgres     https://hub.docker.com/_/postgres

         2) 安装循序, Guacamole需要依赖前两者

              Guacd --> Postgres  --> Guacamole

 

         3) Guacd安装

              docker run --name some-guacd -d -p 4822:4822 guacamole/guacd

              解释:

                     run 启动一个容器

                     --name 容器名称,可以通过docker ps 查看已经启动的容器

                     -d 采用后台模式运行

                     -p 端口映射,Guacd本身的端口4822, 映射到服务器上我们也采用4822; 前者是服务器端口, 后者是Guacd服务端口。

                     guacamole/guacd 默认从dockerhub的guacamole拉取guacd服务,最后可以跟版本,什么都不写就是latest。

              这里的latest版本就是1.1.0, 如图:

             

 

 

 

 

         4) Postgres安装

            docker run --name some-postgres -e POSTGRES_PASSWORD=guaca123 -d postgres

            启动一个名字为"some-postgres"的Postgres容器。

 

         5) 初始化Guacamole表结构至Postgres

             通过docker ps 先获取Postgres容器的ID, docker ps | grep post

            

 

 

  

            然后从Guacamole容器中拉一份Postgres用的initdb.sql

            docker run --rm guacamole/guacamole /opt/guacamole/bin/initdb.sh --postgres > initdb.sql

            解释:

                    --rm 镜像用完之后直接销毁。

 

            这时候当前目录会生产出一份 initdb.sql的文件,将他拷贝至Postgres容器的根目录下:

            docker cp initdb.sql 0650b8ece837:/ 

 

             现在进入Postgres容器终端:

             docker exec -it  0650b8ece837  /bin/bash

             su - postgres  

             psql

             create database guacamole_db;  # 创建guacamole_db数据库

             create user guacamole_user with password 'some_password';   # 创建guacamole_user用户

             grant all privileges on database guacamole_db to guacamole_user;  # 将guacamole_db的最大权限给guacamole_user一份

             \q # 退出数据库

             -------------------------------------------------------------------------------------------

             

              psql -d guacamole_db -U guacamole_user -f initdb.sql  # 导入数据至guacamole_db数据库

              解释:

                      -d 数据库名称

                      -U 用户名称

                      -f   要导入的SQL文件

 

         6) Guacamole安装

             docker run --name some-guacamole --link some-guacd:guacd \

             --link some-postgres:postgres \

             -e POSTGRES_DATABASE=guacamole_db \
             -e POSTGRES_USER=guacamole_user \
             -e POSTGRES_PASSWORD=some_password \
             -d -p 8989:8080 guacamole/guacamole

             解释:

                    --link 用来关联guacd和Postgres两个容器

                     -e    配置参数需要与刚刚创建Postgres的信息对应上

 

         等待安装过程就好,最后会得到三个容器

         

         7) 访问Guacamole

              http://xxx.xxx.xxx.xxx:8989/guacamole

              默认用户名, 密码: guacadmin

              

 

 

 

 

     

posted @ 2020-03-18 15:52  九个问题  阅读(1582)  评论(0编辑  收藏  举报