ElasticSearch部署
ElasticSearch资源
RabbitMQ资源
ElasticSearch服务部署
[root@Services ~]
...
Total packages: 8,265
[root@Services ~]
...
Complete!
[root@Services ~]
[root@Services ~]
[root@Services ~]
[root@Services ~]
export JAVA_HOME="/usr/lib/jvm/jdk/"
export CLASSPATH=.
export PATH=${JAVA_HOME}/bin/:$PATH
[root@Services ~]
[root@Services ~]
/usr/lib/jvm/jdk/
[root@Services ~]
/usr/lib/jvm/jdk/bin/java
[root@Services ~]
openjdk version "1.8.0_332"
OpenJDK Runtime Environment (build 1.8.0_332-b09)
OpenJDK 64-Bit Server VM (build 25.332-b09, mixed mode)
[root@Services ~]
[root@Services ~]
elasticsearch-6.8.0.rpm
[root@Services ~]
[root@Services ~]
[root@Services ~]
node.name: Services
path.data: /var/lib/elasticsearch
path.logs: /var/log/elasticsearch
network.host: 0.0.0.0
http.port: 9200
[root@Services ~]
[root@Services ~]
[root@Services ~]
[root@Services ~]
tcp LISTEN 0 128 *:9200 *:* users:(("java",pid=9847,fd=209))
tcp LISTEN 0 128 *:9300 *:* users:(("java",pid=9847,fd=196))
[root@Services ~]
[root@Services ~]
{
"name" : "Services",
"cluster_name" : "elasticsearch",
"cluster_uuid" : "1cf7N861QBC_C0RE8gm0OA",
"version" : {
"number" : "6.8.0",
"build_flavor" : "default",
"build_type" : "rpm",
"build_hash" : "65b6179",
"build_date" : "2019-05-15T20:06:13.172855Z",
"build_snapshot" : false,
"lucene_version" : "7.7.0",
"minimum_wire_compatibility_version" : "5.6.0",
"minimum_index_compatibility_version" : "5.0.0"
},
"tagline" : "You Know, for Search"
}
ElasticSerach插件部署
[root@Services ~]
[root@Services ~]
elasticsearch-analysis-ik-6.8.0.zip
[root@Services ~]
-> Downloading file:///root/elasticsearch-analysis-ik-6.8.0.zip
[=================================================] 100%
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: plugin requires additional permissions @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
* java.net.SocketPermission * connect,resolve
See http://docs.oracle.com/javase/8/docs/technotes/guides/security/permissions.html
for descriptions of what these permissions allow and the associated risks.
Continue with installation? [y/N]y
-> Installed analysis-ik
[root@Services ~]
analysis-ik
[root@Services ~]
[root@Services ~]
[root@Services ~]
{
"analyzer": "standard",
"text": "华为手机"
}' #测试标准分词
{
"tokens" : [
{
"token" : "华",
"start_offset" : 0,
"end_offset" : 1,
"type" : "",
"position" : 0
},
{
"token" : "为",
"start_offset" : 1,
"end_offset" : 2,
"type" : "",
"position" : 1
},
{
"token" : "手",
"start_offset" : 2,
"end_offset" : 3,
"type" : "",
"position" : 2
},
{
"token" : "机",
"start_offset" : 3,
"end_offset" : 4,
"type" : "",
"position" : 3
}
]
}
[root@Services ~]#
[root@Services ~]# curl -H "Content-Type: application/json" -XPOST http://localhost:9200/_analyze?pretty -d '
{
"analyzer": "ik_smart",
"text": "华为手机"
}'
{
"tokens" : [
{
"token" : "华为",
"start_offset" : 0,
"end_offset" : 2,
"type" : "CN_WORD",
"position" : 0
},
{
"token" : "手机",
"start_offset" : 2,
"end_offset" : 4,
"type" : "CN_WORD",
"position" : 1
}
]
}
HEAD 插件(容器部署)
[root@Services ~]
...
Total packages: 8,265
[root@Services ~]
Complete!
[root@Services ~]
podman version 4.0.2
[root@Services ~]
[root@Services ~]
elasticsearch-head.tar
[root@Services ~]
REPOSITORY TAG IMAGE ID CREATED SIZE
[root@Services ~]
Getting image source signatures
Copying blob 604c78617f34 done
Copying blob 60a0858edcd5 done
Copying blob b6ca02dfe5e6 done
Copying blob 0a5e2b2ddeaa done
Copying blob 53c779688d06 done
Copying blob fa18e5ffd316 done
Copying blob cf2eea3d6e04 done
Copying blob d556e03b8284 done
Copying blob 95ea76455b84 done
Copying blob ce5705289a91 done
Copying blob d09533ddfc0d done
Copying blob eb415bbb4658 done
Copying blob f418a5a1e636 done
Copying config d008a8ccd0 done
Writing manifest to image destination
Storing signatures
Loaded image(s): localhost/elasticsearch-head:latest
[root@Services ~]
REPOSITORY TAG IMAGE ID CREATED SIZE
localhost/elasticsearch-head latest d008a8ccd029 7 weeks ago 862 MB
[root@Services ~]
[root@Services ~]
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
[root@Services ~]
f222cb764271574148d31b184bd0aebda419ce3ebd43843c0ff8f1f4dc6ba53c
[root@Services ~]
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
f222cb764271 localhost/elasticsearch-head:latest /bin/sh -c grunt ... 2 seconds ago Up 2 seconds ago 0.0.0.0:9100->9100/tcp es-head
[root@Services ~]
tcp LISTEN 0 128 0.0.0.0:9100 0.0.0.0:* users:(("conmon",pid=12651,fd=5))
[root@Services ~]
[root@Services ~]
[root@Services ~]
http.port: 9200
http.cors.enabled: true
http.cors.allow-origin: "*"
[root@Services ~]
[root@Services ~]
tcp LISTEN 0 128 *:9200 *:* users:(("java",pid=12764,fd=214))
tcp LISTEN 0 128 *:9300 *:* users:(("java",pid=12764,fd=201))
[root@Services ~]
Elasticsearch API
[root@Services ~]
1677142976 09:02:56 elasticsearch green 1 1 0 0 0 0 0 0 - 100.0%
[root@Services ~]
epoch timestamp cluster status node.total node.data shards pri relo init unassign pending_tasks max_task_wait_time active_shards_percent
1677142979 09:02:59 elasticsearch green 1 1 0 0 0 0 0 0 - 100.0%
[root@Services ~]
[root@Services ~]
{ "settings": {
"index": {
"number_of_shards": 1,
"number_of_replicas": 0
}
}
}'
{"acknowledged":true,"shards_acknowledged":true,"index":"tedu"}
[root@Services ~]
accounts.json data.sh logs.jsonl
[root@Services ~]
curl -H "Content-Type: application/json" -XPUT http://localhost:9200/account/user/_bulk --data-binary @accounts.json
curl -H "Content-Type: application/json" -XPUT http://localhost:9200/_bulk --data-binary @logs.jsonl
[root@Services ~]
RabbitMQ服务
RabbitMQ部署
[root@Services ~]
[root@Services ~]
erlang-25.2-1.el8.x86_64.rpm
[root@Services ~]
[root@Services ~]
rabbitmq-server-3.11.5-1.el8.noarch.rpm
[root@Services ~]
[root@Services ~]
[root@Services ~]
[root@Services ~]
tcp LISTEN 0 128 *:5672 *:* users:(("beam.smp",pid=13298,fd=35))
[root@Services ~]
Status of node rabbit@Services ...
Runtime
OS PID: 13298
OS: Linux
Uptime (seconds): 15
Is under maintenance?: false
RabbitMQ version: 3.11.5
RabbitMQ release series support status: supported
Node name: rabbit@Services
Erlang configuration: Erlang/OTP 25 [erts-13.1.3] [source] [64-bit] [smp:2:2] [ds:2:2:10] [async-threads:1] [jit:ns]
Crypto library: OpenSSL 1.1.1k FIPS 25 Mar 2021
Erlang processes: 274 used, 1048576 limit
Scheduler run queue: 1
Cluster heartbeat timeout (net_ticktime): 60
Plugins
Enabled plugin file: /etc/rabbitmq/enabled_plugins
Enabled plugins:
Data directory
Node data directory: /var/lib/rabbitmq/mnesia/rabbit@Services
Raft data directory: /var/lib/rabbitmq/mnesia/rabbit@Services/quorum/rabbit@Services
Config files
Log file(s)
* /var/log/rabbitmq/[email protected]
* /var/log/rabbitmq/rabbit@Services_upgrade.log
* <stdout>
Alarms
(none)
Memory
Total memory used: 0.1288 gb
Calculation strategy: rss
Memory high watermark setting: 0.4 of available memory, computed to: 1.6343 gb
reserved_unallocated: 0.0809 gb (62.85 %)
code: 0.0321 gb (24.94 %)
other_proc: 0.0189 gb (14.65 %)
other_system: 0.0134 gb (10.44 %)
other_ets: 0.0027 gb (2.14 %)
atom: 0.0014 gb (1.07 %)
metrics: 0.0006 gb (0.43 %)
binary: 0.0002 gb (0.16 %)
mnesia: 0.0001 gb (0.06 %)
plugins: 0.0 gb (0.03 %)
msg_index: 0.0 gb (0.02 %)
quorum_ets: 0.0 gb (0.02 %)
quorum_queue_dlx_procs: 0.0 gb (0.0 %)
quorum_queue_procs: 0.0 gb (0.0 %)
stream_queue_procs: 0.0 gb (0.0 %)
stream_queue_replica_reader_procs: 0.0 gb (0.0 %)
allocated_unused: 0.0 gb (0.0 %)
connection_channels: 0.0 gb (0.0 %)
connection_other: 0.0 gb (0.0 %)
connection_readers: 0.0 gb (0.0 %)
connection_writers: 0.0 gb (0.0 %)
mgmt_db: 0.0 gb (0.0 %)
queue_procs: 0.0 gb (0.0 %)
queue_slave_procs: 0.0 gb (0.0 %)
stream_queue_coordinator_procs: 0.0 gb (0.0 %)
File Descriptors
Total: 2, limit: 32671
Sockets: 0, limit: 29401
Free Disk Space
Low free disk space watermark: 0.05 gb
Free disk space: 5.8313 gb
Totals
Connection count: 0
Queue count: 0
Virtual host count: 1
Listeners
Interface: [::], port: 25672, protocol: clustering, purpose: inter-node and CLI tool communication
Interface: [::], port: 5672, protocol: amqp, purpose: AMQP 0-9-1 and AMQP 1.0
[root@Services ~]
[root@Services ~]
[root@Services ~]
Enabling plugins on node rabbit@Services:
rabbitmq_management
The following plugins have been configured:
rabbitmq_management
rabbitmq_management_agent
rabbitmq_web_dispatch
Applying plugin configuration to rabbit@Services...
The following plugins have been enabled:
rabbitmq_management
rabbitmq_management_agent
rabbitmq_web_dispatch
started 3 plugins.
[root@Services ~]
Listing plugins with pattern ".*" ...
Configured: E = explicitly enabled; e = implicitly enabled
| Status: * = running on rabbit@Services
|/
[ ] rabbitmq_amqp1_0 3.11.5
[ ] rabbitmq_auth_backend_cache 3.11.5
[ ] rabbitmq_auth_backend_http 3.11.5
[ ] rabbitmq_auth_backend_ldap 3.11.5
[ ] rabbitmq_auth_backend_oauth2 3.11.5
[ ] rabbitmq_auth_mechanism_ssl 3.11.5
[ ] rabbitmq_consistent_hash_exchange 3.11.5
[ ] rabbitmq_event_exchange 3.11.5
[ ] rabbitmq_federation 3.11.5
[ ] rabbitmq_federation_management 3.11.5
[ ] rabbitmq_jms_topic_exchange 3.11.5
[E*] rabbitmq_management 3.11.5
[e*] rabbitmq_management_agent 3.11.5
[ ] rabbitmq_mqtt 3.11.5
[ ] rabbitmq_peer_discovery_aws 3.11.5
[ ] rabbitmq_peer_discovery_common 3.11.5
[ ] rabbitmq_peer_discovery_consul 3.11.5
[ ] rabbitmq_peer_discovery_etcd 3.11.5
[ ] rabbitmq_peer_discovery_k8s 3.11.5
[ ] rabbitmq_prometheus 3.11.5
[ ] rabbitmq_random_exchange 3.11.5
[ ] rabbitmq_recent_history_exchange 3.11.5
[ ] rabbitmq_sharding 3.11.5
[ ] rabbitmq_shovel 3.11.5
[ ] rabbitmq_shovel_management 3.11.5
[ ] rabbitmq_stomp 3.11.5
[ ] rabbitmq_stream 3.11.5
[ ] rabbitmq_stream_management 3.11.5
[ ] rabbitmq_top 3.11.5
[ ] rabbitmq_tracing 3.11.5
[ ] rabbitmq_trust_store 3.11.5
[e*] rabbitmq_web_dispatch 3.11.5
[ ] rabbitmq_web_mqtt 3.11.5
[ ] rabbitmq_web_mqtt_examples 3.11.5
[ ] rabbitmq_web_stomp 3.11.5
[ ] rabbitmq_web_stomp_examples 3.11.5
[root@Services ~]
tcp LISTEN 0 128 0.0.0.0:15672 0.0.0.0:* users:(("beam.smp",pid=13298,fd=37))
RabbitMQ服务应用
[root@Services ~]
Listing users ...
user tags
guest [administrator]
[root@Services ~]
Adding user "admin" ...
Password:
hisadmin
Done. Don't forget to grant the user permissions to some virtual hosts! See 'rabbitmqctl help set_permissions' to learn more.
[root@Services ~]
Listing users ...
user tags
admin []
guest [administrator]
[root@Services ~]
Setting tags for user "admin" to [administrator] ...
[root@Services ~]
Listing users ...
user tags
admin [administrator]
guest [administrator]
[root@Services ~]
Listing vhosts ...
name
/
[root@Services ~]
Adding vhost "/his" ...
[root@Services ~]
Listing vhosts ...
name
/his
/
[root@Services ~]
Listing permissions for user "admin" ...
[root@Services ~]
Setting permissions for user "admin" in vhost "/his" ...
[root@Services ~]
Listing permissions for user "admin" ...
vhost configure write read
/his .* .* .*