Install polarismesh cluster on openeuler

Table of Contents

1. Install MySQL database

2. Install Redis cluster

3. Initialize SQL

4. Configure polaris-server.yaml

5. Start the service

6. Install polaris-console

7. Start polaris-console

8. Install monitoring components

9. Install distributed current limiting components

unzip polaris-limiter-release_v1.0.4.linux.amd64.zip mv polaris-limiter-release_v1.0.4.linux.amd64 polaris-limitercd polaris-limiter

start up

10. Check the startup process

11. Page access

12. Usage examples


1. Install MySQL database

Database connection address 10.10.10.168 User root password 123456

MySQL installation reference Building DSS environment (6) Installation of basic environment MySQL_linux installation dss_Youth is not famous blog-CSDN blog

2. Install Redis cluster

IP Resid PORT Sentinel PORT PASSWORD Cluster NAME
10.10.10.110 6379 26379 123456 mymaster
10.10.10.168 6379 26379 123456 mymaster
10.10.10.150 6379 26379 123456 mymaster

3. Initialization SQL

unzip polaris-server-release_v1.17.4.linux.amd64.zip
mv polaris-server-release_v1.17.4.linux.amd64 polaris-server

cd polaris-server

 mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 12
Server version: 8.0.31 MySQL Community Server - GPL

Copyright (c) 2000, 2022, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> source ^C
mysql> use polaris_server;
Database changed
mysql> source store/mysql/polaris_server.sql
Query OK, 0 rows affected (0.00 sec)

4. Configure polaris-server.yaml

