找回密码
 注册
查看: 13|回复: 0

配置es的鉴权账号 Elasticsearch开启安全认证详细步骤

[复制链接]

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
发表于 2024-10-31 15:00:04 | 显示全部楼层 |阅读模式
启动集群:
  R! k& A/ q. d3 B2 `$ A
) p0 ]' E( N1 O7 c$ e前提:设置好系统配置和JVM堆内存: X: R$ ?/ y2 y. d; h( Q

2 q5 g8 H! g$ M. F$ u8 z创建elastic的数据和日志存放目录,如果是测试环境无所谓,如果是生成环境一定要单独设置数据和日志存放的路径,因为ES可能因为升级或其它原因把原有的数据清理或丢失等因素
9 n; S: w8 N$ d% {$ u1 y$ W8 ~4 V  ]& k3 l' a# @# |6 ?

% m3 p4 `4 s2 [1 G6 @  \! o3 T/ l6 H0 A4 w8 o

# A2 j; \4 p7 F' @& p$ N: _配置文件属组权限,并启动
4 V4 u- t1 z! p+ O[root@it-elassearch elasticsearch]# chown -R es:es elastic-cluster1/! N! U( Y: T. e* i5 ]+ [( Y
[root@it-elassearch-2 elasticsearch]# chown -R es:es elastic-cluster2/7 m3 [/ K# V) U# ?; K8 S8 E! A

; ?8 f8 w/ c/ f6 q  O4 M

: l& d. V  h7 E7 Q9 [  x7 r$ Z$ p0 ]7 y" ~3 N0 d) H! ^* k
如果添加鉴权配置请按照此处配置,不配置即可略过:
  i7 D; i: ]7 @

. k; o4 j, Q# g  ?; @. [9 ]  b1 u

. E. z, a5 J! U* n1 ]% \生成密匙:
& s8 a& b+ n! j  v[es@it-elassearch elasticsearch-8.15.0]$ ./bin/elasticsearch-certutil ca
# F: f! W4 S# n! }% xThis tool assists you in the generation of X.509 certificates and certificate
/ w- L& F2 G( a' m& ]signing requests for use with SSL/TLS in the Elastic stack.: P3 v# Q9 Y) p, W: w3 A

+ ^* p- |$ K4 D( L) B/ T
% f1 E, ?. m' F8 S
The 'ca' mode generates a new 'certificate authority'& Y  O2 C/ d/ @% _  D( ]
This will create a new X.509 certificate and private key that can be used4 M8 V3 N4 h- |* E3 g
to sign certificate when running in 'cert' mode., N' p* Q" L9 b3 X% A% u1 L* Q
' S" _& }. O; e
# e" y! s1 r7 U: W/ f
Use the 'ca-dn' option if you wish to configure the 'distinguished name'6 ]9 I1 K" F8 G0 k8 ^* _
of the certificate authority& q  ^, m  o; y9 f5 w8 A

9 u- L1 I7 F  ~
! V" W7 Q. K/ e1 I2 K" r
By default the 'ca' mode produces a single PKCS#12 output file which holds:
  ?' S% V! X4 n! e" p+ J# R  K    * The CA certificate+ F+ `& W2 z" @
    * The CA's private key0 m2 Q( V$ `: {+ _

, x1 J1 T) q. X$ l0 n6 ]
; d' S6 X' `6 W7 y7 C7 {; z
If you elect to generate PEM format certificates (the -pem option), then the output will- n; Z& m# }" c; G9 e- d
be a zip file containing individual files for the CA certificate and private key: o- Q. q* J8 ]4 Y7 g& M
( T. k3 L. i0 T; a& G* [6 K
Please enter the desired output file [elastic-stack-ca.p12]:         【这里忽略,直接回车进入下面输入密码:】
" X2 p5 p2 U; a( D- ^; `" L' D3 S/ vEnter password for elastic-stack-ca.p12 :    【输入密码】
! r, J5 g1 F" p5 F; X# R

