Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the common problems in Rancher Server

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces "what are the common problems of Rancher Server". In the daily operation, I believe many people have doubts about the common problems of Rancher Server. The editor consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful for you to answer the doubts of "what are the common problems of Rancher Server?" Next, please follow the editor to study!

1. What should I pay attention to when Docker runs the Rancher Server container?

You need to be careful not to use host mode when running the rancher server container. In some places in the program, localhost or 127.0.0.1 is defined. If the container network is set to host, it will access the host resources. Because the host does not have the corresponding resources, an error occurs when the rancher server container starts.

In the PS:docker command, if you use the-- network host parameter, then using-p 8080 after that will not take effect. Docker run-d-p 8080 rancher/server:stable

This command applies only to stand-alone test environments. If you want to use Rancher server for production, use an external database (mysql) or pass the

-v / xxx/mysql/:/var/lib/mysql-v / xxx/log/:/var/log/mysql-v / xxx/cattle/:/var/lib/cattle

Mount the data to the host. If you use an external database, you need to optimize the performance of the database in advance to ensure the best performance of Rancher.

2. How to export the internal database of the Rancher Server container?

You can export the database from the Rancher Server container with a simple Docker command.

Docker exec mysqldump cattle > dump.sql3, what version of Rancher am I running?

The version of Rancher is located on the left side of the footer of UI. If you click on the version number, you will be able to view detailed versions of other components.

4. What happens if I delete the host directly instead of deleting the host in Rancher UI?

If your host is deleted directly, Rancher Server will always display the host. The host is in the Reconnecting state and then goes to

Disconnected status. You can also add this node to the RANCHER cluster again by adding hosts. If you are no longer using this node, you can delete it in UI.

If you have services with health check added to automatically schedule to the status Disconnected host, CATTLE will reschedule these services to other hosts.

PS: if you use tag scheduling, if you have multiple hosts with the same scheduling tag, the service will be dispatched to other nodes with scheduling tags; if you select to run on a certain host, your application will not be able to run automatically on other hosts after the host is deleted. 5. How do I configure the host after the proxy server?

To configure the host after the proxy server, you need to configure the Docker daemon. For more information, refer to adding a custom host after the proxy server.

6. Why does the same host appear multiple times in UI?

Var/lib/rancher/state this folder on the host machine, which is used by Rancher to store the necessary information to identify the host.

The verification information of the host is saved in .authentication _ token. If the information changes, RANCHER will think that this is a new host. After you add the host, another same host will appear on the UI, and the first host will then be lost.

7. Where can I find the detailed log of the Rancher Server container?

Run docker logs to view the basic log in the Rancher Server container. To get more detailed logs, you can go inside the Rancher Server container and view the log files.

Enter docker exec-it bash inside the Rancher Server container and jump to cd / var/lib/cattle/logs/cat cattle-debug.log under the directory where the Cattle log is located.

Cattle-debug.log and cattle-error.log will appear in this directory. If you use this Rancher Server for a long time, you will find that we create a new log file every day.

8. Copy the Rancher Server log to the host

The following is the command to copy Rancher Server logs from the container to the host.

Docker cp: / var/lib/cattle/logs / local/path9, what happens if the IP of Rancher Server changes?

If you change the IP address of Rancher Server, you need to re-register the host with the new IP.

In Rancher, click system Administration-> system Settings to update the host registration address of the Rancher Server. Note that the port number exposed by Rancher Server must be included. By default, we recommend using port 8080 in the installation manual.

After the host registers the update, go to Infrastructure-> add Host-> customize. The docker run command to add the host will be updated. Using the updated command, run the command on all hosts in all environments of Rancher Server.

10. Rancher Server is running very slowly, how to optimize it?

There are probably some tasks that are dead for some reason. If you can view system management-> system processes in the interface, you will be able to see the contents of Running. If these tasks run for a long time (and fail), Rancher will end up using too much memory to track tasks. This leaves Rancher Server running out of memory.

In order to make the service responsive, you need to add more memory. Usually 4GB memory is enough.

You need to run the Rancher Server command again and add an additional option-e JAVA_OPTS= "- Xmx4096m"

Docker run-d-p 8080 JAVA_OPTS= 8080-- restart=unless-stopped-e JAVA_OPTS= "- Xmx4096m" rancher/server

Depending on how the MySQL database is set up, you may need to upgrade to add this option.

If you can't see the system administration-> system process due to lack of memory, you already have more memory after restarting Rancher Server. You should now be able to see this page and start fault analysis of the longest running process.