# server Start guidance configuration
bootstrap:
#Global log
logger:
# Log scope name
# Configuration center related logs
config:
# Log file location
rotateOutputPath: log/runtime/polaris-config.log
# Special records of error log files at ERROR level
errorRotateOutputPath: log/runtime/polaris-config-error.log
# The maximum size of a single log file, 100 default, the unit is MB
rotationMaxSize: 100
# How many log files are saved, default 30
rotationMaxBackups: 30
# The maximum preservation days of a single log file, default 7
rotationMaxAge: 7
# Log output level, debug/info/warn/error
outputLevel: info
# Open the log file compression
compress: true
# onlyContent just print log content, not print log timestamp
# onlyContent: false
# Resource Auth, User Management Log
auth:
rotateOutputPath: log/runtime/polaris-auth.log
errorRotateOutputPath: log/runtime/polaris-auth-error.log
rotationMaxSize: 100
rotationMaxBackups: 30
rotationMaxAge: 7
outputLevel: info
compress: true
#Storage layer log
store:
rotateOutputPath: log/runtime/polaris-store.log
errorRotateOutputPath: log/runtime/polaris-store-error.log
rotationMaxSize: 100
rotationMaxBackups: 30
rotationMaxAge: 7
outputLevel: info
compress: true
# Server cache log log
cache:
rotateOutputPath: log/runtime/polaris-cache.log
errorRotateOutputPath: log/runtime/polaris-cache-error.log
rotationMaxSize: 100
rotationMaxBackups: 30
rotationMaxAge: 7
outputLevel: info
compress: true
# Service discovery and governance rules related logs
naming:
rotateOutputPath: log/runtime/polaris-naming.log
errorRotateOutputPath: log/runtime/polaris-naming-error.log
rotationMaxSize: 100
rotationMaxBackups: 30
rotationMaxAge: 7
outputLevel: info
compress: true
# Service discovery institutional health check log
healthcheck:
rotateOutputPath: log/runtime/polaris-healthcheck.log
errorRotateOutputPath: log/runtime/polaris-healthcheck-error.log
rotationMaxSize: 100
rotationMaxBackups: 30
rotationMaxAge: 7
outputLevel: info
compress: true
# XDS protocol layer plug -in log
xdsv3:
rotateOutputPath: log/runtime/polaris-xdsv3.log
errorRotateOutputPath: log/runtime/polaris-xdsv3-error.log
rotationMaxSize: 100
rotationMaxBackups: 30
rotationMaxAge: 7
outputLevel: info
compress: true
# Eureka protocol layer plug -in log
eureka:
rotateOutputPath: log/runtime/polaris-eureka.log
errorRotateOutputPath: log/runtime/polaris-eureka-error.log
rotationMaxSize: 100
rotationMaxBackups: 30
rotationMaxAge: 7
outputLevel: info
compress: true
# APISERVER common log, record inbound request and outbound response
apiserver:
rotateOutputPath: log/runtime/polaris-apiserver.log
errorRotateOutputPath: log/runtime/polaris-apiserver-error.log
rotationMaxSize: 100
rotationMaxBackups: 30
rotationMaxAge: 7
outputLevel: info
compress: true
default:
rotateOutputPath: log/runtime/polaris-default.log
errorRotateOutputPath: log/runtime/polaris-default-error.log
rotationMaxSize: 100
rotationMaxBackups: 30
rotationMaxAge: 7
outputLevel: info
compress: true
# server plugin logs
token-bucket:
rotateOutputPath: log/runtime/polaris-ratelimit.log
errorRotateOutputPath: log/runtime/polaris-ratelimit-error.log
rotationMaxSize: 100
rotationMaxBackups: 30
rotationMaxAge: 7
outputLevel: info
compress: true
discoverLocal:
rotateOutputPath: log/statis/polaris-discoverstat.log
errorRotateOutputPath: log/statis/polaris-discoverstat-error.log
rotationMaxSize: 100
rotationMaxBackups: 30
rotationMaxAge: 7
outputLevel: info
compress: true
local:
rotateOutputPath: log/statis/polaris-statis.log
errorRotateOutputPath: log/statis/polaris-statis-error.log
rotationMaxSize: 100
rotationMaxBackups: 30
rotationMaxAge: 7
outputLevel: info
compress: true
HistoryLogger:
rotateOutputPath: log/operation/polaris-history.log
errorRotateOutputPath: log/operation/polaris-history-error.log
rotationMaxSize: 100
rotationMaxBackups: 10
rotationMaxAge: 7
rotationMaxDurationForHour: 24
outputLevel: info
onlyContent: true
discoverEventLocal:
rotateOutputPath: log/event/polaris-discoverevent.log
errorRotateOutputPath: log/event/polaris-discoverevent-error.log
rotationMaxSize: 100
rotationMaxBackups: 30
rotationMaxAge: 7
outputLevel: info
onlyContent: true
cmdb:
rotateOutputPath: log/runtime/polaris-cmdb.log
errorRotateOutputPath: log/runtime/polaris-cmdb-error.log
rotationMaxSize: 100
rotationMaxBackups: 30
rotationMaxAge: 7
outputLevel: info
compress: true
# Start the server in order
startInOrder:
# Start the Polaris-Server in order, mainly to avoid data synchronization logic when the server starts the DB to pull the DB out of high load
open: true
# The name of the start lock
key: sz
# Register as Arctic Star Service
polaris_service:
## level: self_address > network_inter > probe_address
## Obtain the IP of the VM or POD where Polaris is located by making a TCP connection with the probe_adreess address
probe_address: 10.10.10.168:3306
## Set the name of the gateway to get your own IP
# network_inter: eth0
## Show the setting node itself IP information
# self_address: 127.0.0.1
# disable_heartbeat disable polaris_server node run heartbeat action to keep lease polaris_service
# disable_heartbeat: true
# Whether to open the server to register
enable_register: true
# Registered North Star Server Examples isolation status
isolated: false
# Service information that needs to be registered
services:
# service name
– name: polaris.checker
# Set the port protocol information that requires registration
protocols:
-service-grpc
# apiserver Configuration
apiservers:
# apiserver plugin name
– name: service-eureka
# apiserver additional configuration
option:
# tcp server listen ip
listenIP: “0.0.0.0”
# tcp server listen port
listenPort: 8761
# set the polaris namingspace of the EUREKA service default
namespace:default
# pull data from the cache of the polaris, refresh the data cache in the Eureka protocol
refreshInterval: 10
# eureka incremental instance changes time cache expiration cycle
deltaExpireInterval: 60
# unhealthy instance expiration cycle
unhealthyExpireInterval: 180
# whether to enable an instance ID of polaris to generate logic
generateUniqueInstId: false
#TCP connection number limit
connLimit:
# Whether to turn on the TCP connection limit function, default FALSE
openConnLimit: false
# The number of connections with the most IP
maxConnPerHost: 1024
# Current Listener’s maximum number of connections
maxConnLimit: 10240
# Whitening list ip list, English comma separation
whiteList: 127.0.0.1
# Cleaning the cycle of link behavior
purgeCounterInterval: 10s
# How long does the unpretentious link clean up
purgeCounterExpired: 5s
– name: api-http
option:
listenIP: “0.0.0.0”
listenPort: 8090
# debug pprof switch
enablePprof: true
# swagger docs switch
enableSwagger: true
connLimit:
openConnLimit: false
maxConnPerHost: 128
maxConnLimit: 5120
whiteList: 127.0.0.1
purgeCounterInterval: 10s
purgeCounterExpired: 5s
# Set the type of open API interface
api:
#admin OpenAPI interface
admin:
enable: true
# Console OpenAPI interface
console:
enable: true
# OpenAPI group that needs to be exposed
include: [default, service, config]
# client OpenAPI interface
client:
enable: true
include: [discover, register, healthcheck, config]
# Polaris is a client protocol layer based on the gRPC protocol, which is used for registration discovery and service governance rule delivery
– name: service-grpc
option:
listenIP: “0.0.0.0”
listenPort: 8091
connLimit:
openConnLimit: false
maxConnPerHost: 128
maxConnLimit: 5120
# Open the protobuf parsing cache, cache the protobuf serialization results of the same content, and improve the processing of service discovery QPS
enableCacheProto: true
# Cache default size
sizeCacheProto: 128
# tls setting
tls:
#setcertfilepath
certFile: “”
# set key file path
keyFile: “”
# set trusted ca file path
trustedCAFile: “”
api:
client:
enable: true
include: [discover, register, healthcheck]
– name: config-grpc
option:
listenIP: “0.0.0.0”
listenPort: 8093
connLimit:
openConnLimit: false
maxConnPerHost: 128
maxConnLimit: 5120
api:
client:
enable: true
– name: xds-v3
option:
listenIP: “0.0.0.0”
listenPort: 15010
connLimit:
openConnLimit: false
maxConnPerHost: 128
maxConnLimit: 10240
# – name: service-l5
# option:
# listenIP: 0.0.0.0
# listenPort: 7779
# clusterName: cl5.discover
# Core logic configuration
auth:
# auth’s option has migrated to auth.user and auth.strategy
# it’s still available when filling auth.option, but you will receive warning log that auth.option has deprecated.
user:
name: defaultUser
option:
# Token encrypted SALT, you need to rely on this SALT to decrypt the information of the Token when analyzing the Token
# The length of SALT needs to satisfy the following one: len(salt) in [16, 24, 32]
salt: polarismesh@2021
strategy:
name:defaultStrategy
option:
# Console auth switch, default true
consoleOpen: true
# Console Strict Model, default true
consoleStrict: true
#Customer auth switch, default false
clientOpen: false
# Customer Strict Model, default close
clientStrict: false
namespace:
# Whether to allow automatic creation of naming space
autoCreate: true
naming:
# Batch controller
batch:
register:
open: true
# Task queue cache
queueSize: 10240
# The maximum waiting time for the number of mission is not full, and the time is directly forced to launch the BATCH operation
waitTime: 32ms
# Number of BATCH
maxBatchCount: 128
# Number of workers in the batch task
concurrency: 128
# Whether to turn on the discarding expiration task is only used for the batch controller of the register type
dropExpireTask: true
# The maximum validity period of the task is that the task is not executed when the validity period exceeds the validity period.
taskLife: 30s
deregister:
open: true
queueSize: 10240
waitTime: 32ms
maxBatchCount: 128
concurrency: 128
#Configuration of health check
healthcheck:
# Whether to open the health check function module
open: true
# The service of the instance of the health inspection task
service: polaris.checker
# Time wheel parameters
slotNum: 30
# It is used to adjust the next execution time of instance health check tasks in the time wheel, limit the minimum inspection cycle
minCheckInterval: 1s
# It is used to adjust the next execution time of instance health inspection tasks in the time wheel, limit the maximum inspection cycle
maxCheckInterval: 30s
# Used to adjust the next execution time of SDK reporting instance health checking tasks in the time wheel
clientReportInterval: 120s
batch:
heartbeat:
open: true
queueSize: 10240
waitTime: 32ms
maxBatchCount: 32
Concurrency: 64
# since the three belong to the same type of health check plugin, only one can be enabled to use one
checkers:
– name: heartbeatRedis # Heartbeat examination plugin based on redis implementation
option:
deployMode: sentinel
addrs:
– “10.10.10.150:26379”
– “10.10.10.110:26379”
– “10.10.10.168:26379”
masterName: “mymaster”
sentinelUsername: “default” # Sentinel client username
sentinelPassword: ‘123456’ # sentinel client password
kvPasswd: “123456” # redis client password
poolSize: 233
minIdleConns: 30
idleTimeout: 120s
connectTimeout: 200ms
msgTimeout: 200ms
Concurrency: 200
withTLS: false
# Configuration center module start configuration
config:
# Whether to start the configuration module
open: true
# Maximum number of number of file characters
contentMaxLength: 20000
# Cache configuration
cache:
open: true
resources:
– name: service # Load service data
option:
disableBusiness: false # Do not load business services
needMeta: true # Load service metadata
– name: instance # Load instance data
option:
disableBusiness: false # Do not load business service examples
needMeta: true # Load instance metadata
– name: routingConfig # Load route data
– name: rateLimitConfig # Load current limit data
– name: circuitBreakerConfig # Load the fuse data
– name: users # Load user and user group data
– name: strategyRule # Loading the rules of appraisal
– name: namespace # Load the naming space data
# Load Client-SDK instance data
– name: client
– name: configFile
– name: configGroup
– name: faultDetectRule
# – name: l5 # Load L5 data
# Maintain configuration
maintain:
jobs:
# Clean up long term unhealthy instance
– name: DeleteUnHealthyInstance
enable: false
option:
# Valid time units are “ns”, “us” (or “μs”), “ms”, “s”, “m”, “h”.
instanceDeleteTimeout: 60m
# Delete auto-created service without an instance
– name: DeleteEmptyAutoCreatedService
enable: false
option:
# Valid time units are “ns”, “us” (or “μs”), “ms”, “s”, “m”, “h”.
serviceDeleteTimeout: 30m
# Clean soft deleted instances
– name: CleanDeletedInstances
enable: true
option:
# Valid time units are “ns”, “us” (or “μs”), “ms”, “s”, “m”, “h”.
# instanceCleanTimeout: 10m
# Clean soft deleted clients
– name: CleanDeletedClients
enable: true
option:
# Valid time units are “ns”, “us” (or “μs”), “ms”, “s”, “m”, “h”.
# clientCleanTimeout: 10m

