The host shares files with VMware

  1. Set a shared folder for the VM

2. The shared folder is displayed on the VM

  • The first CD/MNT
  • Then check to see if there is anything in this folder ls, if not, create a new folder HGFS, mkdir HGFS to create this file
  • Run vmhgfs-fuse/MNT/HGFS (requires this folder to have no content)
  • Then enter the HGFS folder, you can see our shared files on Windows.

Centos Download files

  1. Ubuntu uses apt-get
  2. wegt

Generally speaking, well-known Linux systems fall into two main categories:

  1. RedHat series: RedHat, Centos, and Fedora
  2. Debian series: Debian, Ubuntu, etc

RedHat series:

  1. Common installation package format: RPM package. The command for installing RPM packages is “RPM – parameter”.
  2. Package management tool Yum
  3. Support the tar packages

Debian series:

  1. Deb = deb deb = dpkg-parameter
  2. Package management tool apt-get
  3. Support the tar packages

Configure the Java environment for the VM

  1. Opening a Configuration filevim /etc/profile
  2. Add at the end
    Export JAVA_HOME=/usr/local/ Java /jdk1.8.0_171 export JRE_HOME=${JAVA_HOME}/jre export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib export PATH=${JAVA_HOME}/bin:$PATHCopy the code

  3. Enable environment variablessource /etc/profile
  4. Adding soft LinksLn -s/usr/local/Java/jdk1.8.0 _171 / bin/Java/usr/bin/Java
  5. check

Docker creates an image

Docker commit

Docker configuration development environment

-fuse/MNT/HGFS -fuse/MNT/HGFS -fuse/MNT/HGFS -fuse/MNT/HGFS -fuse/MNT/HGFS -fuse/MNT/HGFS

Modify the docker container port mapping and mount directory

Method 1: Delete the original container and build a new container (recommended)

The simplest solution is to delete the original container and create a new one. Don’t forget to add port mapping this time. Advantages and disadvantages: The advantages are simple and fast, and are widely used in test environments. The disadvantage is that if it is a database mirroring, it is more troublesome to build a new one and reconfigure it again.

Method 2: Modify the container configuration file and restart the Docker service

Container configuration file path: The/var/lib/docker/containers / [hash_of_the_container] / hostconfig json hashofthecontainer is docker image hash value, Docker ps or Docker inspect ContainerName Modify the port as required, modify the mount directory as required (permissions and owner owner group must be the same), restart the Docker service, and then start the CONTAINER service.

{
    "Binds": [
        "/mnt/hgfs/vmware-file/nacos/conf:/home/nacos/conf"],}Copy the code

And config.v2.json to modify MountPoints systemctl restart docker

Advantages and disadvantages: The advantages of this method are no side effects and simple operation. The disadvantage is that the whole Docker service needs to be restarted. If multiple container services are running on the same host, other container services will be affected.

nginx

  1. Pull the mirrordocker pull nginx
  2. Create a containerdocker run -d -p 80:80 --name mynginx nginx
  3. Copying configuration Filesnginx.conf docker cp mynginx:/etc/nginx/nginx.conf /mnt/hgfs/vmware-file/nginx
  4. Delete the previously created container, recreate the container and add the mount local filedocker run -it -p 80:80 --name mynginx -v /mnt/hgfs/vmware-file/nginx/nginx.conf:/etc/nginx/nginx.conf nginx
  5. Verify that the local file was successfully mounted The configuration file is mounted successfully
  6. Test access to nginxhttp://192.168.57.130:80

Ps: The nginx directory on Windows has a different structure from the nginx directory on Linux

mysql

  1. Pull the mirrordocker pull centos/mysql-57-centos7
  2. Create a containerDocker run -d -p 3306:3306 --name mysql5.7 centos/mysql-57-centos7
  3. The default user name for logging in to mysql is root, and the password is empty.Docker exec it mysql5.7 /bin/bash mysql-u root --p
  4. After login, change the user name and passwordSet password for root@localhost = password(' new password ');

nacos

  1. Pull the mirrordocker pull nacos/nacos-server
  2. Create a containerdocker run -d -p 8848:8848 --name mynacos nacos/nacos-server
  3. Copying configuration Filesdocker cp mynacos:/home/nacos/conf /mnt/hgfs/vmware-file/nacos
  4. Test access to nacOShttp://192.168.57.130:8848/nacos.Note that the connection is followed by /nacosThe default login name and password are both nacos
  5. Viewing configuration Files
  6. Change the database to mysql, the default of NACOS is embedded database DERy is inconvenient for us to observe the data,Change to mysql5.7 (nacOS official image does not support 8.xx higher version)
  7. Modify the container mount file (Method 1) Run in single-node modedocker run -d -p 8848:8848 --name testnacos -v /mnt/hgfs/vmware-file/nacos/conf:/home/nacos/conf --env MODE=standalone nacos/nacos-server
  8. Modifying the container mount file (Method 2)Modified Binds hostconfig. Json

    Modified MountPoints config. V2. Json

