Container choreography platform Ranche
Ranche is an open source enterprise-class full stack container deployment and management platform, host management, load balancing, firewalls, and more
Rancher Quick start
The
-
- installation rancher
# Download rancher
docker pull rancher/server
# Create the rancher container
docker run -d --name=myrancher -p 9091:8080 rancher/server
# View Brancher Logs
docker logs -f myranche
# Access
http://ip:9091/
Configure the environment
1. Top left corner default-->Environment Management-->Go to the Environment Add page.
2. Set the environment name and description, and check the template.
Example: pro, production environment, Cattle template
Add the host
1. Go inside an environment.
2.Click Add Host
3. Confirm the ip where the current rancher is located.
4. Fill in the IPs of all hosts to be managed.
5. Copy the instructions for registering the rancher to each host.
6. After the command is executed, refresh the list of hosts waiting to be displayed in the brancher.
Showing active means that the current state of the server is available, if it is red or shows reconnecting, then it is reconnected.
New application adds service container based on application
Rancher operates capacity expansion
Select the application, enter the list of containers under the application, and select the container to be expanded. After entering the application, directly click the + sign on the right menu to enlarge the container to be expanded. When creating the container to be expanded, the port number cannot be specified, otherwise it cannot be expanded
Rancher load balancing
The container can be expanded without specifying a port number, which requires access, and which can be used for load balancing
- click apply, enter the container list page and click the add load balancer button in the upper right corner, fill in the following order: name, description, [exposed] port, target, [container] port load balancer container startup time is very long, please be patient, please pay attention to open redis mapping port, otherwise you cannot access
Demo service upgrade [without notice]
- modify the code on the git commit to git using Jenkins find build tasks, click build immediately rancher to apply the service list, click update icon, check the first start after stop click ok in the process of upgrading, page access page before may be, it is possible that the page after only when all the upgrade is complete, all new service starts, the old service all stop, click on the icon in the top right corner of the upgrade completed again, it will delete all service, the upgrade is done