#Storage configuration
store:
## Database storage plugin
name: defaultStore
option:
master:
dbType: mysql
dbName: polaris_server
dbUser: root
dbPwd: 123456
dbAddr: 10.10.10.168:3306
maxOpenConns: 300
maxIdleConns: 50
connMaxLifetime: 300 # Unit second
txIsolationLevel: 2 #LevelReadCommitted
# polaris-server plugin settings
plugin:
crypto:
entries:
– name: AES
#whitelist:
# name: whitelist
# option:
# ip: [127.0.0.1]
cmdb:
name:memory
option:
url: “”
interval: 60s
history:
entries:
– name: HistoryLogger
discoverEvent:
entries:
– name: discoverEventLocal
discoverStatis:
name: discoverLocal
option:
# Statistical interval, the unit is second
interval: 60
status:
entries:
– name: local
option:
interval: 60
– name: prometheus
ratelimit:
name: token-bucket
option:
# Whether to use remote configuration
remote-conf: false
# IP -level current, global
ip-limit:
# Whether the system opens IP -level current limit
open: false
global:
open: false
#Maximumpeak
bucket: 300
# The average number of requests per second of IP
Rate: 200
# Number of IP of the maximum cache
resource-cache-amount: 1024
white-list: [127.0.0.1]
instance-limit:
open: false
global:
bucket: 200
Rate: 100
resource-cache-amount: 1024
#Interface-level ratelimit limit
api-limit:
# Whether to turn on the interface restriction and global switch, only for TRUE can it represent the flow restriction on the system.By default
open: false
rules:
– name: store-read
limit:
# The global configuration of the interface, if in the API sub-item, is not configured, the interface will be limited according to Global
open: false
# The maximum value of token barrels
bucket: 2000
# The number of tokens generated per second
Rate: 1000
– name: store-write
limit:
open: false
bucket: 1000
Rate: 500
apis:
– name: “POST:/v1/naming/services”
rule: store-write
– name: “PUT:/v1/naming/services”
rule: store-write
– name: “POST:/v1/naming/services/delete”
rule: store-write
– name: “GET:/v1/naming/services”
rule: store-read
– name: “GET:/v1/naming/services/count”
rule: store-read

