Windows Server 2008 deployment project environment summary

Windows Server 2008 deployment project environment summary

Project environment:

  • mongodb
  • redis
  • postgresql
  • mysql
  • nacos

MonoDB

In the project, MongoDB is used to store large files. In the test environment, the systems above Centos7 and windows server2012 are installed normally. When using windows server2008, the version needs to be reduced. Here, MongoDB3 is used Install version 6

Domestic image download address

problem

After installation, we need to start the service manually. Here's a problem

Because this is a newly installed windows server2008, many environments do not have it. An error will be reported when starting the service

You need to install VC credit exe

reference resources

Start with configuration file under windows

Create the configuration file mongod cfg

systemLog:
    destination: file
    path: D:\soft\mongdb\log\mongod.log
storage:
    dbPath: D:\soft\mongdb\data
# This is to start auth authentication service
security:
  authorization: enabled

Use profile

mongod.exe --config "D:\soft\mongdb\mongod.cfg" --install

Start with command

# start-up
net start MongoDB
# stop it
net stop MongoDB

Create a super administrator account before starting auth service

mongo

use admin

db.createUser({user:"superAdmin",pwd:"123456",roles:[{role:"userAdminAnyDatabase",db:"admin"}]})

# Log in with super administrator
mongo --username superadmin --password linkage@123456 --authenticationDatabase admin

Create a database user

 use linkage
 
 db.createUser({
  user: "linkage",
  pwd: "123456",
  roles: [
    { role: "dbOwner", db: "linkage" },
  ],
  passwordDigestor: "server"
})

Redis installation

Attempt to install with redis installer failed; Here, the decompressed version of redis is used for installation

Installed version: 3.0.504

For security, redis password is enabled here

Open redis windows. Conf file, adding

requirepass 123456

Window start

redis-server.exe redis.windows.conf

Background start

# Registration services
redis-server --service-install redis.windows.conf
# Uninstall command
redis-server --service-uninstall
# Start with command
redis-server --service-start
# Stop command
redis-server --service-stop

MySQL

MySQL8.0 installation tutorial

problem

After installing on Windows server2008, an error is reported during startup, and it cannot be started normally, as shown below:

At this time, use the configuration file to start

Create the installation folder under my.mysql Ini configuration file

[mysql]
# Set the default character set of mysql client
default-character-set=utf8 
[mysqld]
#Set 3306 port
port = 3306 
# Set mysql installation directory
basedir=D:/soft/mysql-8.0.11-winx64
# Set the storage directory of mysql database data
datadir=D:/soft/mysql-8.0.11-winx64/data
# Maximum connections allowed
max_connections=200
# The character set used by the server defaults to the 8-bit encoded latin1 character set
character-set-server=utf8
# The default storage engine that will be used when creating new tables
default-storage-engine=INNODB

to configure

mysqld --initialize

# start-up
net stop mysql

Here, the mysql service starts normally, but the password is incorrect (in fact, I didn't set the password at all)

Here, you need to reset the mysql password by forgetting the password

Reset method after forgetting password

Reset password

mysql -u root -p

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '123456';

mysql -u root -p 123456

Nacos

After installing mysql, it's easy to use nacos. First install jdk1 eight

Configuration file application Properties modification:

### If use MySQL as datasource:
# spring.datasource.platform=mysql

### Count of DB:
 db.num=1

### Connect URL of DB:
 db.url.0=jdbc:mysql://127.0.0.1:3306/nacos?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useUnicode=true&useSSL=false&serverTimezone=UTC
 db.user.0=root
 db.password.0=123456

### Connection pool configuration: hikariCP
db.pool.config.connectionTimeout=30000
db.pool.config.validationTimeout=10000
db.pool.config.maximumPoolSize=20
db.pool.config.minimumIdle=2

Launch nacos in stand-alone version

startup.cmd -m standalone

summary

Various problems will be encountered when installing a service in Windows Server 2008, mainly including version incompatibility and lack of environment;

It is recommended to use windows server, preferably 2012 or above. Basically, the compatibility problem will not appear

Keywords: Operation & Maintenance MySQL MongoDB PostgreSQL Nacos

Added by Mr P!nk on Tue, 08 Mar 2022 04:12:38 +0200