先自我介紹一下,小編浙江大學(xué)畢業(yè),去過華為、字節(jié)跳動等大廠,目前阿里P7
深知大多數(shù)程序員,想要提升技能,往往是自己摸索成長,但自己不成體系的自學(xué)效果低效又漫長,而且極易碰到天花板技術(shù)停滯不前!
因此收集整理了一份《2024年最新網(wǎng)絡(luò)安全全套學(xué)習(xí)資料》,初衷也很簡單,就是希望能夠幫助到想自學(xué)提升又不知道該從何學(xué)起的朋友。
既有適合小白學(xué)習(xí)的零基礎(chǔ)資料,也有適合3年以上經(jīng)驗的小伙伴深入學(xué)習(xí)提升的進(jìn)階課程,涵蓋了95%以上網(wǎng)絡(luò)安全知識點,真正體系化!
由于文件比較多,這里只是將部分目錄截圖出來,全套包含大廠面經(jīng)、學(xué)習(xí)筆記、源碼講義、實戰(zhàn)項目、大綱路線、講解視頻,并且后續(xù)會持續(xù)更新
如果你需要這些資料,可以添加V獲取:vip204888 (備注網(wǎng)絡(luò)安全)
正文
修改limits.cong配置 /etc/security/limits.conf
- 修改如下
nofile 最大打開文件描述符數(shù)
nproc 最大進(jìn)程數(shù)
memlock 最大內(nèi)存鎖定
echo "* soft nofile 65536
-
hard nofile 131072
-
soft nproc 4096
-
hard nproc 4096
-
soft memlock unlimited
-
hard memlock unlimited" >> /etc/security/limits.conf
修改sysctl配置 /etc/sysctl.conf
- 修改如下
echo “vm.max_map_count = 262145” >> /etc/sysctl.conf
#生效
sysctl -p
修改es占用內(nèi)存 /opt/es/config/jvm.options
sed -i “s/-Xms1g/-Xms"800m”/g" /opt/es/config/jvm.options
sed -i “s/-Xmx1g/-Xmx"800m”/g" /opt/es/config/jvm.options
開啟ES內(nèi)存鎖定 /opt/es/config/elasticsearch.yml
- 增加如下配置
bootstrap.memory_lock: true
ES配置文件詳解
節(jié)點類型
- 主節(jié)點
候選主節(jié)點的設(shè)置方法是設(shè)置node.mater為true,默認(rèn)情況下,node.mater和node.data的值都為true,即該節(jié)點既可以做候選主節(jié)點也可以做數(shù)據(jù)節(jié)點。由于數(shù)據(jù)節(jié)點承載了數(shù)據(jù)的操作,負(fù)載通常都很高,所以隨著集群的擴大,建議將二者分離,設(shè)置專用的候選主節(jié)點。當(dāng)我們設(shè)置node.data為false,就將節(jié)點設(shè)置為專用的候選主節(jié)點了。
node.master: true
node.data: false
- 數(shù)據(jù)節(jié)點
數(shù)據(jù)節(jié)點負(fù)責(zé)數(shù)據(jù)的存儲和相關(guān)具體操作,比如CRUD、搜索、聚合。所以,數(shù)據(jù)節(jié)點對機器配置要求比較高,首先需要有足夠的磁盤空間來存儲數(shù)據(jù),其次數(shù)據(jù)操作對系統(tǒng)CPU、Memory和IO的性能消耗都很大。通常隨著集群的擴大,需要增加更多的數(shù)據(jù)節(jié)點來提高可用性。
node.master: false
node.data: true
- client節(jié)點
即不會被選作主節(jié)點,也不會存儲任何索引數(shù)據(jù)。該節(jié)點只能處理路由請求,處理搜索,分發(fā)索引操作等,從本質(zhì)上來說該客戶節(jié)點表現(xiàn)為智能負(fù)載平衡器。
node.master = false
node.data = false
配置集群名稱
-
不同的節(jié)點配置同一個cluster.name可組成同一個集群,確保不同的集群使用不同的cluster.name
-
配置如下 :
cluster.name: es-cluster-test
配置ES節(jié)點名稱
-
node.name表示集群節(jié)點的名稱,集群中節(jié)點進(jìn)行區(qū)分,如果不配置則默認(rèn)為主機名
-
配置如下
node.name: es01
配置ES節(jié)點監(jiān)聽地址
- 如果不配置,默認(rèn)是監(jiān)聽在127.0.0.1?和?[::1],同時以development的方式啟動。
#監(jiān)聽在指定ip上
network.host : 172.17.0.1
#監(jiān)聽在所有ip上
network.host : 0.0.0.0
日志數(shù)據(jù)路徑配置
- 配置方式
path.data: /opt/data/es
path.logs: /opt/log/es
path:
data: /opt/data/es
logs: /opt/log/es
- path.data, 可以設(shè)置多個目錄
path:
logs: /opt/log/es
data:
-
/opt/data/es-A
-
/opt/data/es-B
-
/opt/data/es-C
集群發(fā)現(xiàn)配置
- discovery.seed_hosts 配置方式如下
用于多個集群節(jié)點進(jìn)行發(fā)現(xiàn),組成集群
discovery.seed_hosts: [“192.168.1.10:9300”, “192.168.1.11”, “seeds.mydomain.com”]
discovery.seed_hosts:
-
192.168.1.10:9300
-
192.168.1.11
-
seeds.mydomain.com
- cluster.initial_master_nodes 配置方式如下
用于集群在第一次啟動時,指定可以參與選舉的主節(jié)點列表 (node.master: true)
cluster.initial_master_nodes: [“es01”, “es02”, “es03”]
cluster.initial_master_nodes:
-es01
-es02
-es03
- discovery.seed_hosts 如果不配置,會自動監(jiān)聽本地回環(huán)地址 將本地多個elasticsearch實例加入到集群中。
jvm配置
- /opt/es/config/jvm.options (一般配置為機器內(nèi)存大小的一半)
sed -i “s/-Xms1g/-Xms"800m”/g" /opt/es/config/jvm.options
sed -i “s/-Xmx1g/-Xmx"800m”/g" /opt/es/config/jvm.options
配置Elasticsearch(本次測試配置)
es01
cluster.name: es-cluster-test
node.name: es01
path.logs: /opt/log/es
path.data: /opt/data/es
bootstrap.memory_lock: true
network.host: 0.0.0.0
http.port: 9200
transport.tcp.port: 9300
discovery.seed_hosts: [“172.16.1.236:9306”, “172.16.1.236:9307”]
cluster.initial_master_nodes: [“es01”, “es02”, “es03”]
es02
cluster.name: es-cluster-test
node.name: es02
path.logs: /opt/log/es
path.data: /opt/data/es
bootstrap.memory_lock: true
network.host: 0.0.0.0
http.port: 9200
transport.tcp.port: 9300
discovery.seed_hosts: [“172.16.1.236:9305”, “172.16.1.236:9307”]
cluster.initial_master_nodes: [“es01”, “es02”, “es03”]
es03
cluster.name: es-cluster-test
node.name: es03
path.logs: /opt/log/es
path.data: /opt/data/es
bootstrap.memory_lock: true
network.host: 0.0.0.0
http.port: 9200
transport.tcp.port: 9300
discovery.seed_hosts: [“172.16.1.236:9305”, “172.16.1.236:9306”]
cluster.initial_master_nodes: [“es01”, “es02”, “es03”]
啟動Elasticsearch
啟動
-
分別進(jìn)入不同的容器啟動elasticsearch
-
命令如下
/opt/es/bin/elasticsearch -d
查看容器狀況(容器內(nèi))
- 查看集群是否啟動成功
[elasticsearch@813bf8515935 /]$ curl localhost:9200/_cat/nodes
172.17.0.7 28 91 9 0.58 0.66 0.90 dilm - es02
172.17.0.6 15 91 5 0.58 0.66 0.90 dilm - es01
172.17.0.8 35 91 13 0.58 0.66 0.90 dilm * es03
- 查看當(dāng)前節(jié)點
[elasticsearch@813bf8515935 /]$ curl localhost:9200
{
“name” : “es03”,
“cluster_name” : “es-cluster-test”,
“cluster_uuid” : “Syj18FUrR1GdnGzghBIacQ”,
“version” : {
“number” : “7.6.2”,
“build_flavor” : “default”,
“build_type” : “tar”,
“build_hash” : “ef48eb35cf30adf4db14086e8aabd07ef6fb113f”,
“build_date” : “2020-03-26T06:34:37.794943Z”,
“build_snapshot” : false,
“l(fā)ucene_version” : “8.4.0”,
“minimum_wire_compatibility_version” : “6.8.0”,
“minimum_index_compatibility_version” : “6.0.0-beta1”
},
“tagline” : “You Know, for Search”
}
- 查看節(jié)點健康狀況
[elasticsearch@813bf8515935 /]$ curl localhost:9200/_cat/health?v
epoch timestamp cluster status node.total node.data shards pri relo init unassign pending_tasks max_task_wait_time active_shards_percent
1605859559 08:05:59 es-cluster-test green 3 3 0 0 0 0 0 0
-
100.0%
查看容器狀況(宿主機)
- 由于使用docker容器安裝,因此也可以通過宿主機映射端口訪問,本次測試宿主機為windows
開啟集群安全驗證
修改配置
- 分別在不同的Es節(jié)點修改配置開啟安全驗證
echo “xpack.security.enabled: true” >> /opt/es/config/elasticsearch.yml
echo “xpack.security.transport.ssl.enabled: true” >> /opt/es/config/elasticsearch.yml
生成證書
- 選擇其中一個節(jié)點生成CA證書,默認(rèn)情況下生成證書放在 /opt/es
#創(chuàng)建ca證書 /opt/es/bin/elasticsearch-certutil ca -v
[elasticsearch@c824e845075b es]$ /opt/es/bin/elasticsearch-certutil ca -v
This tool assists you in the generation of X.509 certificates and certificate
signing requests for use with SSL/TLS in the Elastic stack.
The ‘ca’ mode generates a new ‘certificate authority’
This will create a new X.509 certificate and private key that can be used
to sign certificate when running in ‘cert’ mode.
Use the ‘ca-dn’ option if you wish to configure the ‘distinguished name’
of the certificate authority
By default the ‘ca’ mode produces a single PKCS#12 output file which holds:
-
The CA certificate
-
The CA’s private key
If you elect to generate PEM format certificates (the -pem option), then the output will
be a zip file containing individual files for the CA certificate and private key
Please enter the desired output file [elastic-stack-ca.p12]: #輸入回車,使用默認(rèn)
Enter password for elastic-stack-ca.p12 : #回車,暫不輸入密碼
- 與上一步驟同一個節(jié)點創(chuàng)建節(jié)點見認(rèn)證用的證書
#創(chuàng)建節(jié)點間證書 /opt/es/bin/elasticsearch-certutil cert --ca elastic-stack-ca.p12
[elasticsearch@c824e845075b es]$ /opt/es/bin/elasticsearch-certutil cert --ca elastic-stack-ca.p12
This tool assists you in the generation of X.509 certificates and certificate
signing requests for use with SSL/TLS in the Elastic stack.
The ‘cert’ mode generates X.509 certificate and private keys.
- By default, this generates a single certificate and key for use
on a single instance.
- The ‘-multiple’ option will prompt you to enter details for multiple
instances and will generate a certificate and key for each one
- The ‘-in’ option allows for the certificate generation to be automated by describing
the details of each instance in a YAML file
- An instance is any piece of the Elastic Stack that requires an SSL certificate.
Depending on your configuration, Elasticsearch, Logstash, Kibana, and Beats
寫在最后
在結(jié)束之際,我想重申的是,學(xué)習(xí)并非如攀登險峻高峰,而是如滴水穿石般的持久累積。尤其當(dāng)我們步入工作崗位之后,持之以恒的學(xué)習(xí)變得愈發(fā)不易,如同在茫茫大海中獨自劃舟,稍有松懈便可能被巨浪吞噬。然而,對于我們程序員而言,學(xué)習(xí)是生存之本,是我們在激烈市場競爭中立于不敗之地的關(guān)鍵。一旦停止學(xué)習(xí),我們便如同逆水行舟,不進(jìn)則退,終將被時代的洪流所淘汰。因此,不斷汲取新知識,不僅是對自己的提升,更是對自己的一份珍貴投資。讓我們不斷磨礪自己,與時代共同進(jìn)步,書寫屬于我們的輝煌篇章。
需要完整版PDF學(xué)習(xí)資源私我
網(wǎng)上學(xué)習(xí)資料一大堆,但如果學(xué)到的知識不成體系,遇到問題時只是淺嘗輒止,不再深入研究,那么很難做到真正的技術(shù)提升。
需要這份系統(tǒng)化的資料的朋友,可以添加V獲取:vip204888 (備注網(wǎng)絡(luò)安全)
一個人可以走的很快,但一群人才能走的更遠(yuǎn)!不論你是正從事IT行業(yè)的老鳥或是對IT行業(yè)感興趣的新人,都?xì)g迎加入我們的的圈子(技術(shù)交流、學(xué)習(xí)資源、職場吐槽、大廠內(nèi)推、面試輔導(dǎo)),讓我們一起學(xué)習(xí)成長!文章來源地址http://www.zghlxwxcb.cn/news/detail-859279.html
e details of each instance in a YAML file
- An instance is any piece of the Elastic Stack that requires an SSL certificate.
Depending on your configuration, Elasticsearch, Logstash, Kibana, and Beats
寫在最后
在結(jié)束之際,我想重申的是,學(xué)習(xí)并非如攀登險峻高峰,而是如滴水穿石般的持久累積。尤其當(dāng)我們步入工作崗位之后,持之以恒的學(xué)習(xí)變得愈發(fā)不易,如同在茫茫大海中獨自劃舟,稍有松懈便可能被巨浪吞噬。然而,對于我們程序員而言,學(xué)習(xí)是生存之本,是我們在激烈市場競爭中立于不敗之地的關(guān)鍵。一旦停止學(xué)習(xí),我們便如同逆水行舟,不進(jìn)則退,終將被時代的洪流所淘汰。因此,不斷汲取新知識,不僅是對自己的提升,更是對自己的一份珍貴投資。讓我們不斷磨礪自己,與時代共同進(jìn)步,書寫屬于我們的輝煌篇章。
需要完整版PDF學(xué)習(xí)資源私我
網(wǎng)上學(xué)習(xí)資料一大堆,但如果學(xué)到的知識不成體系,遇到問題時只是淺嘗輒止,不再深入研究,那么很難做到真正的技術(shù)提升。
需要這份系統(tǒng)化的資料的朋友,可以添加V獲?。簐ip204888 (備注網(wǎng)絡(luò)安全)
[外鏈圖片轉(zhuǎn)存中…(img-aCDoy2Aq-1713322558848)]文章來源:http://www.zghlxwxcb.cn/news/detail-859279.html
一個人可以走的很快,但一群人才能走的更遠(yuǎn)!不論你是正從事IT行業(yè)的老鳥或是對IT行業(yè)感興趣的新人,都?xì)g迎加入我們的的圈子(技術(shù)交流、學(xué)習(xí)資源、職場吐槽、大廠內(nèi)推、面試輔導(dǎo)),讓我們一起學(xué)習(xí)成長!
到了這里,關(guān)于elasticsearch集群安裝+安全驗證+kibana安裝,新鮮出爐的螞蟻金服面經(jīng)的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!