diff --git a/Ylt/gw-charge/src/main/resources/bootstrap-dev.yml b/Ylt/gw-charge/src/main/resources/bootstrap-dev.yml index e0cd9c4..30a9e31 100644 --- a/Ylt/gw-charge/src/main/resources/bootstrap-dev.yml +++ b/Ylt/gw-charge/src/main/resources/bootstrap-dev.yml @@ -210,7 +210,7 @@ spring: database: 0 host: 10.10.14.210 port: 6379 - password: rzyc#redis + password: ylt#redis timeout: 0 pool: max-active: 8 diff --git a/Ylt/gw-openapi/src/main/resources/bootstrap-dev.yml b/Ylt/gw-openapi/src/main/resources/bootstrap-dev.yml index 1d515ec..0ade1e0 100644 --- a/Ylt/gw-openapi/src/main/resources/bootstrap-dev.yml +++ b/Ylt/gw-openapi/src/main/resources/bootstrap-dev.yml @@ -66,7 +66,7 @@ spring: database: 0 host: 10.10.14.210 port: 6379 - password: rzyc#redis + password: ylt#redis timeout: 0 pool: max-active: 8 diff --git a/Ylt/gw-saas-mgr/src/main/resources/bootstrap-dev.yml b/Ylt/gw-saas-mgr/src/main/resources/bootstrap-dev.yml index 1f481d9..5a86a06 100644 --- a/Ylt/gw-saas-mgr/src/main/resources/bootstrap-dev.yml +++ b/Ylt/gw-saas-mgr/src/main/resources/bootstrap-dev.yml @@ -290,9 +290,7 @@ monitorapi: ribbon: listOfServers: http://i100c.3322.org:30731 - - - +# 负载均衡 ribbon: eureka: enabled: false #禁用eureka,不依赖 eureka @@ -313,15 +311,15 @@ hystrix: thread: timeoutInMilliseconds: 8000 #配置HystrixCommand执行的超时时间,执行超过该时间会进行服务降级处理 8s - +# 数据库 spring: data: mongodb: host: 10.10.14.210 port: 27017 - database: ycharge - username: root - password: 123456 + database: yltcharge + username: yltcharge + password: yltcharge dinger: project-id: ${spring.application.name}-${spring.profiles.active} dingers: diff --git a/Ylt/gw-saas-mgr/target/classes/META-INF/spring-configuration-metadata.json b/Ylt/gw-saas-mgr/target/classes/META-INF/spring-configuration-metadata.json new file mode 100644 index 0000000..25eff0d --- /dev/null +++ b/Ylt/gw-saas-mgr/target/classes/META-INF/spring-configuration-metadata.json @@ -0,0 +1,22 @@ +{ + "hints": [], + "groups": [ + { + "sourceType": "com.charge.gwmgr.filter.ZuulPreFilter", + "name": "jwt.filter", + "type": "com.charge.gwmgr.filter.ZuulPreFilter" + } + ], + "properties": [ + { + "sourceType": "com.charge.gwmgr.filter.ZuulPreFilter", + "name": "jwt.filter.no-access-filter", + "type": "java.util.List" + }, + { + "sourceType": "com.charge.gwmgr.filter.ZuulPreFilter", + "name": "jwt.filter.should-not-filter", + "type": "java.util.List" + } + ] +} \ No newline at end of file diff --git a/Ylt/gw-saas-mgr/target/classes/bootstrap-dev.yml b/Ylt/gw-saas-mgr/target/classes/bootstrap-dev.yml index 1f481d9..5a86a06 100644 --- a/Ylt/gw-saas-mgr/target/classes/bootstrap-dev.yml +++ b/Ylt/gw-saas-mgr/target/classes/bootstrap-dev.yml @@ -290,9 +290,7 @@ monitorapi: ribbon: listOfServers: http://i100c.3322.org:30731 - - - +# 负载均衡 ribbon: eureka: enabled: false #禁用eureka,不依赖 eureka @@ -313,15 +311,15 @@ hystrix: thread: timeoutInMilliseconds: 8000 #配置HystrixCommand执行的超时时间,执行超过该时间会进行服务降级处理 8s - +# 数据库 spring: data: mongodb: host: 10.10.14.210 port: 27017 - database: ycharge - username: root - password: 123456 + database: yltcharge + username: yltcharge + password: yltcharge dinger: project-id: ${spring.application.name}-${spring.profiles.active} dingers: diff --git a/Ylt/ms-admin/src/main/resources/bootstrap-dev.yml b/Ylt/ms-admin/src/main/resources/bootstrap-dev.yml index 4aa949c..81ef0b4 100644 --- a/Ylt/ms-admin/src/main/resources/bootstrap-dev.yml +++ b/Ylt/ms-admin/src/main/resources/bootstrap-dev.yml @@ -24,7 +24,7 @@ spring: database: 0 host: 10.10.14.210 port: 6379 - password: rzyc#redis + password: ylt#redis timeout: 0 pool: max-active: 8 diff --git a/Ylt/ms-excel/src/main/resources/bootstrap-test-rz.yml b/Ylt/ms-excel/src/main/resources/bootstrap-test-rz.yml index 3493204..4a824eb 100644 --- a/Ylt/ms-excel/src/main/resources/bootstrap-test-rz.yml +++ b/Ylt/ms-excel/src/main/resources/bootstrap-test-rz.yml @@ -23,7 +23,7 @@ spring: database: 0 host: 10.10.14.210 port: 6379 - password: rzyc#redis + password: ylt#redis timeout: 0 pool: max-active: 8 diff --git a/Ylt/ms-finance/src/main/resources/bootstrap-dev.yml b/Ylt/ms-finance/src/main/resources/bootstrap-dev.yml index b764bea..f937d5e 100644 --- a/Ylt/ms-finance/src/main/resources/bootstrap-dev.yml +++ b/Ylt/ms-finance/src/main/resources/bootstrap-dev.yml @@ -29,7 +29,7 @@ spring: database: 0 host: 10.10.14.210 port: 6379 - password: rzyc#redis + password: ylt#redis timeout: 0 pool: max-active: 8 diff --git a/Ylt/ms-openapi/src/main/resources/bootstrap-dev.yml b/Ylt/ms-openapi/src/main/resources/bootstrap-dev.yml index 9b132f7..0b7c707 100644 --- a/Ylt/ms-openapi/src/main/resources/bootstrap-dev.yml +++ b/Ylt/ms-openapi/src/main/resources/bootstrap-dev.yml @@ -25,7 +25,7 @@ spring: database: 0 host: 10.10.14.210 port: 6379 - password: rzyc#redis + password: ylt#redis timeout: 0 pool: max-active: 8 diff --git a/Ylt/ms-openapi/src/main/resources/bootstrap-test-rz.yml b/Ylt/ms-openapi/src/main/resources/bootstrap-test-rz.yml index 104bdab..c77ac77 100644 --- a/Ylt/ms-openapi/src/main/resources/bootstrap-test-rz.yml +++ b/Ylt/ms-openapi/src/main/resources/bootstrap-test-rz.yml @@ -23,7 +23,7 @@ spring: database: 0 host: 10.10.14.210 port: 6379 - password: rzyc#redis + password: ylt#redis timeout: 0 pool: max-active: 8 diff --git a/Ylt/ms-station/src/main/java/com/charge/station/StationApplication.java b/Ylt/ms-station/src/main/java/com/charge/station/StationApplication.java index 63d7663..d3b1844 100644 --- a/Ylt/ms-station/src/main/java/com/charge/station/StationApplication.java +++ b/Ylt/ms-station/src/main/java/com/charge/station/StationApplication.java @@ -13,7 +13,6 @@ import org.springframework.web.bind.annotation.RestController; @EnableFeignClients @ComponentScan("com.charge") @SpringBootApplication -@EnableAutoConfiguration @EnableScheduling @MapperScan(basePackages = "com.charge.station.dao") @RestController diff --git a/Ylt/ms-station/src/main/resources/bootstrap-dev.yml b/Ylt/ms-station/src/main/resources/bootstrap-dev.yml index 63865fa..5f3f051 100644 --- a/Ylt/ms-station/src/main/resources/bootstrap-dev.yml +++ b/Ylt/ms-station/src/main/resources/bootstrap-dev.yml @@ -1,9 +1,8 @@ spring: datasource: -# url: jdbc:mysql://10.10.14.210:22066/ycharge?useUnicode=true&characterEncoding=UTF-8 url: jdbc:mysql://10.10.14.210:22066/yltcharge?useUnicode=true&characterEncoding=UTF-8 - username: yltcharge - password: yltcharge + username: root + password: DsideaL147258369 driver-class-name: com.mysql.jdbc.Driver druid: stat-view-servlet: @@ -14,7 +13,7 @@ spring: redis: host: 10.10.14.210 - port: 6381 + port: 6379 password: ylt#redis timeout: 0 pool: @@ -36,7 +35,7 @@ aliyun: secretKey: PMXAuT3fiknhtM3YlR59SfW9BFXu62 namesrvAddr: http://MQ_INST_1003084411458690_Bcazi6ow.mq-internet-access.mq-internet.aliyuncs.com:80 - +# 不知道啥意思 protocolapi: ribbon: listOfServers: http://i100c.3322.org:7019 @@ -81,7 +80,7 @@ api: station: queryEquipAuth: true - +# 发短信用的阿里短信网关 aliSms: product: Dysmsapi domain: dysmsapi.aliyuncs.com diff --git a/Ylt/ms-station/target/classes/bootstrap-dev.yml b/Ylt/ms-station/target/classes/bootstrap-dev.yml index 63865fa..5f3f051 100644 --- a/Ylt/ms-station/target/classes/bootstrap-dev.yml +++ b/Ylt/ms-station/target/classes/bootstrap-dev.yml @@ -1,9 +1,8 @@ spring: datasource: -# url: jdbc:mysql://10.10.14.210:22066/ycharge?useUnicode=true&characterEncoding=UTF-8 url: jdbc:mysql://10.10.14.210:22066/yltcharge?useUnicode=true&characterEncoding=UTF-8 - username: yltcharge - password: yltcharge + username: root + password: DsideaL147258369 driver-class-name: com.mysql.jdbc.Driver druid: stat-view-servlet: @@ -14,7 +13,7 @@ spring: redis: host: 10.10.14.210 - port: 6381 + port: 6379 password: ylt#redis timeout: 0 pool: @@ -36,7 +35,7 @@ aliyun: secretKey: PMXAuT3fiknhtM3YlR59SfW9BFXu62 namesrvAddr: http://MQ_INST_1003084411458690_Bcazi6ow.mq-internet-access.mq-internet.aliyuncs.com:80 - +# 不知道啥意思 protocolapi: ribbon: listOfServers: http://i100c.3322.org:7019 @@ -81,7 +80,7 @@ api: station: queryEquipAuth: true - +# 发短信用的阿里短信网关 aliSms: product: Dysmsapi domain: dysmsapi.aliyuncs.com diff --git a/Ylt/ms-task/src/main/resources/bootstrap-dev.yml b/Ylt/ms-task/src/main/resources/bootstrap-dev.yml index ce6b2c0..2a1c36f 100644 --- a/Ylt/ms-task/src/main/resources/bootstrap-dev.yml +++ b/Ylt/ms-task/src/main/resources/bootstrap-dev.yml @@ -22,7 +22,7 @@ spring: redis: host: 10.10.14.210 port: 6379 - password: rzyc#redis + password: ylt#redis timeout: 0 pool: max-active: 8 diff --git a/Ylt/ms-user/src/main/resources/bootstrap-dev.yml b/Ylt/ms-user/src/main/resources/bootstrap-dev.yml index d246bdb..a21f792 100644 --- a/Ylt/ms-user/src/main/resources/bootstrap-dev.yml +++ b/Ylt/ms-user/src/main/resources/bootstrap-dev.yml @@ -20,7 +20,7 @@ spring: database: 0 host: 10.10.14.210 port: 6379 - password: rzyc#redis + password: ylt#redis timeout: 0 pool: max-active: 8 diff --git a/Ylt/ms-user/src/main/resources/bootstrap-test-rz.yml b/Ylt/ms-user/src/main/resources/bootstrap-test-rz.yml index d9d6cb3..6a0ff32 100644 --- a/Ylt/ms-user/src/main/resources/bootstrap-test-rz.yml +++ b/Ylt/ms-user/src/main/resources/bootstrap-test-rz.yml @@ -18,7 +18,7 @@ spring: database: 0 host: 10.10.14.210 port: 6379 - password: rzyc#redis + password: ylt#redis timeout: 0 pool: max-active: 8 diff --git a/Ylt/ms-wallet/src/main/resources/bootstrap-dev.yml b/Ylt/ms-wallet/src/main/resources/bootstrap-dev.yml index 6e28ca9..1713e6f 100644 --- a/Ylt/ms-wallet/src/main/resources/bootstrap-dev.yml +++ b/Ylt/ms-wallet/src/main/resources/bootstrap-dev.yml @@ -18,7 +18,7 @@ spring: database: 0 host: 10.10.14.210 port: 6379 - password: rzyc#redis + password: ylt#redis timeout: 0 pool: max-active: 8 diff --git a/ds_tools/pom.xml b/ds_tools/pom.xml deleted file mode 100644 index 795d99a..0000000 --- a/ds_tools/pom.xml +++ /dev/null @@ -1,32 +0,0 @@ - - 4.0.0 - - com.icharge.framework - rough - 1.0.0 - - ds_tools - Archetype - ds_tools - http://maven.apache.org - - - com.zaxxer - HikariCP - 4.0.3 - - - - - cn.smallbun.screw - screw-core - 1.0.5 - - - - org.freemarker - freemarker - 2.3.30 - - - diff --git a/ds_tools/src/main/src/GenerateMysqlDoc.java b/ds_tools/src/main/src/GenerateMysqlDoc.java deleted file mode 100644 index a073339..0000000 --- a/ds_tools/src/main/src/GenerateMysqlDoc.java +++ /dev/null @@ -1,81 +0,0 @@ -import cn.smallbun.screw.core.Configuration; -import cn.smallbun.screw.core.engine.EngineConfig; -import cn.smallbun.screw.core.engine.EngineFileType; -import cn.smallbun.screw.core.engine.EngineTemplateType; -import cn.smallbun.screw.core.execute.DocumentationExecute; -import cn.smallbun.screw.core.process.ProcessConfig; -import com.zaxxer.hikari.HikariConfig; -import com.zaxxer.hikari.HikariDataSource; - -import javax.sql.DataSource; -import java.util.ArrayList; - -public class GenerateMysqlDoc { - public static void main(String[] args) { - String fileOutputDir = "c:\\"; - //数据源 - HikariConfig hikariConfig = new HikariConfig(); - hikariConfig.setDriverClassName("com.mysql.jdbc.Driver"); - hikariConfig.setJdbcUrl("jdbc:mysql://10.10.14.210:22066/yltcharge?useUnicode=true&characterEncoding=UTF-8&useSSL=false"); - hikariConfig.setUsername("root"); - hikariConfig.setPassword("DsideaL147258369"); - //设置可以获取tables remarks信息 - hikariConfig.addDataSourceProperty("useInformationSchema", "true"); - hikariConfig.setMinimumIdle(2); - hikariConfig.setMaximumPoolSize(5); - DataSource dataSource = new HikariDataSource(hikariConfig); - //生成配置 - EngineConfig engineConfig = EngineConfig.builder() - //生成文件路径 - .fileOutputDir(fileOutputDir) - //打开目录 - .openOutputDir(true) - //文件类型 - .fileType(EngineFileType.HTML) - //生成模板实现 - .produceType(EngineTemplateType.freemarker) - //自定义文件名称 - .fileName("驿来特数据库文档").build(); - - //忽略表 - ArrayList ignoreTableName = new ArrayList<>(); - //ignoreTableName.add("test_user"); - //ignoreTableName.add("test_group"); - //忽略表前缀 - ArrayList ignorePrefix = new ArrayList<>(); - //ignorePrefix.add("test_"); - //忽略表后缀 - ArrayList ignoreSuffix = new ArrayList<>(); - //ignoreSuffix.add("_test"); - - ProcessConfig processConfig = ProcessConfig.builder() - //指定生成逻辑、当存在指定表、指定表前缀、指定表后缀时,将生成指定表,其余表不生成、并跳过忽略表配置 - //根据名称指定表生成 - //.designatedTableName(new ArrayList<>()) - //根据表前缀生成 - .designatedTablePrefix(new ArrayList<>()) - //根据表后缀生成 - .designatedTableSuffix(new ArrayList<>()) - //忽略表名 - .ignoreTableName(ignoreTableName) - //忽略表前缀 - .ignoreTablePrefix(ignorePrefix) - //忽略表后缀 - .ignoreTableSuffix(ignoreSuffix).build(); - //配置 - Configuration config = Configuration.builder() - //版本 - .version("1.0.0") - //描述 - .description("驿来特数据库设计文档生成") - //数据源 - .dataSource(dataSource) - //生成配置 - .engineConfig(engineConfig) - //生成配置 - .produceConfig(processConfig) - .build(); - //执行生成 - new DocumentationExecute(config).execute(); - } -} diff --git a/ds_tools/src/main/src/TestRocketMQ.java b/ds_tools/src/main/src/TestRocketMQ.java deleted file mode 100644 index d23d997..0000000 --- a/ds_tools/src/main/src/TestRocketMQ.java +++ /dev/null @@ -1,140 +0,0 @@ -import org.apache.rocketmq.client.consumer.DefaultLitePullConsumer; -import org.apache.rocketmq.client.producer.DefaultMQProducer; -import org.apache.rocketmq.client.producer.MessageQueueSelector; -import org.apache.rocketmq.client.producer.SendCallback; -import org.apache.rocketmq.client.producer.SendResult; -import org.apache.rocketmq.common.message.Message; -import org.apache.rocketmq.common.message.MessageExt; -import org.apache.rocketmq.common.message.MessageQueue; -import org.apache.rocketmq.remoting.common.RemotingHelper; - -import java.io.IOException; -import java.util.List; - -//Java整合RocketMQ实现生产消费 -//https://blog.csdn.net/qq_28314431/article/details/128452607 - -public class TestRocketMQ { - private final static String nameServer = "10.10.14.210:9876"; - - private final static String producerGroup = "my_group"; - private final static String consumerGroup = "my_group"; - private final static String topic = "topic-test"; - - //同步发送 - public static void syncSend() { - try { - // 初始化一个producer并设置Producer group name - DefaultMQProducer producer = new DefaultMQProducer(producerGroup); - // 设置NameServer地址 - producer.setNamesrvAddr(nameServer); - // 启动producer - producer.start(); - // 创建一条消息,并指定topic、tag、body等信息,tag可以理解成标签,对消息进行再归类,RocketMQ可以在消费端对tag进行过滤 - Message msg = new Message(topic, "tagA", "Hello RocketMQ".getBytes(RemotingHelper.DEFAULT_CHARSET)); - // 利用producer进行发送,并同步等待发送结果 - SendResult sendResult = producer.send(msg, 10000); - System.out.printf("%s%n", sendResult); - // 一旦producer不再使用,关闭producer - producer.shutdown(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - //异步发送 - public static void asyncSend() throws IOException { - try { - // 初始化一个producer并设置Producer group name - DefaultMQProducer producer = new DefaultMQProducer(producerGroup); - // 设置NameServer地址 - producer.setNamesrvAddr(nameServer); - // 启动producer - producer.start(); - // 创建一条消息,并指定topic、tag、body等信息,tag可以理解成标签,对消息进行再归类,RocketMQ可以在消费端对tag进行过滤 - Message msg = new Message(topic, "tagB", "Hello RocketMQ".getBytes(RemotingHelper.DEFAULT_CHARSET)); - // 异步发送消息, 发送结果通过callback返回给客户端 - producer.send(msg, new SendCallback() { - public void onSuccess(SendResult sendResult) { - System.out.printf("OK %s %n", - sendResult.getMsgId()); - } - - public void onException(Throwable e) { - System.out.printf("Exception %s %n", e); - e.printStackTrace(); - } - }, 10000); - } catch (Exception e) { - e.printStackTrace(); - } - System.in.read(); - } - - //顺序消息 - public static void orderSend() { - try { - // 初始化一个producer并设置Producer group name - DefaultMQProducer producer = new DefaultMQProducer(producerGroup); - // 设置NameServer地址 - producer.setNamesrvAddr(nameServer); - producer.setSendMsgTimeout(10000); - // 启动producer - producer.start(); - String[] tags = new String[]{"TagA", "TagB", "TagC"}; - for (int i = 0; i < 10; i++) { - int orderId = i % 10; - Message msg = new Message(topic, tags[i % tags.length], "KEY" + i, ("Hello RocketMQ " + i).getBytes(RemotingHelper.DEFAULT_CHARSET)); - SendResult sendResult = producer.send(msg, new MessageQueueSelector() { - public MessageQueue select(List mqs, Message msg, Object arg) { - Integer id = (Integer) arg; - int index = id % mqs.size(); - return mqs.get(index); - } - }, orderId); - System.out.printf("%s%n", sendResult); - } - } catch (Exception e) { - e.printStackTrace(); - } - } - - - public static void consumerPull() { - try { - DefaultLitePullConsumer consumer = new DefaultLitePullConsumer(consumerGroup); - consumer.setNamesrvAddr(nameServer); - //关闭自动提交 - consumer.setAutoCommit(false); - consumer.subscribe(topic, "*"); - consumer.setPullBatchSize(20); - consumer.start(); - while (true) { - List messageExts = consumer.poll(); - if (messageExts.size() > 0) { - String str = new String(messageExts.get(0).getBody()); - System.out.println(str); - } else { - System.out.println("本轮没有找到需要消费的消息!"); - } - consumer.commitSync(); - } - } catch (Exception e) { - e.printStackTrace(); - } - } - - public static void main(String[] args) throws IOException { - //同步发送 - syncSend(); - - //异步发送 - //asyncSend(); - - //顺序消息 - //orderSend(); - - //拉消费 - consumerPull(); - } -} diff --git a/ds_tools/target/classes/META-INF/maven/archetype.xml b/ds_tools/target/classes/META-INF/maven/archetype.xml deleted file mode 100644 index 778027d..0000000 --- a/ds_tools/target/classes/META-INF/maven/archetype.xml +++ /dev/null @@ -1,9 +0,0 @@ - - ds_tools - - src/main/java/App.java - - - src/test/java/AppTest.java - - diff --git a/ds_tools/target/classes/archetype-resources/pom.xml b/ds_tools/target/classes/archetype-resources/pom.xml deleted file mode 100644 index ae6cb95..0000000 --- a/ds_tools/target/classes/archetype-resources/pom.xml +++ /dev/null @@ -1,15 +0,0 @@ - - 4.0.0 - $com.icharge.framework - $ds_tools - $1.0.0 - - - junit - junit - 3.8.1 - test - - - diff --git a/ds_tools/target/classes/archetype-resources/src/main/java/App.java b/ds_tools/target/classes/archetype-resources/src/main/java/App.java deleted file mode 100644 index 318771a..0000000 --- a/ds_tools/target/classes/archetype-resources/src/main/java/App.java +++ /dev/null @@ -1,13 +0,0 @@ -package $com.icharge.framework; - -/** - * Hello world! - * - */ -public class App -{ - public static void main( String[] args ) - { - System.out.println( "Hello World!" ); - } -} diff --git a/ds_tools/target/classes/archetype-resources/src/test/java/AppTest.java b/ds_tools/target/classes/archetype-resources/src/test/java/AppTest.java deleted file mode 100644 index cbe33ea..0000000 --- a/ds_tools/target/classes/archetype-resources/src/test/java/AppTest.java +++ /dev/null @@ -1,38 +0,0 @@ -package $com.icharge.framework; - -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; - -/** - * Unit test for simple App. - */ -public class AppTest - extends TestCase -{ - /** - * Create the test case - * - * @param testName name of the test case - */ - public AppTest( String testName ) - { - super( testName ); - } - - /** - * @return the suite of tests being tested - */ - public static Test suite() - { - return new TestSuite( AppTest.class ); - } - - /** - * Rigourous Test :-) - */ - public void testApp() - { - assertTrue( true ); - } -} diff --git a/操作文档/3、安装Mongodb.md b/操作文档/3、安装Mongodb.md index d841448..d11b3d0 100644 --- a/操作文档/3、安装Mongodb.md +++ b/操作文档/3、安装Mongodb.md @@ -98,10 +98,15 @@ db.createUser({ user: "admin", pwd: "DsideaL147258369", roles: [ { role: "userAd # 重启 MongoDB 服务 mongo db.updateUser('root',{pwd:'DsideaL147258369',roles:[{role:'root',db:'admin'}]}) +db.updateUser('root',{pwd:'DsideaL147258369',roles:[{role:'root',db:'ycharge'}]}) ``` +# MongoDB4.28开启权限认证配置用户密码登录功能 + +> https://www.jb51.net/article/234416.htm + # 常用命令 ``` @@ -121,6 +126,31 @@ exit #退出MongoDB控制台 +``` +[root@hadoop-master bin]# mongo +use admin + +#db.dropUser("root") +#db.dropUser("admin") + +db.createUser({user:"root",pwd:"DsideaL147258369",roles:["root"]}) + show users + +use yltcharge +db.createUser({user:"yltcharge",pwd:"yltcharge",roles:[{role:"readWrite",db:"yltcharge"}]}) + +#认证模式(true代表开启认证登录,false代表未开启认证登录) +auth=true + +重启动 +/usr/local/mongodb/bin/mongod -f /usr/local/mongodb/mongodb.conf + +use admin +db.auth("root","DsideaL147258369") + +use yltcharge +db.auth("yltcharge","yltcharge"); +``` diff --git a/操作文档/4、安装Redis.md b/操作文档/4、安装Redis.md index 1332bfa..de9e2f5 100644 --- a/操作文档/4、安装Redis.md +++ b/操作文档/4、安装Redis.md @@ -53,7 +53,7 @@ repl-disable-tcp-nodelay no replica-priority 100 -requirepass rzyc#redis +requirepass ylt#redis lazyfree-lazy-eviction no