|
|
vim /usr/lib/systemd/system/etcd.service
8 z1 F* A& |# t0 W) L9 P# w( e[Unit]
1 X2 @- x3 ^4 r `0 f% l8 i& I& kDescription=Etcd Server( X$ c" A2 J5 t I* ~ Q* M( {
After=network.target
+ b7 t9 L( c% Q) M
8 ?' j1 \; ]( G[Service]
! {- f3 S. q7 j% UType=simple
7 z) h9 @, J, YWorkingDirectory=/var/lib/etcd/# f6 z0 O: Y! A. @, }3 E9 D* ]
EnvironmentFile=-/etc/etcd/etcd.conf
" l. i' P7 |% e4 q; x1 {$ L. [7 HExecStart=/usr/bin/etcd/ b% r+ t9 f6 J2 \5 T
7 w& F* Z- W8 l6 ]7 n
[Install]6 G# Z4 R5 {1 o0 k1 H. V# o9 t
WantedBy=multi-user.target1 N" _6 g4 D; G4 {
) i* k$ t7 P" t# W启动服务,并设置开机启动
7 W5 d7 x* g9 Q' Ssystemctl daemon-reload * h: l& R! A3 Z4 K# s5 P
systemctl start etcd.service
0 b n, r& ^( i% ^1 qsystemctl enable etcd.service |
|