5. Start service

bash /home/polaris-server/tool/stop.sh
bash /home/polaris-server/tool/start.sh

6. Install polaris-console

unzip polaris-console-release_v1.14.1.linux.amd64.zip

mv polaris-console-release_v1.14.1.linux.amd64 polaris-console

cd polaris-console

Modify polaris-console.yaml file

logger:
RotateOutputPath: log/polaris-console.log
RotationMaxSize: 500
RotationMaxAge: 30
RotationMaxBackups: 100
level: info
webServer:
mode: “release”
listenIP: “0.0.0.0”
listenPort: 8080
jwt:
secretKey: “polarismesh@2021”
expired: 1800
namingV1URL: “/naming/v1”
namingV2URL: “/naming/v2”
authURL: “/core/v1”
configURL: “/config/v1”
monitorURL: “/api/v1”
webPath: “web/dist/”
mainUser: “polaris”
polarisServer:
address: “127.0.0.1:8090”
monitorServer:
address: “127.0.0.1:9090”

7. Start polaris-console

Access address Polaris console

It is recommended to set access control policies for external network access

The initial username and password are polaris/polaris

bash /home/polaris-console/tool/stop.sh
bash /home/polaris-console/tool/start.sh

Access address http://ip:8080

Default polaris/polaris

8. Install monitoring components

