Automatic service start
This document describes how to configure the automatic pull-up of the Doris cluster to ensure that services are not pulled up in time after service breaks down due to special circumstances in the production environment.
The automatic pull-up service of FE and BE must be configured after the Doris cluster is completely set up.
Systemd Configures the Doris service
For details about systemd usage and parameter parsing, see here
sudo permission control
sudo permissions are required to control the doris service using systemd. To ensure the minimum granularity of sudo permission assignment, you can assign the systemd control permission of doris-fe and doris-be services to specified non-root users. Configure the systemctl management permission for doris-fe and doris-be in visudo.
1. Cmnd_Alias DORISCTL=/usr/bin/systemctl start doris-fe,/usr/bin/systemctl stop doris-fe,/usr/bin/systemctl start doris-be,/usr/bin/systemctl stop doris-be
3. ## Allow root to run any commands anywhere
4. root ALL=(ALL) ALL
5. doris ALL=(ALL) NOPASSWD:DORISCTL
Configuration procedure
- You should config the “JAVA_HOME” variable in the config file, both fe.conf and be.conf, or you can’t use the command “systemctl start” to start doris
1. echo "JAVA_HOME=your_java_home" >> /home/doris/fe/conf/fe.conf
2. echo "JAVA_HOME=your_java_home" >> /home/doris/be/conf/be.conf
2. Download the doris-fe.service file: doris-fe.service
3. The details of doris-fe.service are as follows:
``` 1. # Licensed to the Apache Software Foundation (ASF) under one 2. # or more contributor license agreements. See the NOTICE file 3. # distributed with this work for additional information 4. # regarding copyright ownership. The ASF licenses this file 5. # to you under the Apache License, Version 2.0 (the 6. # "License"); you may not use this file except in compliance 7. # with the License. You may obtain a copy of the License at 8. # 9. # http://www.apache.org/licenses/LICENSE-2.0 10. # 11. # Unless required by applicable law or agreed to in writing, 12. # software distributed under the License is distributed on an 13. # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14. # KIND, either express or implied. See the License for the 15. # specific language governing permissions and limitations 16. # under the License.
- [Unit]
- Description=Doris FE
- After=network-online.target
-
Wants=network-online.target
-
[Service]
- Type=forking
- User=root
- Group=root
- LimitCORE=infinity
- LimitNOFILE=200000
- Restart=on-failure
- RestartSec=30
- StartLimitInterval=120
- StartLimitBurst=3
- KillMode=none
- ExecStart=/home/doris/fe/bin/start_fe.sh --daemon
-
ExecStop=/home/doris/fe/bin/stop_fe.sh
-
[Install]
- WantedBy=multi-user.target ```
Matters needing attention
-
ExecStart and ExecStop are configured based on actual fe paths
-
Download the doris-be.service file : doris-be.service
- The details of doris-be.service are as follows:
``` 1. # Licensed to the Apache Software Foundation (ASF) under one 2. # or more contributor license agreements. See the NOTICE file 3. # distributed with this work for additional information 4. # regarding copyright ownership. The ASF licenses this file 5. # to you under the Apache License, Version 2.0 (the 6. # "License"); you may not use this file except in compliance 7. # with the License. You may obtain a copy of the License at 8. # 9. # http://www.apache.org/licenses/LICENSE-2.0 10. # 11. # Unless required by applicable law or agreed to in writing, 12. # software distributed under the License is distributed on an 13. # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14. # KIND, either express or implied. See the License for the 15. # specific language governing permissions and limitations 16. # under the License.
- [Unit]
- Description=Doris BE
- After=network-online.target
-
Wants=network-online.target
-
[Service]
- Type=forking
- User=root
- Group=root
- LimitCORE=infinity
- LimitNOFILE=200000
- Restart=on-failure
- RestartSec=30
- StartLimitInterval=120
- StartLimitBurst=3
- KillMode=none
- ExecStart=/home/doris/be/bin/start_be.sh --daemon
-
ExecStop=/home/doris/be/bin/stop_be.sh
-
[Install]
- WantedBy=multi-user.target ```
Matters needing attention
-
ExecStart and ExecStop are configured based on actual be paths
-
Service configuration
Place doris-fe.service and doris-be.service in the /usr/lib/systemd/system directory 2. Set self-start
After you add or modify the configuration file, you need to reload it
1. systemctl daemon-reload
Set the start, the essence is in the/etc/systemd/system/multi - user. Target. Wants/add service file link
1. systemctl enable doris-fe
2. systemctl enable doris-be
3. Service initiation
1. systemctl start doris-fe
2. systemctl start doris-be
Supervisor configures the Doris service
Supervisor Specific use and parameter analysis can be referred to here
Supervisor configuration automatically pulls up the supervisor configuration. You can install the supervisor directly using the yum command or manually using pip. The pip manual installation process is complicated, and only the yum deployment mode is displayed.Manual deployment refer to [here] (<http://supervisord.org/installing.html>) for installation deployment.
Configuration procedure
- yum Install supervisor
1. yum install epel-release
2. yum install -y supervisor
2. Start the service and view the status
1. systemctl enable supervisord # bootstrap
2. systemctl start supervisord # Start the supervisord service
3. systemctl status supervisord # Check the supervisord service status
4. ps -ef|grep supervisord # Check whether the supervisord process exists
3. Configure BE process management
``` 1. Modify the start_be.sh script remove the last symbol &
- vim /path/doris/be/bin/start_be.sh
- Take this code : nohup $LIMIT ${DORIS_HOME}/lib/palo_be "$@" >> $LOG_DIR/be.out 2>&1 </dev/null &
- Be changed to : nohup $LIMIT ${DORIS_HOME}/lib/palo_be "$@" >> $LOG_DIR/be.out 2>&1
