apache / apache/iotdb

how to make standalone version managed by systemd in centos7,i have tried,but always failed

Đang mở
#11,563 2 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Java
Star
6.4k
Fork
1.2k
Merge trung bình
1 ngày 23 giờ
Pull request đã merge (30 ngày)
115

Mô tả

[root@k8s-node1 iotdb]# cat /usr/lib/systemd/system/iotdb.service
[Unit]
Description=iotdb service
After=syslog.target

[Service]
Type = simple
Environment="IOTDB_HOME=/home/infrastracture/apache-[iotdb-1](https://issues.apache.org/jira/browse/IOTDB-1).2.2-all-bin"
User=root
Group=root
ExecStart = /home/infrastracture/apache-[iotdb-1](https://issues.apache.org/jira/browse/IOTDB-1).2.2-all-bin/sbin/start-standalone.sh
ExecStop = /home/infrastracture/apache-[iotdb-1](https://issues.apache.org/jira/browse/IOTDB-1).2.2-all-bin/sbin/stop-standalone.sh
Restart=on-failure

[Install]
WantedBy=multi-user.target

[root@k8s-node1 iotdb]# systemctl start iotdb
[root@k8s-node1 iotdb]# systemctl status iotdb
● iotdb.service - iotdb service
Loaded: loaded (/usr/lib/systemd/system/iotdb.service; disabled; vendor preset: disabled)
Active: deactivating (stop-sigterm) (Result: exit-code) since Thu 2023-11-16 19:53:20 CST; 1s ago
Process: 28329 ExecStop=/home/infrastracture/apache-[iotdb-1](https://issues.apache.org/jira/browse/IOTDB-1).2.2-all-bin/sbin/stop-standalone.sh (code=exited, status=1/FAILURE)
Process: 27587 ExecStart=/home/infrastracture/apache-[iotdb-1](https://issues.apache.org/jira/browse/IOTDB-1).2.2-all-bin/sbin/start-standalone.sh (code=exited, status=0/SUCCESS)
Main PID: 27587 (code=exited, status=0/SUCCESS)
Tasks: 72
Memory: 655.5M
CGroup: /system.slice/iotdb.service
└─27588 java -Dlogback.configurationFile=/home/infrastracture/apache-[iotdb-1](https://issues.apache.org/jira/browse/IOTDB-1).2.2-all-bin/sbin/../conf/logback-confignode.xml -DCONFIGNODE_HOME=/home/infrastracture/apache-[iotdb-1](https://issues.apache.org/jira/browse/IOTDB-1).2.2-...

Nov 16 19:53:17 k8s-node1 systemd[1]: Started iotdb service.
Nov 16 19:53:20 k8s-node1 start-standalone.sh[27587]: Execute start-standalone.sh finished, you can see more details in the logs of confignode and datanode
Nov 16 19:53:20 k8s-node1 stop-standalone.sh[28329]: Check whether the internal_port is used..., port is 10710
Nov 16 19:53:20 k8s-node1 stop-standalone.sh[28329]: Stop ConfigNode, PID: 27588
Nov 16 19:53:20 k8s-node1 stop-standalone.sh[28329]: Check whether the rpc_port is used..., port is 6667
Nov 16 19:53:20 k8s-node1 stop-standalone.sh[28329]: No DataNode to stop
Nov 16 19:53:20 k8s-node1 systemd[1]: iotdb.service: control process exited, code=exited status=1
[root@k8s-node1 iotdb]#
[root@k8s-node1 iotdb]#
[root@k8s-node1 iotdb]#
[root@k8s-node1 iotdb]# systemctl status iotdb
● iotdb.service - iotdb service
Loaded: loaded (/usr/lib/systemd/system/iotdb.service; disabled; vendor preset: disabled)
Active: active (running) since Thu 2023-11-16 19:53:57 CST; 2s ago
Process: 782 ExecStop=/home/infrastracture/apache-[iotdb-1](https://issues.apache.org/jira/browse/IOTDB-1).2.2-all-bin/sbin/stop-standalone.sh (code=exited, status=1/FAILURE)
Main PID: 1234 (start-standalon)
Tasks: 94
Memory: 553.4M
CGroup: /system.slice/iotdb.service
├─1234 /bin/bash /home/infrastracture/apache-[iotdb-1](https://issues.apache.org/jira/browse/IOTDB-1).2.2-all-bin/sbin/start-standalone.sh
├─1235 java -Dlogback.configurationFile=/home/infrastracture/apache-[iotdb-1](https://issues.apache.org/jira/browse/IOTDB-1).2.2-all-bin/sbin/../conf/logback-confignode.xml -DCONFIGNODE_HOME=/home/infrastracture/apache-[iotdb-1](https://issues.apache.org/jira/browse/IOTDB-1).2.2-a...
└─1236 sleep 3

Nov 16 19:53:57 k8s-node1 systemd[1]: Started iotdb service.
[root@k8s-node1 iotdb]#
[root@k8s-node1 iotdb]#
[root@k8s-node1 iotdb]#
[root@k8s-node1 iotdb]# systemctl status iotdb
● iotdb.service - iotdb service
Loaded: loaded (/usr/lib/systemd/system/iotdb.service; disabled; vendor preset: disabled)
Active: active (running) since Thu 2023-11-16 19:54:20 CST; 233ms ago
Process: 3417 ExecStop=/home/infrastracture/apache-[iotdb-1](https://issues.apache.org/jira/browse/IOTDB-1).2.2-all-bin/sbin/stop-standalone.sh (code=exited, status=1/FAILURE)
Main PID: 4122 (start-standalon)
Tasks: 6
Memory: 4.6M
CGroup: /system.slice/iotdb.service
├─4122 /bin/bash /home/infrastracture/apache-[iotdb-1](https://issues.apache.org/jira/browse/IOTDB-1).2.2-all-bin/sbin/start-standalone.sh
├─4123 bash /home/infrastracture/apache-[iotdb-1](https://issues.apache.org/jira/browse/IOTDB-1).2.2-all-bin/sbin/start-confignode.sh
├─4124 sleep 3
└─4148 bash /home/infrastracture/apache-[iotdb-1](https://issues.apache.org/jira/browse/IOTDB-1).2.2-all-bin/sbin/start-confignode.sh

Nov 16 19:54:20 k8s-node1 systemd[1]: Started iotdb service.
[root@k8s-node1 iotdb]#
[root@k8s-node1 iotdb]#
[root@k8s-node1 iotdb]#
[root@k8s-node1 iotdb]#
[root@k8s-node1 iotdb]# systemctl status iotdb
● iotdb.service - iotdb service
Loaded: loaded (/usr/lib/systemd/system/iotdb.service; disabled; vendor preset: disabled)
Active: deactivating (stop-sigterm) (Result: exit-code) since Thu 2023-11-16 19:54:23 CST; 1s ago
Process: 4716 ExecStop=/home/infrastracture/apache-[iotdb-1](https://issues.apache.org/jira/browse/IOTDB-1).2.2-all-bin/sbin/stop-standalone.sh (code=exited, status=1/FAILURE)
Process: 4122 ExecStart=/home/infrastracture/apache-[iotdb-1](https://issues.apache.org/jira/browse/IOTDB-1).2.2-all-bin/sbin/start-standalone.sh (code=exited, status=0/SUCCESS)
Main PID: 4122 (code=exited, status=0/SUCCESS)
Tasks: 72
Memory: 660.4M
CGroup: /system.slice/iotdb.service
└─4123 java -Dlogback.configurationFile=/home/infrastracture/apache-[iotdb-1](https://issues.apache.org/jira/browse/IOTDB-1).2.2-all-bin/sbin/../conf/logback-confignode.xml -DCONFIGNODE_HOME=/home/infrastracture/apache-[iotdb-1](https://issues.apache.org/jira/browse/IOTDB-1).2.2-a...

Nov 16 19:54:20 k8s-node1 systemd[1]: Started iotdb service.
Nov 16 19:54:23 k8s-node1 start-standalone.sh[4122]: Execute start-standalone.sh finished, you can see more details in the logs of confignode and datanode
Nov 16 19:54:23 k8s-node1 stop-standalone.sh[4716]: Check whether the internal_port is used..., port is 10710
Nov 16 19:54:23 k8s-node1 stop-standalone.sh[4716]: Stop ConfigNode, PID: 4123
Nov 16 19:54:23 k8s-node1 stop-standalone.sh[4716]: Check whether the rpc_port is used..., port is 6667
Nov 16 19:54:24 k8s-node1 stop-standalone.sh[4716]: No DataNode to stop
Nov 16 19:54:24 k8s-node1 systemd[1]: iotdb.service: control process exited, code=exited status=1
[root@k8s-node1 iotdb]# systemctl status iotdb
● iotdb.service - iotdb service
Loaded: loaded (/usr/lib/systemd/system/iotdb.service; disabled; vendor preset: disabled)
Active: deactivating (stop-sigterm) (Result: exit-code) since Thu 2023-11-16 20:00:22 CST; 597ms ago
Process: 21778 ExecStop=/home/infrastracture/apache-[iotdb-1](https://issues.apache.org/jira/browse/IOTDB-1).2.2-all-bin/sbin/stop-standalone.sh (code=exited, status=1/FAILURE)
Process: 21033 ExecStart=/home/infrastracture/apache-[iotdb-1](https://issues.apache.org/jira/browse/IOTDB-1).2.2-all-bin/sbin/start-standalone.sh (code=exited, status=0/SUCCESS)
Main PID: 21033 (code=exited, status=0/SUCCESS)
Tasks: 93
Memory: 675.2M
CGroup: /system.slice/iotdb.service
└─21034 java -Dlogback.configurationFile=/home/infrastracture/apache-[iotdb-1](https://issues.apache.org/jira/browse/IOTDB-1).2.2-all-bin/sbin/../conf/logback-confignode.xml -DCONFIGNODE_HOME=/home/infrastracture/apache-[iotdb-1](https://issues.apache.org/jira/browse/IOTDB-1).2.2-...

Nov 16 20:00:19 k8s-node1 systemd[1]: Started iotdb service.
Nov 16 20:00:22 k8s-node1 start-standalone.sh[21033]: Execute start-standalone.sh finished, you can see more details in the logs of confignode and datanode
Nov 16 20:00:22 k8s-node1 stop-standalone.sh[21778]: Check whether the internal_port is used..., port is 10710
Nov 16 20:00:22 k8s-node1 stop-standalone.sh[21778]: Stop ConfigNode, PID: 21034
Nov 16 20:00:22 k8s-node1 stop-standalone.sh[21778]: Check whether the rpc_port is used..., port is 6667
Nov 16 20:00:22 k8s-node1 stop-standalone.sh[21778]: No DataNode to stop
Nov 16 20:00:22 k8s-node1 systemd[1]: iotdb.service: control process exited, code=exited status=1

Nov 16 20:00:07 k8s-node1 start-standalone.sh: Execute start-standalone.sh finished, you can see more details in the logs of confignode and datanode
Nov 16 20:00:07 k8s-node1 stop-standalone.sh: Check whether the internal_port is used..., port is 10710
Nov 16 20:00:07 k8s-node1 stop-standalone.sh: Stop ConfigNode, PID: 19158
Nov 16 20:00:07 k8s-node1 stop-standalone.sh: Check whether the rpc_port is used..., port is 6667
Nov 16 20:00:07 k8s-node1 stop-standalone.sh: No DataNode to stop
Nov 16 20:00:07 k8s-node1 systemd: iotdb.service: control process exited, code=exited status=1

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Start with the shown /usr/lib/systemd/system/iotdb.service unit and the sbin/start-standalone.sh and sbin/stop-standalone.sh entry points. Reproduce the service lifecycle on CentOS 7 and inspect how systemd tracks the Java process; done means the service stays active after start and stops cleanly without the reported failure.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
centos, java, shell
Lĩnh vực
databases, devops
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
30/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.