tar -zxvf prometheus-2.28.0.linux-amd64.tar.gz
mv prometheus-2.28.0.linux-amd64 prometheus

Modify the prometheus configuration: Open the prometheus.yml file, modify the prometheus job configuration, and add http_sd_configs. Its function is to inform prometheus that it needs to obtain the address of the application monitoring report from Polaris.

# my global config
global:
  scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
  evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
  # scrape_timeout is set to the global default (10s).

#Alertmanager configuration
alerting:
  alertmanagers:
  - static_configs:
    - targets:
      # - alertmanager:9093

# Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
rule_files:
  # - "first_rules.yml"
  # - "second_rules.yml"

# A scrape configuration containing exactly one endpoint to scrape:
# Here it's Prometheus itself.
scrape_configs:
  # The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
  - job_name: 'prometheus'

    # metrics_path defaults to '/metrics'
    # scheme defaults to 'http'.

    static_configs:
    - targets: ['localhost:9090']
    
    http_sd_configs:
      - url: http://127.0.0.1:8090/prometheus/v1/clients
    honor_labels: true

Start service

pkill -9 prometheus
cd /home/prometheus
chmod u + x *
nohup ./prometheus --web.enable-lifecycle --web.enable-admin-api >> prometheus.out 2> & amp;1 & amp;

Restart the console: Enter the installation directory of polaris-console and execute the following statement to restart.

bash /home/polaris-console/tool/stop.sh
bash /home/polaris-console/tool/start.sh

Description:

If your network environment does not support prometheus actively pulling (pull mode) monitoring indicators from Polaris SDK, you need to deploy the pushgateway component and adjust the prometheus.yml file to add the following configuration

 - job_name: 'pushgateway'
    static_configs:
    - targets: ['${pushgateway server IP}:9091']

9. Install distributed current-limiting components

bash /home/polaris-limiter/tool/stop.sh
bash /home/polaris-limiter/tool/p.sh
bash /home/polaris-limiter/tool/start.sh
bash /home/polaris-limiter/tool/p.sh

unzip polaris-limiter-release_v1.0.4.linux.amd64.zip
mv polaris-limiter-release_v1.0.4.linux.amd64 polaris-limiter
cd polaris-limiter
Node ID, different nodes in the cluster need to set different myid

10. View startup process

ps -ef | grep polaris

11. Page visit

12. Usage examples

Official website address

Cluster version installation | PolarisMesh