. k1 P6 N" [( \5 b. z1 ]

4 \2 o. T; G8 p2 g6 E
4 \; @! L7 e- `# m
[es@it-elassearch elasticsearch-8.15.0]$ ll( V  G+ ^( R; E# ~0 ?- ~6 o' C2 Z
total 22684 S2 s$ \+ c" m6 i, \/ H
......- Y: y% W$ i* r+ s- [
-rw-------  1 es es    2672 Oct 28 17:05 elastic-stack-ca.p12# S$ ]" q7 A/ H9 T3 m4 K
......
* X3 P+ U7 i  M" D5 A1 p5 s
0 |+ J) e# H. x( o8 `/ l4 w

) U3 {* r0 U% k/ ]$ B8 k$ F) Y
0 Z8 L0 h1 S9 |! z* F. C- L+ [; P4 x! g# P
7 ~2 n3 x- v* {; S8 B
0 O& V+ O! k* a4 ]; d
[es@it-elassearch-2 elasticsearch-8.15.0]$ ./bin/elasticsearch-certutil ca
! M2 y. G4 D5 E, J& p/ E. F3 A- GThis tool assists you in the generation of X.509 certificates and certificate
1 G% R. \, j" g9 g0 R  Wsigning requests for use with SSL/TLS in the Elastic stack.3 n: H) Z. N4 j7 @0 A) J; q

' d% m* D' q' P' w% _6 Z

/ k4 m9 P6 [6 `; z7 z$ n- RThe 'ca' mode generates a new 'certificate authority'
% e+ F' @2 W5 k/ u6 yThis will create a new X.509 certificate and private key that can be used" k4 M& \0 D6 D" H9 q6 e% k& x
to sign certificate when running in 'cert' mode.8 J0 ^. h& L7 N4 w" C# H# V2 }2 F

6 X. m2 c3 o0 z- b) e, a

9 Y) Q* _3 j# n, ~( JUse the 'ca-dn' option if you wish to configure the 'distinguished name'
! G7 {& l  z! |2 I7 vof the certificate authority
5 x9 i# Z3 D  L: y! U1 m; m2 Y* N# b  s

! v2 T- T9 {* \6 w. w9 uBy default the 'ca' mode produces a single PKCS#12 output file which holds:/ [+ a3 p) @1 b
    * The CA certificate8 R/ Q8 ^9 z1 J% A, F0 E; ?# p
    * The CA's private key
) W. C: m' U' J- b& w/ z
  z$ f# G: X" u/ O8 v8 e4 O. f! u* V( x
- W3 V5 K; n" C8 {; Q
If you elect to generate PEM format certificates (the -pem option), then the output will
6 g, X6 B4 U3 Y4 l* cbe a zip file containing individual files for the CA certificate and private key
! q, H1 O  A, M* x! c- X, F" y' I) b) K# k+ Y( d7 o

; m: a3 U- K  F0 ^  @( QPlease enter the desired output file [elastic-stack-ca.p12]:* `2 g, b1 q- v- V% Z1 ?
Enter password for elastic-stack-ca.p12 :
2 x1 I8 u& m- H  X5 f) C
" G$ r; ^8 q+ k/ h5 Y# r
7 Z5 c4 y( @8 z6 h1 ]生成密钥:
% T8 V0 q6 E: q" }, e/ J- [' K

; F, C# L9 u8 ]; R; y1 e
* I( Y6 Z6 ]& R) c) ]! H) v2 O
[es@it-elassearch elasticsearch-8.15.0]$ ./bin/elasticsearch-certutil cert --ca elastic-stack-ca.p12 6 {5 ]  E) N: ]4 o  D, l4 v( M
This tool assists you in the generation of X.509 certificates and certificate
% |$ V7 w' i$ \4 Csigning requests for use with SSL/TLS in the Elastic stack.% W0 y& Y3 G0 h& m* C

8 U2 F6 R, \! c( X+ g: H0 v! J/ r% [The 'cert' mode generates X.509 certificate and private keys.
3 O. E- z: f( Q    * By default, this generates a single certificate and key for use
5 N# e- _. V( \4 \( c/ {7 l6 {% l       on a single instance.
3 Q+ K8 U# A, ]1 |2 Z9 N    * The '-multiple' option will prompt you to enter details for multiple
" w! E; _6 N- s, L- T* ^       instances and will generate a certificate and key for each one
* n6 q1 F  z9 y9 U% @$ U3 `    * The '-in' option allows for the certificate generation to be automated by describing
; J  m- r) T3 k8 G7 ]! ?       the details of each instance in a YAML file  o  y3 v. ]# m" @8 S( E7 @

3 }& P: A. \, K8 \- Q; M2 V7 G    * An instance is any piece of the Elastic Stack that requires an SSL certificate./ k( x7 M1 v8 ~) T3 X& ^* j+ M9 y
      Depending on your configuration, Elasticsearch, Logstash, Kibana, and Beats
: N5 H/ s' ^5 c$ v      may all require a certificate and private key.
/ V# [7 j/ N% D1 }& ^3 l    * The minimum required value for each instance is a name. This can simply be the/ l; r& p$ F# r$ E2 t. i0 l
      hostname, which will be used as the Common Name of the certificate. A full) Y; G3 X* {5 T- a
      distinguished name may also be used.
) k8 ~  i( k: Z8 P- J* F    * A filename value may be required for each instance. This is necessary when the4 b- `5 h. ^1 x% N7 a
      name would result in an invalid file or directory name. The name provided here
% S' M/ K- U( X# s      is used as the directory name (within the zip) and the prefix for the key and) S& M" D! E, ]7 P& a
      certificate files. The filename is required if you are prompted and the name5 {! l. e. P7 W" i
      is not displayed in the prompt.
7 A0 a8 ?9 H+ C/ F    * IP addresses and DNS names are optional. Multiple values can be specified as a
0 w* o/ u3 w; m1 d      comma separated string. If no IP addresses or DNS names are provided, you may
- G# q! R+ q7 Z1 Q3 m( y- S      disable hostname verification in your SSL configuration.; s9 B" V6 g5 _" I' X, G% H3 s2 b
/ f0 F" ?$ a0 L* {; }
) {* R2 m  I5 g' Q5 ~2 @
    * All certificates generated by this tool will be signed by a certificate authority (CA)
# m# K& z0 l& t9 ~      unless the --self-signed command line option is specified.
. ~7 J4 F+ b5 z: E- A+ ^, f- x5 M      The tool can automatically generate a new CA for you, or you can provide your own with' E- ~' }- o/ \9 H& b7 k
      the --ca or --ca-cert command line options.6 n/ C( t% u0 d1 {. c* I* e

! [1 A. v, Y  v3 Y' F9 n( C2 D" o
4 e8 `2 W6 Z+ i& R/ T! Y" j* X* FBy default the 'cert' mode produces a single PKCS#12 output file which holds:
, t% q$ o5 T$ b/ \7 J4 l- w; D    * The instance certificate
0 t! _% b6 z7 R* `  u    * The private key for the instance certificate; e/ n- @0 ]3 g1 u3 {
    * The CA certificate7 b  }4 ~0 u* l8 _5 c

5 D4 Z7 K) j% vIf you specify any of the following options:0 |% S  `: P3 L9 t$ v6 c' G4 }
    * -pem (PEM formatted output)
1 c9 P; w7 b" `6 |0 u4 u    * -multiple (generate multiple certificates)
1 ^/ M8 N# ~6 ]0 y% L5 j1 }    * -in (generate certificates from an input file)8 C$ u$ o$ Q$ i% o" s$ E
then the output will be be a zip file containing individual certificate/key files6 ]' `" _- S3 K) c: {3 M
) q8 E9 y: I1 [# t* K. n
Enter password for CA (elastic-stack-ca.p12) :      【输入密码】. K; y2 ^0 Q9 t) ~& _# J: G" l
Please enter the desired output file [elastic-certificates.p12]:      【直接回车】
- o" g& w  T9 U" N$ rEnter password for elastic-certificates.p12 :     【再次输入密码】
# p7 B) v9 j! J, F% ?" N' ~3 ~0 q* e3 n' ]* X: L
Certificates written to /data/elasticsearch/elastic-cluster1/elasticsearch-8.15.0/elastic-certificates.p12* g, G6 D& H9 @) q! s# k

+ z1 j- e7 u8 VThis file should be properly secured as it contains the private key for
9 C4 ^+ e4 k. W( R% Byour instance.
0 @( f, X) D( g& Y: FThis file is a self contained file and can be copied and used 'as is'
7 j, \& _- m, V! {: Y: ^% B7 o! _" FFor each Elastic product that you wish to configure, you should copy" |% R9 i! |" k" ^8 r4 V. k9 Q
this '.p12' file to the relevant configuration directory- X! H$ S: q+ O6 b( \
and then follow the SSL configuration instructions in the product guide.' [$ R. k$ E% R" _$ X

' F7 n5 T. @: T  q0 k" sFor client applications, you may only need to copy the CA certificate and% q  ~7 z# L+ _% @% Z
configure the client to trust this certificate.
4 ]# v  o; q& M3 n5 A: I% A$ C% q0 n8 H" [
. W) Y" }4 ~) a1 ]) I4 g9 |

  J* t. _) c9 d  B& k8 T[es@it-elassearch-2 elasticsearch-8.15.0]$ ./bin/elasticsearch-certutil cert --ca elastic-stack-ca.p12 % M1 L, j5 k  L
This tool assists you in the generation of X.509 certificates and certificate
  b" ]: ~# _; f: gsigning requests for use with SSL/TLS in the Elastic stack.1 v9 J4 S& b% D7 v* d" A9 f

( @2 |* i4 X3 n. I# |, x  F" _* `The 'cert' mode generates X.509 certificate and private keys.4 V6 K  f" v( T% `0 A1 Z, Q6 w4 S
    * By default, this generates a single certificate and key for use9 ]8 t. p$ R( S" z9 B! K& v8 h5 J! [
       on a single instance.
! E$ \4 _! r) L/ t    * The '-multiple' option will prompt you to enter details for multiple9 T; U( u! v& C5 b6 o5 k
       instances and will generate a certificate and key for each one
, v0 H* e; L5 b2 A, h    * The '-in' option allows for the certificate generation to be automated by describing
1 f, d* u; b) C/ n       the details of each instance in a YAML file$ o+ J3 y0 X5 z$ {5 A) }3 l4 H3 a
/ l2 `, K2 f9 n* W" g4 G
    * An instance is any piece of the Elastic Stack that requires an SSL certificate.5 p6 D5 w' ~1 p6 Y
      Depending on your configuration, Elasticsearch, Logstash, Kibana, and Beats+ F  y3 `' d2 K1 O2 i
      may all require a certificate and private key.: ]: c+ ~: s, R5 y$ [
    * The minimum required value for each instance is a name. This can simply be the9 S1 q1 n: \7 R' |3 K
      hostname, which will be used as the Common Name of the certificate. A full  h9 O5 S2 a& E( y
      distinguished name may also be used.
' Y* |1 E: a. ?7 y    * A filename value may be required for each instance. This is necessary when the
4 P4 S: B$ K7 [$ m! e! E% p4 R. z! D      name would result in an invalid file or directory name. The name provided here' ~! j% B1 J* b, x6 O
      is used as the directory name (within the zip) and the prefix for the key and
9 |- A( E* U* i4 L: x      certificate files. The filename is required if you are prompted and the name
3 @2 F' x- d- y% n" o      is not displayed in the prompt.9 b7 x2 }. _! h- D! }. c- Q
    * IP addresses and DNS names are optional. Multiple values can be specified as a* C8 y4 P% i: f0 {- P: v/ b6 l$ H! z+ v
      comma separated string. If no IP addresses or DNS names are provided, you may
, }4 @$ r/ a! o7 [8 V      disable hostname verification in your SSL configuration.
. K* n$ `2 \. d0 [& ?7 \7 }! V: b' `# H- W" z

+ `, }( A1 s; g* s& a    * All certificates generated by this tool will be signed by a certificate authority (CA)
1 c5 b8 S0 {- g7 z      unless the --self-signed command line option is specified.
, O3 t9 {  l0 s5 m8 z      The tool can automatically generate a new CA for you, or you can provide your own with5 p  ^! U0 U0 y' Y# A# I
      the --ca or --ca-cert command line options.$ W( c+ H- I4 |& e- I6 |
6 D# Z2 M  ]7 L8 J- ^

; L2 \- j0 U, a  v, }* k( EBy default the 'cert' mode produces a single PKCS#12 output file which holds:
% X1 ^: d- O( S8 _2 M/ U" Y    * The instance certificate
: z( U$ n8 b+ M4 ^    * The private key for the instance certificate
9 e3 Q; O: t! y5 G    * The CA certificate
  a; `* E/ ~) D3 V
6 z( W: F! \# t1 VIf you specify any of the following options:. y  [0 v" s& h. R7 ~
    * -pem (PEM formatted output)! X3 s! [! n  n8 Z) n+ }7 @
    * -multiple (generate multiple certificates)
% d2 Q; s8 @& L5 Z/ r$ D    * -in (generate certificates from an input file)' y0 ]7 R8 \7 s% F# L$ C0 ^1 q# r
then the output will be be a zip file containing individual certificate/key files9 ]: v% i5 c% k6 |3 t. ?

& T( N" B4 S- }2 {7 jEnter password for CA (elastic-stack-ca.p12) :   【输入密码】
: m+ g* m3 F5 UPlease enter the desired output file [elastic-certificates.p12]:     【直接回车】
& k" e: {4 U( u. ?- |Enter password for elastic-certificates.p12 :   【输入密码】
2 `4 }" D9 q* {
6 |5 }& l5 A+ A3 P9 p1 C2 i4 \4 S1 Z5 rCertificates written to /data/elasticsearch/elastic-cluster2/elasticsearch-8.15.0/elastic-certificates.p12
  p& |1 f$ w, y. V, C! ^
' o$ H/ i7 @, F0 tThis file should be properly secured as it contains the private key for 2 [/ v( t2 C* D/ p( x% S% g
your instance.& V$ Z- D) r- I0 P# T! w
This file is a self contained file and can be copied and used 'as is'+ J6 e  [3 j; {8 \( S
For each Elastic product that you wish to configure, you should copy% t! q' H+ g% U
this '.p12' file to the relevant configuration directory
! x$ v6 T% b8 s+ Aand then follow the SSL configuration instructions in the product guide.$ s2 X: v- v2 x9 ?5 Y- ^, i

1 t4 u' i$ |) n- gFor client applications, you may only need to copy the CA certificate and
) r) _  c  D. b* X: o$ f. l0 T0 qconfigure the client to trust this certificate.
1 _6 g3 x  E0 y! C
' u5 s* y+ f! R6 b* f; u5 x' Z  z( O# T* P. W
##将凭证迁移到指定的目录:. {1 W# p  [: f4 @& g- d
创建目录:, ?1 X4 S9 ^# b1 P4 U' L
mkdir -p ./config/certificates/- ~3 W; f% S( p9 L9 J$ `/ g8 p& K
移动凭证到指定目录下:
$ l  B5 J: l( o; x! b+ ?2 ]mv elastic-certificates.p12 ./config/certificates/
* N* m+ N1 y0 v, G6 g( T
; I! L" y# S8 h5 q6 G6 c* q赋于权限:
/ X5 i) I9 j& ~. S# V) t/ C9 `2 K$ ^8 V  |5 ~4 D2 B! C( v0 M% \% Z
6 N- z: ~( f. f9 f& F! x
[es@it-elassearch elasticsearch-8.15.0]$ rsync -azvP -e 'ssh -p 22' config/certificates/elastic-certificates.p12 es@172.24.110.126:/data/elasticsearch/elastic-cluster2/elasticsearch-8.15.0/config/certificates/elastic-certificates.p12
& J- v# f) i/ q" O( ~: ZThe authenticity of host '[172.24.110.126]:22 ([172.24.110.126]:22)' can't be established.
& ?  t4 K* {' X; p1 s, QECDSA key fingerprint is SHA256:Tvzi0ICzurMYEPySzerkOmwk/o7XHxmABVKRigofHzg.7 A. U8 b2 t. S; E- ^5 B' q
ECDSA key fingerprint is MD5:f0:92:26:fd:da:d3:e4:db:be:36:b1:fe:d6:2b:65:25.3 n: f; E: I4 T/ Y
Are you sure you want to continue connecting (yes/no)? yes/ w# b. v+ [, [9 w3 \3 `7 @6 y0 o8 c
Warning: Permanently added '[172.24.110.126]:22' (ECDSA) to the list of known hosts.
" r% \' K- i- E! D6 Ges@172.24.110.126's password:
: \: v  e/ c# hsending incremental file list
5 p9 u* E, C: |5 s  c9 selastic-certificates.p121 _& G0 ?5 {% g  ^) Z* [$ A
          3,596 100%    0.00kB/s    0:00:00 (xfr#1, to-chk=0/1)
# v" z( {  A5 N3 x( ]* p4 P3 ]2 _  i
, t( h6 @, k3 L
sent 3,631 bytes  received 35 bytes  564.00 bytes/sec
  B! A  O/ _0 A& V, g+ Utotal size is 3,596  speedup is 0.98
* J" x2 c8 }9 b' O, K
  ~  F" a' C6 C1 G6 H' d
修改配置文件(每台都需要添加)
$ c7 B# {0 ^, j- y$ b, \3 M6 A
  }# D' m, ~* E( {  u

( Z, K/ S+ E! fhttp.cors.enabled: true
1 T: ?: v+ J7 h+ T* @. c# F2 ^http.cors.allow-origin: "*", A" i' ?( H1 X: ]0 k
http.cors.allow-headers: Authorization,X-Requested-With,Content-Type,Content-Length% z0 w+ S- z& q, F
; n! l3 Z; e5 ^5 N' G. H

7 ~$ g5 y6 T7 Qxpack.security.enabled: true* @* e9 q* w: y! @: y
xpack.security.authc.accept_default_password: true
# ?, }: V' A2 `" j. C# mxpack.security.transport.ssl.enabled: true( s/ a% W; R* i
xpack.security.transport.ssl.verification_mode: certificate# O/ X1 V/ a# E. Z0 ]1 h, d$ N
xpack.security.transport.ssl.keystore.path: ./config/certificates/elastic-certificates.p12
- w8 |, w8 u0 i. P6 [1 n* [xpack.security.transport.ssl.truststore.path: ./config/certificates/elastic-certificates.p12
# _3 s1 l& O- H: [$ _+ u0 ~2 i
8 i' T# G0 m4 J& N. s5 ^
- r& s: d1 w3 ?( T1 [
在各个节点上添加密码:(每一台es都需要操作)

6 H; }4 i! i* U5 ?6 I$ B$ F0 i, n/ X2 c0 a7 u; N- ]
5 H" Z# j# i9 L' A2 O
1 D, j  M" O# U) v! k3 |3 l
: j- [# G4 \* r5 l: {9 j1 Z

2 Q5 Q" a+ k, C/ _8 t; C加权一样需要切换到es账号:6 T( C3 C6 ]0 X6 V# [

8 \# V5 O9 W- z0 z$ w在各个节点上添加密码:
0 Y3 |" w6 u2 {' U2 ?5 s+ w; t4 f$ z5 n( @
[es@it-elassearch elasticsearch-8.15.0]$ ./bin/elasticsearch-keystore add xpack.security.transport.ssl.keystore.secure_password2 [! r2 u8 ?5 y1 T
[es@it-elassearch elasticsearch-8.15.0]$ ./bin/elasticsearch-keystore add xpack.security.transport.ssl.keystore.secure_password
8 B# Z+ O# [& x; jEnter value for xpack.security.transport.ssl.keystore.secure_password:" c/ X+ [7 ?' v. [; u$ O4 a1 f
& x5 X* l# ?8 h* f( k. V8 I0 V& A

; s/ a0 O- r1 v3 s3 j[es@it-elassearch-2 elasticsearch-8.15.0]$ ./bin/elasticsearch-keystore add xpack.security.transport.ssl.keystore.secure_password
7 B0 e) I! B& l: o& C+ e" VEnter value for xpack.security.transport.ssl.keystore.secure_password:9 \( Z1 S4 _. J; N( K3 Y5 z6 y
输入密码:第一次输入密码' I3 @. R/ G" b" m8 T

4 p# A- G1 g1 F$ _[es@it-elassearch elasticsearch-8.15.0]$ ./bin/elasticsearch-keystore add xpack.security.transport.ssl.truststore.secure_password+ m6 S7 D" _- _$ C" }# G; T
Enter value for xpack.security.transport.ssl.truststore.secure_password:
" G. _1 S6 q9 v# d9 [1 {) s. J/ {" {2 m* U* }& o- [3 m
[es@it-elassearch-2 elasticsearch-8.15.0]$ ./bin/elasticsearch-keystore add xpack.security.transport.ssl.truststore.secure_password! Z9 d/ Y) p4 K. b; ?$ a
Enter value for xpack.security.transport.ssl.truststore.secure_password:
3 P- I7 N" M5 o6 d$ b2 r# K3 [% E1 X0 l0 N- |# m

# d" E2 {- e! v- [; e- C% m  ~输入密码: 第二次输入上面的密码:
% v. f0 O, A' N; I
8 p: K' W% I2 J5 G( [+ ^
: ^/ {% ]2 i- C2 ^

. f+ `3 p5 l5 y$ M6 f! M: j* p; c8 |! k* P8 t* X. P$ I! L- C4 S' P
接下来和没有做鉴权的一样,逐个启动集群:# z$ C) ~% o* `- b/ |: ]4 g& a8 E
% ^  ?  I% y9 W- P, z

( `. F( B( u, g7 o# h1 J
; a! X& I- b; x4 _
切换到其它用户,root用户不能启动ES:su es
) e& L2 R+ b" |* e$ a# e* g. n- J6 R% S0 C6 l- K
% g% c5 A! E! h& ]

& @* N  l7 ~5 W4 S3 `bin/elasticsearch -d9 ~2 X( V% D' P) \1 B
[es@it-elassearch elasticsearch-8.15.0]$ bin/elasticsearch -d, Z2 Z( H& {- ]) B: [7 w

& U* [: f1 J( [/ ~0 D
$ S) ^% l$ d0 i4 J) j
; f0 U+ |0 S! R2 g  _

$ d& Y! I2 B/ _
% g) `& n6 l0 J! I! T0 Z5 s
您需要登录后才可以回帖 登录 | 注册

本版积分规则

返回首页|Archiver|手机版|小黑屋|易陆发现技术论坛 ( 蜀ICP备2026014127号-1 )

GMT+8, 2026-6-12 01:49 , Processed in 0.016184 second(s), 22 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表