Try Ubuntu Landscape on Xenial (by quqi99)

来源:互联网 发布:电视mac认证状态异常 编辑:程序博客网 时间:2024/06/02 04:57

版权声明:可以任意转载,转载时请务必以超链接形式标明文章原始出处和作者信息及本版权声明 (http://blog.csdn.net/quqi99)

Landscape is used for manage your Ubuntu Cluster remotely. You can install Landscape directly on a machine running Xenial (Ubuntu 16.04), this is called “Landscape On Premises.” It is free for up to 10 physical machines and 10 more virtual machines for a total of 20.

Install Landscape Server

; refer https://askubuntu.com/questions/549809/how-do-i-install-landscape-for-personal-usesudo ufw disablesudo add-apt-repository ppa:landscape/17.03sudo apt updatesudo apt install landscape-server-quickstart  ; register the landscape account using text based web brower, or visit 'https://<server-hostname>'sudo apt install links  links https://<server-hostname>

Register Landscape Clients

; now register ubuntu node; copy /etc/landscape/landscape_server.pem from landscape server to every ubuntu nodessudo nano /etc/landscape/client.conf  ssl_public_key = /etc/landscape/landscape_server.pemsudo apt install landscape-clientsudo landscape-config --computer-title "node2" --account-name standalone  --url https://xenial/message-system --ping-url http://xenial/ping --ok-no-register --silent; then accept this node in GUI page

Customized Installation for Landscape by Preseed

1, Prepare preseed.cfg and a customized script lds.sh

export DEBIAN_FRONTEND=noninteractiveapt-get install -y landscape-clientlandscape-client --daemon --pid-file /run/landscape.pidlandscape-config --computer-title "node2" --account-name standalone  --url https://xenial/message-system --ping-url http://xenial/ping --ok-no-register --silent --http-proxy PROXY-URL --https-proxy PROXY-URLkill $(cat /run/landscape.pid)

2, Use ‘python -m SimpleHTTPServer 8080’ to setup web server for them
3, After selecting language press F6 at installer welcome screen
4, Edit boot command and replace “file=/cdrom/preseed/ubuntu-server.seed” with “preseed/url=http://IP/preseed.cfg”
5, Press Enter and complete installation

Landscape start process

1, ubuntu-installer calls the following command to install landscape-client package [1] and [2].apt-install landscape-client || true2, landscape-client package continues to register client. *-proxy options will be writed to /etc/default/landscape-client# grep 'landscape-config' ./debian/landscape-client.postinst -A 11landscape-config --silent --ok-no-register \--computer-title "$COMPUTER_TITLE" \--account-name "$ACCOUNT_NAME" \--registration-key "$REGISTRATION_KEY" \--url "$URL" \--exchange-interval "$EXCHANGE_INTERVAL" \--urgent-exchange-interval "$URGENT_EXCHANGE_INTERVAL" \--ping-url "$PING_URL" \--ping-interval "$PING_INTERVAL" \--http-proxy "$HTTP_PROXY" \--https-proxy "$HTTPS_PROXY" \--tags "$TAGS"3, landscape-client package uses start-stop-daemon helper to start landscape-client daemon. But, installer's chroot will not allow to run start-stop-daemon [3], so we need to restart machine to do workaround.vim ./debian/landscape-client.initFULL_COMMAND="start-stop-daemon --start --quiet --oknodo --startas $DAEMON --pidfile $PIDFILE -g $DAEMON_GROUP -- --daemon --pid-file $PIDFILE"[1] http://bazaar.launchpad.net/~ubuntu-core-dev/pkgsel/ubuntu/revision/115[2] http://bazaar.launchpad.net/~ubuntu-core-dev/pkgsel/ubuntu/view/head:/debian/postinst#L197[3] https://github.com/linuxmint/ubiquity/blob/master/d-i/source/debian-installer-utils/chroot-setup.sh#L72

Appendix - How to Create Certificate

; above /etc/landscape/landscape_server.pem is created automatically by landscape-server-quickstart, you can also do it by hand.; create your own CA (Certificate Authority), then we will have ./demoCA/private/cakey.pem; refer https://help.landscape.canonical.com/LDS/SSL/usr/lib/ssl/misc/CA.pl -newca; generate an SSL certificate signed by your new CA, then we will have newkey.pem/usr/lib/ssl/misc/CA.pl -newreq-nodes; sign your newly created SSL certificate with your newly created CA, then we will have newcert.pem/usr/lib/ssl/misc/CA.pl -signreq; install the files to Landscapesudo mv newcert.pem /etc/ssl/certs/landscape.pemsudo mv newkey.pem /etc/ssl/private/landscape.keysudo cp demoCA/cacert.pem /etc/ssl/certs/landscape_server_ca.crt; make Landscape Clients trust the newly created CAcopy /etc/ssl/certs/landscape_server_ca.crt from the LDS server to the client's directory /usr/local/share/ca-certificates/ and run 'sudo update-ca-certificates'.; adding the certificate file to /etc/landscape/client.confssl_public_key = /usr/local/share/ca-certificates/landscape_server_ca.crt
原创粉丝点击