In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
In this issue, the editor will bring you about how to deploy a single Rancher Server container to use an external database. The article is rich in content and analyzed and described from a professional point of view. I hope you can get something after reading this article.
Rancher in addition to using an internal database, you can start a Rancher Server and use an external database. The startup command is the same as before, but adds some additional parameters to explain how to connect to your external database.
Note: in your external database, you only need to create the database name and database user in advance. Rancher automatically creates the database tables required by Rancher.
We need to create a data name in advance and create a login user specifically for rancher.
Create a database
CREATE DATABASE IF NOT EXISTS rancher COLLATE = 'utf8_general_ci' CHARACTER SET =' utf8'
Create dedicated users through rancher database and grant permissions
GRANT ALL ON rancher.* TO 'rancher'@'%' IDENTIFIED BY' rancher126.128'GRANT ALL ON rancher.* TO 'rancher'@'localhost' IDENTIFIED BY' rancher126.128'
To start a Rancher to connect to an external database, you need to add additional parameters to the command to start the container.
Docker run-d-- restart=unless-stopped-p 8080 rancher/server:stable-- db-host 172.17.0.1-- db-port 3306-- db-user rancher-- db-pass rancher126.128-- db-name rancher
Most input parameters have default values and are optional, only the address of-- db-host must be entered.
-db-host IP or hostname of MySQL server--db-port port of MySQL server (default: 3306)-db-user username for MySQL login (default: cattle)-db-pass password for MySQL login (default: cattle)-db-name MySQL database name to use (default: cattle)
The IP address of the host on the same LAN as the container is usually the first address of the IP address range corresponding to the docker0 (such as 172.0.17.1). In fact, this is not recommended in the micro-service architecture.
About the Mysql server that connects to the host in the Docker container
The MySQL of the host machine of Docker is used here. When Docker is started, ip addr is used to check the network condition of the host.
This is how the Rancher Server single container shared by the editor is deployed to use an external database. If you happen to have similar doubts, please refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.
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.