seata

  1. Pull the mirrordocker pull seataio/seata-server
  2. Create a containerdocker run -d -p 8091:8091 --name myseata seataio/seata-server
  3. Copying configuration Filesdocker cp myseata:/mnt/hgfs/vmware-file/seata-server/resources /seata-server/resources
  4. Reconstruction of the containerdocker run -d -p 8091:8091 --name myseata -v /mnt/hgfs/vmware-file/seata-server/resources:/seata-server/resources seataio/seata-server
  5. Create databases and SQLhttps://github.com/seata/seata/tree/develop/script/server
  6. Modify the configuration to specify that SEATA is registered with NACOS and transactions are saved in the database
Registry {# file, nacos, Eureka, Redis, ZK, Consul, ETCD3, SOFA type = "nacos" nacos {application = "seata-server" ServerAddr = "192.168.57.130:8848" group = "SEATA_GROUP" Namespace = "" cluster = "default" username = "nacos" password = "nacos" } eureka { serviceUrl = "http://localhost:8761/eureka" application = "default" weight = "1" } redis { serverAddr = "localhost:6379" db = 0 password = "" cluster = "default" timeout = 0 } zk { cluster = "default" serverAddr = "127.0.0.1:2181" sessionTimeout = 6000 connectTimeout = 2000 username = "" password = ""} consul {cluster = "Default" serverAddr = "127.0.0.1:8500" aclToken = ""} etcd3 {cluster = "default" serverAddr = "http://localhost:2379" } SOFA {serverAddr = "127.0.0.1:9603" Application = "default" region = "DEFAULT_ZONE" datacenter = "DefaultDataCenter"  cluster = "default" group = "SEATA_GROUP" addressWaitTime = "3000" } file { name = "file.conf" } } config { # File, nacos, Apollo, ZK, Consul, ETCD3 Type = "file" nacos {serverAddr = "127.0.0.1:8848" namespace = "" group = "SEATA_GROUP" username = "" password = "" dataId = "seataserver.properties"} consul {serverAddr = "127.0.0.1:8500" aclToken = "" } apollo { appId = "seata-server" ## apolloConfigService will cover apolloMeta apolloMeta = "Http://192.168.1.204:8801" apolloConfigService = "http://192.168.1.204:8080" namespace = "application" ApolloAccesskeySecret = "" cluster = "seata"} zk {serverAddr = "127.0.0.1:2181" sessionTimeout = 6000 connectTimeout =  2000 username = "" password = "" nodePath = "/seata/seata.properties" } etcd3 { serverAddr = "http://localhost:2379" } file { name = "file.conf" } }Copy the code
## transaction log store, only used in seata-server store { ## lock&session store mode: Session {mode = "db"} ## RSA decryption Public key publicKey = "" ## file store property file { ## store location dir dir = "sessionStore" # branch session size , if exceeded first try compress lockkey, still exceeded throws exceptions maxBranchSessionSize = 16384 # globe session size , if exceeded throws exceptions maxGlobalSessionSize = 512 # file buffer size , if exceeded allocate new buffer fileWriteBufferCacheSize = 16384 # when recover batch read size sessionReloadReadSize = 100 # async, sync flushDiskMode = async } ## database store property db { ## the implement of javax.sql.DataSource, such as DruidDataSource(druid)/BasicDataSource(dbcp)/HikariDataSource(hikari) etc. datasource = "druid" ## mysql/oracle/postgresql/h2/oceanbase etc. dbType = "mysql" driverClassName = "com.mysql.jdbc.Driver" ## if using mysql to store the data, How the add rewriteBatchedStatements = true in the JDBC connection url param = "JDBC: mysql: / / 192.168.57.130:3306 / seata? CharacterEncoding =utf8&autoReconnect=true" user = "user" password = "password" minConn = 5 maxConn = 100 globalTable = "global_table" branchTable = "branch_table" lockTable = "lock_table" queryLimit = 100 maxWait = 5000 } ## redis store property redis { ## redis mode: ## single mode property single {host = "127.0.0.1" port = "6379"} ## sentinel mode The property sentinel {masterName = "" # # to the as" 10.28.235.65:26379,10.28. 235.65:26380,10.28. 235.65:26381 "sentinelHosts = "" } password = "" database = "0" minConn = 1 maxConn = 10 maxTotal = 100 queryLimit = 100 } }Copy the code