In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Deployment environment:
Operating system: CentOS 7
Install iptables, disable firewall, clear iptables rules and save
Close SELinux
Upgrade kernel yum-y update
Docker version: 17.03.1-ce
Download sources for other versions of Docker
Supported Docker version
Before you start deploying Rancher, you need to make sure that the above environment is not a problem.
Start deployment:
Deployment MySQL (installation process omitted) .5.6.x version is recommended
Create a library
CREATE DATABASE IF NOT EXISTS cattle COLLATE = 'utf8_general_ci' CHARACTER SET =' utf8'
Create database authorization
GRANT ALL ON cattle.* TO 'cattle'@'%' IDENTIFIED BY' cattle';GRANT ALL ON cattle.* TO 'cattle'@'localhost' IDENTIFIED BY' cattle'
Deploy Rancher-Server (deploy cluster mode)
Execute on the A server
Sudo docker run-d-- restart=unless-stopped-p 8080 rancher/server-- db-host myhost.example.com-- db-port 3306-- db-user username-- db-pass password-- db-name cattle
-- db-host specifies the connection address of the MySQL server
-- db-port connection port
-- db-user connects to users
-- db-pass connection password
-- db-name connection library name
Execute on server B (same as server A, if there are other servers doing the same)
Configure Nginx reverse proxy
Edit / etc/nginx/conf.d/rancher.conf
Note: the configuration in location cannot be changed. Others can be changed according to their actual environment.
Upstream rancher {server 192.168.1.31 server 8080; server 192.168.1.32 server {listen 80; server_name rancher.aek.com; location / {proxy_set_header Host $host; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-Port $server_port; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for Proxy_pass http://rancher; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "Upgrade"; # This allows the ability for the execute shell window to remain open for up to 15 minutes. Without this parameter, the default is 1 minute and will automatically close. Proxy_read_timeout 900s;}}
Verification
Whether the Rancher-Server cluster has been successfully deployed and the browser accesses rancher.aek.com. Open the following interface to view if the red box shows the information of the two AB hosts, indicating that the cluster configuration is successful.
Note: if you are in cluster mode, if you want to upgrade or downgrade the versions of the two servers consistently, just delete the original Rancher-Server container, then start a new container, and follow step 2 to test it again.
test
Stop the Rancher-Server container of a host, whether it can still be accessed and operated.
Description
Rancher-Server is only a management platform. If the container on the Server side stops, the other containers running on the server will not stop, but you cannot use Rancher-Server to manage these container configurations, such as scheduling, starting, stopping, etc. When the Rancher-Server resumes work, it can be managed again. The main purpose of configuring the cluster is to prevent it from being able to manage if one is stopped.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.