11. The data of Rancher Server database is growing too fast

Rancher Server automatically cleans up several database tables to prevent the database from growing too fast. If these tables are not cleaned up in time for you, use API to update the interval of the cleanup data.

By default, data generated in the container_event and service_ events tables 2 weeks ago is deleted. The setting in API is in seconds (1209600). The setting in API is events.purge.after.seconds.

By default, the data generated by the process_instance table 1 day ago will be deleted, and the setting in API is in seconds (86400). The setting in API is process_instance.purge.after.seconds.

To update the settings in API, you can jump to the http://:8080/v1/settings page, search for the settings you want to update, click links-> self to jump to the link you click to set, and click "Edit" on the side to change the 'value'. Remember that the value is in seconds.

12. Why does a failed Rancher Server upgrade cause the database to be locked?

If you just started running Rancher and found that it was permanently frozen, it may be that the liquibase database is locked. At startup, liquibase performs a mode migration. Its competitive conditions may leave a locked entry, which will prevent subsequent processes.

If you have just upgraded, there may be log locks in the MySQL database that have not been released in the Rancher Server log.

.... liquibase.exception.LockException: Could not acquire change log lock. Currently locked by

Release the database lock

Note: do not release the database lock unless there is an exception related to the log lock. If the upgrade time is too long due to data migration, releasing the database lock in this case may cause you to encounter other migration problems.

If you have created a Rancher Server data container based on the upgrade document, you need to exec to the rancher-data container to upgrade the DATABASECHANGELOGLOCK table and remove the lock, if you do not create the data container, you use exec to the container that contains your database.

Sudo docker exec-it mysql

Once you enter the Mysql database, you need to access the cattle database.

13. The administrator password has been forgotten. How can I reset the administrator password?

If there is a problem with your authentication (for example, the administrator forgot your password), you may not be able to access Rancher. To regain access to Rancher, you need to turn off access control in the database. To do this, you need to access the host running Rancher Server.

Ps: assuming that other users have been created before resetting the access control, if the authentication method remains unchanged, other user account information will not be affected except for the Super Admin (the first administrator created, ID is 1a1).

Assume that the database is a rancher built-in database

Docker exec-it mysql

Note: this is a container with an Rancher database. If you upgrade and create a Rancher data container, you need to use the ID of the Rancher data container instead of the Rancher Server container. The default password for the rancher built-in database is empty.

Select the Cattle database.

Mysql > use cattle

View the setting table.

Mysql > select * from setting

Change api.security.enabled to false and clear the value of api.auth.provider.configured.

Confirm that the changes take effect in the setting table.

Mysql > select * from setting

It may take about 1 minute to turn off authentication in the user interface, and then you can log in to Rancher Server without access control by refreshing the page.

When access control is turned off, anyone can use UI/API to access Rancher Server.

Refresh the page and restart access control in system Administration / access Control. Reopening the access control filled in the administrator user name will replace the original super administrator user name (ID is 1a1).

14. Rancher Compose Executor and Go-Machine-Service continue to restart

In a high-availability cluster, if you are using a proxy server and if rancher-compose-executor and go-machine-service are constantly rebooting, make sure that your proxy uses the correct protocol.

15. Why do you see Go-Machine-Service constantly rebooting in the log? What should I do?

Go-machine-service is a micro-service that connects to a Rancher API server through websocket. If you cannot connect, you will reboot and try again. If you are running a single-node Rancher Server, it will use your registered address for the host to connect to the Rancher API service. Check to see if the host registration address is accessible from inside the Rancher Sever container.

Docker exec-it bash curl-I / v1 in the Rancher-Server container

You should get a json response. If authentication is on, the response code should be 401. If authentication is not turned on, the response code should be 200. Verify that Rancher API Server can use these variables to verify the connection by logging in to the go-machine-service container and using the curl command with the parameters you provided to the container:

Docker exec-it bash in the go-machine-service container curl-I-u':'

You should get a json response and 200 response codes. If the curl command fails, there is a connectivity problem between go-machine-service and Rancher API server. If the curl command does not fail, the problem may be because go-machine-service is trying to establish a websocket connection instead of a normal http connection. If there is an agent or load balancing between the go-machine-service and the Rancher API server, verify that the agent supports websocket connections.

16. How often does Rancher Catalog synchronize

Http://X.X.X.X/v1/settings/catalog.refresh.interval.seconds defaults to 300 seconds and can be modified. Click setting to update immediately.

At this point, the study of "what are the common problems in Rancher Server" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report