首页 文章 精选 留言 我的

精选列表

搜索[基础搭建],共10014篇文章
优秀的个人博客,低调大师

Docker安装Oracle12C,快速搭建Oracle学习环境

安装说明 1.操作系统CentOS7_x64 2.安装的数据库为Oracle12C 3.已经安装了Docker环境 4.需要检查是否有swap分区,如果没有请设置 安装 1.Docker安装 镜像准备 sh 复制代码 docker pull sath89/oracle-12c 启动镜像 sh 复制代码 docker run -d --name oracle12c -p 8080:8080 -p 1521:1521 -v $PWD/data:/mnt -e TZ=Asia/Shanghai sath89/oracle-12c 注: oracle12c为Docker容器名称 8080:8080为内部端口映射外部端口 1521:1521为内部端口映射外部端口 查看日志,等待安装结束 sh 复制代码 docker logs -f -t oracle12c 默认数据库信息 sid: xe username: system password: oracle 2.切换镜像配置密码 查看镜像是否在运行 sh 复制代码 docker ps 进入oracle12c容器 sh 复制代码 docker exec -it oracle12c /bin/bash 注:oracle12c为Docker容器名称,注意与上面对应 进入oracle数据库 sh 复制代码 sqlplus system/oracle 注: system为用户名 oracle为密码 查看数据库运行状态 sh 复制代码 select status from v$instance; 修改sys用户密码 sh 复制代码 alter user sys identified by oracle; 3.外网连接测试 用户名:sys 密码:oracle 服务名:xe 端口:1521

优秀的个人博客,低调大师

1 框架基础搭建

一、新建一个Cordova项目 cordova create PSDPlatform cd PSDPlatform 二、 新建vonic-webpack模板 项目使用Vonic作为UI模板,开发者提供了一个Vonic的开发脚手架,即如下网址:https://github.com/wangdahoo/vonic-webpack-starter git clone https://github.com/wangdahoo/vonic-webpack-starter.git cd vonic-webpack-starter npm install -g yarn yarn 注意事项: 在安装vonic模板过程中,可能会出现node-sass安装Error,出错解决方案为: 1.npm install node-sass --registry=http://registry.npm.taobao.org 2.yarn 三、Cordova 环境配置 CD 项目根目录 cordova platform add android --新增android 平台

优秀的个人博客,低调大师

PhotonServer(一)——服务器基础搭建

2 --> PhontonServer下载: https://www.photonengine.com/en-US/sdks#server-sdkserverserver 官方配置资料: https://doc.photonengine.com/en-us/server/current/getting-started/photon-server-in-5min 解除20人同时连接限制到100人同时连接: 下载后我们可以根据文档来进行Server的配置。刚下载并且解压下来后可以看到限制最大连接数为20人,那么这里我们可以升级到100人连接数的,首先注册并登录PhontonServer,然后再下面网址下载一个解除100人数限制的文件。https://dashboard.photonengine.com/en-US/selfhosted 下载后的文件,根据电脑系统,32位就放在PhotonServer解压下..\deploy\bin_Win32,如果是64位就放在PhotonServer解压下..\deploy\bin_Win64,我电脑是64,如下 然后我们启动PhotonControl.exe,这时候我们就可以看到最大连接数到了100人了。 创建自己的Server 我这里用的是VS 2017 完成后,要开始创建生成库,在PhotonServer解压下..\deploy中创建自己项目名称文件夹,在此文件夹中创建bin文件夹。 之后,开始开发服务器端,通过浏览,添加下载的PhotonServer中一下五个.dll文件 服务器代码: using Photon.SocketServer; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace AR_RemoteServer { //所有的Server端 主类都要继承自applicationbase public class RemoteServer : ApplicationBase { //当一个客户端请求连接的时候,服务器端就会调用这个方法 //我们使用peerbase,表示和一个客户端的链接,然后photon就会把这些链接管理起来 protected override PeerBase CreatePeer(InitRequest initRequest) { return new ClientPeer(initRequest); } protected override void Setup() { } protected override void TearDown() { } } } using Photon.SocketServer; using PhotonHostRuntimeInterfaces; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace AR_RemoteServer { //管理跟客户端的链接的 class ClientPeer : Photon.SocketServer.ClientPeer { public ClientPeer(InitRequest initRequest) : base(initRequest) { } //处理客户端断开连接的后续工作 protected override void OnDisconnect(DisconnectReason reasonCode, string reasonDetail) { } //处理客户端的请求 protected override void OnOperationRequest(OperationRequest operationRequest, SendParameters sendParameters) { } } } 至于服务端具体代码,后续我们在整合。 下面开始生成服务:配置好这些信息后,右击项目—>生成,生成后在之前设置的文件夹下就会出现.dll文件 开始配置刚才生成的Server: 首先,打开PhotonServer.config配置 开始配置我们的TCP,UDP配置。用VS打开它。可以看到LoadBalancing配置,可以根据这个写入字节的配置节点,这里我们直接复制一份出来,还是复制到PhotonServer.config下,修改一下节点就OK。 <ArRemote MaxMessageSize="512000" MaxQueuedDataPerPeer="512000" PerPeerMaxReliableDataInTransit="51200" PerPeerTransmitRateLimitKBSec="256" PerPeerTransmitRatePeriodMilliseconds="200" MinimumTimeout="5000" MaximumTimeout="30000" DirectDispatchToCLR="true" DisplayName="ArRemote"> <!-- 0.0.0.0 opens listeners on all available IPs. Machines with multiple IPs should define the correct one here. --> <!-- Port 5055 is Photon's default for UDP connections. --> <UDPListeners> <UDPListener IPAddress="0.0.0.0" Port="5055" OverrideApplication="AR_RemoteServer"> </UDPListener> </UDPListeners> <!-- 0.0.0.0 opens listeners on all available IPs. Machines with multiple IPs should define the correct one here. --> <TCPListeners> <!-- TCP listener for Game clients on Master application --> <TCPListener IPAddress="0.0.0.0" Port="4530" OverrideApplication="AR_RemoteServer" InactivityTimeout="10000"> </TCPListener> </TCPListeners> <!-- WebSocket (and Flash-Fallback) compatible listener --> <WebSocketListeners> <WebSocketListener IPAddress="0.0.0.0" Port="9090" DisableNagle="true" InactivityTimeout="10000" OverrideApplication="AR_RemoteServer"> </WebSocketListener> </WebSocketListeners> <!-- Defines the Photon Runtime Assembly to use. --> <Runtime Assembly="PhotonHostRuntime, Culture=neutral" Type="PhotonHostRuntime.PhotonDomainManager" UnhandledExceptionPolicy="TerminateProcess"> </Runtime> <!-- Defines which applications are loaded on start and which of them is used by default. Make sure the default application is defined. --> <!-- Application-folders must be located in the same folder as the bin_Win64 folders. The BaseDirectory must include a "bin" folder. --> <Applications Default="AR_RemoteServer"> <Application Name="AR_RemoteServer" BaseDirectory="AR_RemoteServer" Assembly="AR_RemoteServer" Type="AR_RemoteServer.RemoteServer"> </Application> </Applications> </ArRemote> 修改部分: Application标签中,添加 ForceAutoRestart="true"表示是“否自动重启”。 最后关闭重启下Photon,就可以看到ArRemote的Application 了,启动起来。 日志输出: 打开Open logs,会弹出 输出Server启动的一些信息,如果启动出错可以在这找错误信息。另一个CLR是提示License以及最大连接数,以及运行的Photon的应用的配置信息等,可以通过CLR看出哪些配置出错了,这个是Photon的两个日志输出. 出现上面的running就启动成功。 出现上面CServerice:OnException(),表示出现错误,看后面意思修改。 扩展自己Log输出: 上边已经引入log4net.dll文件,可以去log4net的官网找这个配置怎么写,也可以在我们下载的photon里面找这个配置文件。这里我在phonton文件下的目录里面找到了配置文件log4net.config,把配置文件log4net.config复制到我们项目里面的根目录下并且将它设置为始终复制,然后打开配置文件修改里面的配置。 下面我们开始创建一个Log对象,然后初始化。在RemoteServer这个类里面定义一个Log对象 //定义一个Log对象 public static readonly ILogger log = LogManager.GetCurrentClassLogger(); //调用 log.Info("连接"); 输出日志文件在下列路径可以找到,我定义的名字是AR.Server.log 最重要的一点:自定义的输出日志必须在Server启动时初始化它的位置等信息 protected override void Setup() { //日志的初始化(定义配置文件log4net位置) //Path.Combine 表示连接目录和文件名,可以屏蔽平台的差异 // Photon: ApplicationLogPath 就是配置文件里面路径定义的属性 //this.ApplicationPath 表示可以获取photon的根目录,就是Photon-OnPremise-Server-SDK_v5\deploy这个目录 //这一步是设置日志输出的文档文件的位置,这里我们把文档放在Photon-OnPremise-Server-SDK_v5\deploy\bin_Win64\log里面 log4net.GlobalContext.Properties["Photon:ApplicationLogPath"] = Path.Combine(Path.Combine(Path.Combine(this.ApplicationRootPath, "bin_win64")), "log"); //this.BinaryPath表示可以获取的部署目录就是目录Photon-OnPremise-Server-SDK_v5\deploy\AR_RemoteServer\bin FileInfo configFileInfo = new FileInfo(Path.Combine(this.BinaryPath, "log4net.config")); //如果这个配置文件存在 if (configFileInfo.Exists) { LogManager.SetLoggerFactory(Log4NetLoggerFactory.Instance);//设置photon使用哪个日志插件 //让log4net这个插件读取配置文件 XmlConfigurator.ConfigureAndWatch(configFileInfo); } //初始化 log.Info("Server启动!");//最后利用log对象就可以输出了 } 打开自定义日志,如下 这样整个服务就配置好了,至于服务编码后续再总结

优秀的个人博客,低调大师

SSM基础框架搭建

SSM(Spring + SpringMVC + MyBatis)三个开源框架的简称,是WEB项目开发的不二之选,是码农进阶全栈工程师心路历程上的驿站。大公司开源框架和算法制定标准规范引领行业趋势,小公司拿来主义面向业务敏捷开发快速迭代在夹缝中艰难生存。SSM框架完美的符合了当下的这种行业现状,对于底层是如何实现的开发人员完全不必关注,踏踏实实梳理好业务逻辑,做好质量把控年底KPI基本问题就不大了。 Spring是一个轻量级IoC及AOP容器框架,配置又多又细,SpringBoot简化了大量通用且不常用的配置项,使构建一个微服务变得超简单;SpringMVC是目前最优秀的MVC框架,注解用得好事半功倍;MyBatis用于数据持久化,MyBatisPlus增强版内置分页功能简化开发流程自动化代码生成,唯一要做的事情就剩下写写SQL了。 无私的分享从这里开始: git clone git@gitee.com:gonglibin/kirin.git 文件夹 PATH 列表 卷序列号为 0009-68A2 D:\WORKSPACES\KIRIN │ kirin.iml │ pom.xml │ ├─.idea │ │ .name │ │ compiler.xml │ │ encodings.xml │ │ misc.xml │ │ modules.xml │ │ uiDesigner.xml │ │ workspace.xml │ │ │ ├─copyright │ │ profiles_settings.xml │ │ │ ├─inspectionProfiles │ │ profiles_settings.xml │ │ Project_Default.xml │ │ │ └─libraries │ (略) │ └─src ├─main │ ├─java │ │ └─com │ │ └─kirin │ │ ├─api │ │ │ ├─controller │ │ │ │ KrnStatisticAdownerController.java │ │ │ │ │ │ │ ├─request │ │ │ └─response │ │ │ KrnResponse.java │ │ │ │ │ ├─dao │ │ │ ├─entity │ │ │ │ StatisticAdowner.java │ │ │ │ │ │ │ ├─impl │ │ │ │ KrnStatisticAdownerServiceImpl.java │ │ │ │ │ │ │ ├─mapper │ │ │ │ KrnStatisticAdownerMapper.java │ │ │ │ │ │ │ └─service │ │ │ KrnStatisticAdownerService.java │ │ │ │ │ └─web │ │ ├─server │ │ │ KrnApplication.java │ │ │ KrnInterceptor.java │ │ │ KrnMvcConfig.java │ │ │ │ │ └─tools │ │ KrnAutoMysql.java │ │ │ └─resources │ │ application.properties │ │ kirin.properties │ │ │ ├─mybatis │ │ mybatis-config.xml │ │ spring-jdbc.xml │ │ spring-mybatis.xml │ │ │ ├─spring │ │ spring-web-entry.xml │ │ │ └─xml │ StatisticAdowner.xml │ └─test └─java └─com └─kirin kirin/src/main/java/com/kirin/web/server/KrnApplication.java @SpringBootApplication @ImportResource("classpath:spring/spring-web-entry.xml") @EnableAutoConfiguration(exclude = {DataSourceAutoConfiguration.class}) public class KrnApplication { private static Logger logger = LoggerFactory.getLogger(KrnApplication.class); public static void main(String[] args) { SpringApplication.run(KrnApplication.class, args); } } 1行@SpringBootApplication表示该对象为当前应用的启动类; 2行@ImportResource表示引入配置文件资源读取解析及加载; 8行启动,就这么简单~~~ kirin/src/main/java/com/kirin/web/server/ KrnMvcConfig.java @Configuration public class KrnMvcConfig extends WebMvcConfigurerAdapter { private static Logger logger = LoggerFactory.getLogger(KrnMvcConfig.class); @Override public void addResourceHandlers(ResourceHandlerRegistry registry) { super.addResourceHandlers(registry); } @Override public void addInterceptors(InterceptorRegistry registry) { registry.addInterceptor(new KrnInterceptor()).addPathPatterns("/**"); } } KrnMvcConfig类继承自WebMvcConfigurerAdapter抽象类(该类实现了WebMvcConfigurer接口方法为空并交给子类去实现); 1行@Configuration表示希望Spring将该类作为配置项资源; 6行实现静态资源处理; 11行向资源中添加拦截器; kirin/src/main/java/com/kirin/web/server/ KrnInterceptor.java public class KrnInterceptor implements HandlerInterceptor { /** * 该方法将在请求处理之前被调用,只有该方法返回true,才会继续 * 执行后续的Interceptor和Controller,当返回值为true时就会 * 继续调用下一个Interceptor的preHandle方法,如果已经是最后 * 一个Interceptor的时候就会是调用当前请求的Controller方法。 */ @Override public boolean preHandle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object o) throws Exception { boolean rst = true; String err = "{\"code\":500,\"message\":\"操作错误\",\"data\":null}"; if (true != httpServletRequest.getMethod().equals("GET")) { httpServletResponse.setCharacterEncoding("UTF-8"); httpServletResponse.setContentType("text/html; charset=utf-8"); try { PrintWriter writer = httpServletResponse.getWriter(); writer.print(err); writer.close(); } catch (Exception e) { e.printStackTrace(); } rst = false; } return rst; } /** * 该方法将在请求处理之后,DispatcherServlet进行视图 * 返回渲染之前进行调用,可以在这个方法中对Controller * 处理之后的ModelAndView 对象进行操作。 */ @Override public void postHandle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object o, ModelAndView modelAndView) throws Exception { } /** * 该方法也是需要当前对应的Interceptor的preHandle方法的返回值为true * 时才会执行,该方法将在整个请求结束之后,也就是在DispatcherServlet * 渲染了对应的视图之后执行。用于进行资源清理。 */ @Override public void afterCompletion(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object o, Exception e) throws Exception { } } KrnInterceptor类继承自HandlerInterceptor接口,接口定义了三个方法,分别对应在不同的阶段启动拦截事件,详情见注释,preHandle方法为演示,当HTTP请求不为GET时返回报错信息。 kirin/src/main/java/com/kirin/api/controller/KrnStatisticAdownerController.java @RestController @RequestMapping("/statisticadowner") public class KrnStatisticAdownerController { @Autowired KrnStatisticAdownerService krnStatisticAdownerService; @ResponseBody @RequestMapping("display") public Object getStatisticAdownerInfo() { return new KrnResponse<StatisticAdowner>(200, "操作成功", krnStatisticAdownerService.getStatisticAdownerInfo()); } } 1行@RestController (@ResponseBody + @Controller),表示将返回结果按照response的type直接写到HTTP的response body中去,且该类是一个控制器; 2行@RequestMapping表示将请求路径映射到的类上; 5行注入KrnStatisticAdownerService资源; 8行@RequestMapping表示将多级路径映射到该类的具体方法上; kirin/src/main/java/com/kirin/dao/entity/StatisticAdowner.java @TableName("t_statistic_adowner") public class StatisticAdowner implements Serializable { private static final long serialVersionUID = 1L; @TableId(value = "id", type = IdType.AUTO) private Integer id; /** * 展示量 */ @TableField("sad_viewAccount") private Integer sadViewaccount; // (省略) } 1行表示该类映射自哪张表,并将表结构映射成对象的成员变量; 6行@TableId为主键; 11行@TableField("sad_viewAccount")为表字段名; 需要说明的一点是数据表到类声明的自动化生成最好遵循一定的命名规则否则后果很严重; kirin/src/main/java/com/kirin/dao/service/KrnStatisticAdownerService.java 自定义KrnStatisticAdownerService接口继承自IService接口,其中定义了大量常用的增删改查的方法,基本涵盖了常用的数据库操作,自定义接口中的方法在控制器中被当作资源注入并调用。 kirin/src/main/java/com/kirin/dao/ impl/KrnStatisticAdownerServiceImpl.java @Service public class KrnStatisticAdownerServiceImpl extends ServiceImpl<KrnStatisticAdownerMapper, StatisticAdowner> implements KrnStatisticAdownerService { @Autowired KrnStatisticAdownerMapper krnStatisticAdownerMapper; @Override public StatisticAdowner getStatisticAdownerInfo() { return krnStatisticAdownerMapper.getStatisticAdownerInfo(); } } KrnStatisticAdownerServiceImpl类是KrnStatisticAdownerService接口的实现对象,它同时继承自ServiceImpl类,该类是IService接口中方法的具体实现。 4行注入KrnStatisticAdownerMapper资源; 7行覆盖KrnStatisticAdownerService接口中的方法; kirin/src/main/java/com/kirin/dao/ mapper/KrnStatisticAdownerMapper.java public interface KrnStatisticAdownerMapper extends BaseMapper<StatisticAdowner> { StatisticAdowner getStatisticAdownerInfo(); } 2行调用具体实现,建议在XML配置中书写SQL,好维护好管理逻辑清晰方便编辑修改; kirin/src/main/resources/xml/StatisticAdowner.xml <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.kirin.dao.mapper.KrnStatisticAdownerMapper"> <!-- 通用查询映射结果 --> <resultMap id="BaseResultMap" type="com.kirin.dao.entity.StatisticAdowner"> <id column="id" property="id" /> <result column="sad_viewAccount" property="sadViewaccount" /> <result column="sad_clickAccount" property="sadClickaccount" /> <result column="sad_costAmount" property="sadCostamount" /> <result column="sad_adOwnerId" property="sadAdownerid" /> <result column="sad_createTime" property="sadCreatetime" /> </resultMap> <!-- 通用查询结果列 --> <sql id="Base_Column_List"> id, sad_viewAccount AS sadViewaccount, sad_clickAccount AS sadClickaccount, sad_costAmount AS sadCostamount, sad_adOwnerId AS sadAdownerid, sad_createTime AS sadCreatetime </sql> <select id="getStatisticAdownerInfo" resultType="com.kirin.dao.entity.StatisticAdowner"> SELECT <include refid="Base_Column_List" /> FROM db_charm_app.t_statistic_adowner WHERE id = 1000123 </select> </mapper> select块部分是需要开发者实现的,把调试好的SQL复制到这里就OK了。 SSM框架设计的异常出色,使用起来异常便利,不过坑很多,踩一个少一个,都踩遍了工作起来就会变得很轻松,但是也会很乏味,剩下的事情全是面对不断的需求变更、业务调整和功能扩展,在日复一日的重复中慢慢老去~~~

优秀的个人博客,低调大师

Docker的基础环境搭建

1.升级系统的内核 1 2 3 cd /etc/yum .repos.d/ wgethttp: //www .hop5. in /yum/el6/hop5 .repo yum install kernel-ml-aufskernel-ml-aufs-devel-y 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 default =0 set to0andcheckCentos &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& [root@oldboy~]#vim/etc/grub.conf #grub.confgeneratedbyanaconda # #Notethatyoudonothavetorerungrubaftermakingchangestothisfile #NOTICE:Youhavea/bootpartition.Thismeansthat #allkernelandinitrdpathsarerelativeto/boot/,eg. #root(hd0,0) #kernel/vmlinuz-versionroroot=/dev/sda3 #initrd/initrd-[generic-]version.img #boot=/dev/sda default =0 timeout=5 splashimage=(hd0,0)/grub/splash.xpm.gz hiddenmenu titleCentOS(3.10.5-3.el6.x86_64) root(hd0,0) kernel/vmlinuz-3.10.5-3.el6.x86_64roroot=UUID=7b76340c-8d26-421c-b2bb-802770973f88rd_NO_LU KSrd_NO_LVM.UTF-8rd_NO_MDSYSFONT=latarcyrheb-sun16crashkernel=autoKEYBOARDTYPE=pcKEY TABLE=usrd_NO_DMrhgbquiet initrd/initramfs-3.10.5-3.el6.x86_64.img titleCentOS6(2.6.32-573.el6.x86_64) 1 2 3 4 5 6 7 8 然后重启 reboot 检查系统内核: [root@oldboy~] #uname-r 3.10.5-3.el6.x86_64 查看内核是否支持aufs [root@oldboy~] #grepaufs/proc/filesystems nodevaufs 2.关闭selinux 1 2 3 4 [root@oldboy~] #getenforce Disabled 没有的话关闭selinux sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config 3.安装docker 1 2 3 在FedoraEPEL源中已经提供了docker-io包,下载安装epel: rpm-ivhhttp: //mirrors .sohu.com /fedora-epel/6/x86_64/epel-release-6-8 .noarch.rpm sed -i 's/^mirrorlist=https/mirrorlist=http/' /etc/yum .repos.d /epel .repo 4.yum 安装docker-io 1 yum-y install docker-io 5.启动Docker 1 2 3 4 [root@oldboy~] #servicedockerstart Startingcgconfigservice:[确定] Startingdocker:[确定] [root@oldboy~] # 6.查看docker的版本 1 2 3 4 5 6 7 8 9 10 11 12 [root@oldboy~] #dockerversion Clientversion:1.7.1 ClientAPIversion:1.19 Goversion(client):go1.4.2 Gitcommit(client):786b29d /1 .7.1 OS /Arch (client):linux /amd64 Serverversion:1.7.1 ServerAPIversion:1.19 Goversion(server):go1.4.2 Gitcommit(server):786b29d /1 .7.1 OS /Arch (server):linux /amd64 [root@oldboy~] # 7.查看Docker的日志 1 2 3 4 5 6 7 8 9 10 11 12 [root@oldboy~] #cat/var/log/docker \n2016年08月02日星期二17:08:53CST\n time = "2016-08-02T17:08:53.628209179+08:00" level=infomsg= "ListeningforHTTPonunix(/var/run/docker.sock)" time = "2016-08-02T17:08:53.765733247+08:00" level=warningmsg= "Runningmodprobebridgenf_natfailedwithmessage:insmod/lib/modules/3.10.5-3.el6.x86_64/kernel/net/llc/llc.ko\ninsmod/lib/modules/3.10.5-3.el6.x86_64/kernel/net/802/stp.ko\ninstall/sbin/modprobe--ignore-installbridge&&/sbin/sysctl-q-wnet.bridge.bridge-nf-call-arptables=0net.bridge.bridge-nf-call-iptables=0net.bridge.bridge-nf-call-ip6tables=0\ninsmod/lib/modules/3.10.5-3.el6.x86_64/kernel/net/bridge/bridge.ko\ninsmod/lib/modules/3.10.5-3.el6.x86_64/kernel/net/netfilter/nf_conntrack.ko\ninsmod/lib/modules/3.10.5-3.el6.x86_64/kernel/net/netfilter/nf_nat.ko\n,error:exitstatus1" time = "2016-08-02T17:08:54.018750099+08:00" level=warningmsg= "Yourkerneldoesnotsupportswapmemorylimit." time = "2016-08-02T17:08:54.019550061+08:00" level=infomsg= "Loadingcontainers:start." time = "2016-08-02T17:08:54.019778904+08:00" level=infomsg= "Loadingcontainers:done." time = "2016-08-02T17:08:54.019801548+08:00" level=infomsg= "Daemonhascompletedinitialization" time = "2016-08-02T17:08:54.019823924+08:00" level=infomsg= "Dockerdaemon" commit= "786b29d/1.7.1" execdriver=native-0.2graphdriver=aufsversion=1.7.1 time = "2016-08-02T17:10:12.131694594+08:00" level=infomsg= "GET/v1.19/version" [root@oldboy~] # 本文转自 小小三郎1 51CTO博客,原文链接:http://blog.51cto.com/wsxxsl/1833624,如需转载请自行联系原作者

优秀的个人博客,低调大师

centos6 - elk基础入门搭建

1 2 3 4 5 6 7 [root@host-192-168-53-108~] #rm-rf/etc/yum.repos.d/* [root@host-192-168-53-108~] #wget-O/etc/yum.repos.d/CentOS-Base.repohttp://mirrors.aliyun.com/repo/Centos-6.repo [root@host-192-168-53-108~] #yumcleanall [root@host-192-168-53-108~] #yum-yinstalljava-1.8.0-openjdk* [root@host-192-168-53-108~] #wgethttps://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.5.0.rpm [root@host-192-168-53-108~] #rpm-ivhelasticsearch-5.5.0.rpm [root@host-192-168-53-108~] #chkconfig--addelasticsearch 1 2 [root@host-192-168-53-108~] #cat/etc/hosts 192.168.53.108elk1 1 2 3 4 5 6 7 8 9 [root@host-192-168-53-108~] #cat/etc/elasticsearch/elasticsearch.yml node.name:elk1 network.host:192.168.53.108 http.port:9200 bootstrap.memory_lock: false bootstrap.system_call_filter: false discovery.zen. ping .unicast.hosts:[elk1] http.cors.enabled: true http.cors.allow-origin: "*" 1 2 3 4 [root@host-192-168-53-108~] #cat/etc/elasticsearch/jvm.options|grep-v'^#'|grep-v^$ #修改 -Xms6g -Xmx6g 1 2 3 4 5 [root@host-192-168-53-108~] #vim/etc/security/limits.conf *softnofile1000000 *hardnofile1000000 *softnproc1000000 *hardnproc1000000 1 2 3 [root@host-192-168-53-108~] #cat/etc/security/limits.d/90-nproc.conf *softnproc100000 rootsoftnprocunlimited 1 2 3 4 5 6 [root@host-192-168-53-108~] #cd/usr/local/ [root@host-192-168-53-108 local ] #gitclonegit://github.com/mobz/elasticsearch-head.git [root@host-192-168-53-108 local ] #wgethttps://nodejs.org/dist/v8.2.0/node-v8.2.0-linux-x64.tar.gz--no-check-certificate [root@host-192-168-53-108 local ] #tarzxfnode-v8.2.0-linux-x64.tar.gz [root@host-192-168-53-108 local ] #ln-s/usr/local/node-v8.2.0-linux-x64/bin/node/usr/sbin/node [root@host-192-168-53-108 local ] #ln-s/usr/local/node-v8.2.0-linux-x64/bin/npm/usr/sbin/npm 1 2 3 4 5 #设置npm代理镜像 [root@host-192-168-53-108 local ] #npmconfigsetregistryhttps://registry.npm.taobao.org [root@host-192-168-53-108 local ] #npminstall-ggrunt [root@host-192-168-53-108 local ] #ln-s/usr/local/node-v8.2.0-linux-x64/lib/node_modules/grunt/bin/grunt/usr/sbin/grunt [root@host-192-168-53-108 local ] #cdelasticsearch-head/ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 [root@host-192-168-53-108elasticsearch- head ] #npminstall Errormakingrequest. Error:connectETIMEDOUT52.216.1.0:443 atObject.exports._errnoException(util.js:1024:11) atexports._exceptionWithHostPort(util.js:1047:20) atTCPConnectWrap.afterConnect[asoncomplete](net.js:1150:14) Pleasereportthisfulllogathttps: //github .com /Medium/phantomjs npmWARNelasticsearch- head @0.0.0licenseshouldbeavalidSPDXlicenseexpression npmWARNoptionalSKIPPINGOPTIONALDEPENDENCY:fsevents@1.1.2(node_modules /fsevents ): npmWARNnotsupSKIPPINGOPTIONALDEPENDENCY:Unsupportedplatform for fsevents@1.1.2:wanted{ "os" : "darwin" , "arch" : "any" }(current:{ "os" : "linux" , "arch" : "x64" }) npmERR!codeELIFECYCLE npmERR!errno1 npmERR!phantomjs-prebuilt@2.1.14 install :`node install .js` npmERR!Exitstatus1 npmERR! npmERR!Failedatthephantomjs-prebuilt@2.1.14 install script. npmERR!Thisisprobablynotaproblemwithnpm.Thereislikelyadditionalloggingoutputabove. npmERR!Acompletelogofthisruncanbefound in : npmERR! /root/ .npm /_logs/2017-07-26T11_29_47_063Z-debug .log 1 2 [root@host-192-168-53-108elasticsearch- head ] #npminstallphantomjs-prebuilt@2.1.14--ignore-scripts [root@host-192-168-53-108elasticsearch- head ] #npminstall 1 2 3 4 [root@host-192-168-53-108elasticsearch- head ] #vim/usr/local/elasticsearch-head/_site/app.js #把localhost改为ip this.base_uri=this.config.base_uri||this.prefs.get( "app-base_uri" )|| "http://localhost:9200" ; this.base_uri=this.config.base_uri||this.prefs.get( "app-base_uri" )|| "http://192.168.53.108:9200" ; 1 2 3 4 5 6 7 8 9 10 11 [root@host-192-168-53-108elasticsearch- head ] #vim/usr/local/elasticsearch-head/Gruntfile.js connect:{ server:{ options:{ hostname : "0.0.0.0" , #添加此行 port:9100, base: '.' , keepalive: true } } } 1 2 3 4 [root@host-192-168-53-108elasticsearch- head ] #gruntserver& [root@host-192-168-53-108elasticsearch- head ] #echo"cd/usr/local/elasticsearch-head;gruntserver&">>/etc/rc.local [root@host-192-168-53-108elasticsearch- head ] #cd [root@host-192-168-53-108~] #wgethttps://artifacts.elastic.co/downloads/logstash/logstash-5.5.0.rpm 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 [root@host-192-168-53-108~] #vim/etc/logstash/conf.d/system.conf input{ file { path=> "/var/log/messages" type => "systemlog" start_position=> "beginning" stat_interval=> "2" } } output{ elasticsearch{ hosts=>[ "192.168.53.108:9200" ] index=> "logstash-systemlog-%{+YYYY.MM.dd}" } } 1 [root@host-192-168-53-108~] #/usr/share/logstash/bin/logstash-f/etc/logstash/conf.d/system.conf 1 2 #在Elasticsearch中查看 #浏览器访问http://192.168.53.108:9100/选择基本查询搜素 1 2 [root@host-192-168-53-108~] #wgethttps://artifacts.elastic.co/downloads/kibana/kibana-5.5.0-x86_64.rpm [root@host-192-168-53-108~] #rpm-ivhkibana-5.5.0-x86_64.rpm 1 2 3 4 [root@host-192-168-53-108~] #cat/etc/kibana/kibana.yml|grep-v'^#'|grep-v^$ server.port:5601 server.host: "0.0.0.0" elasticsearch.url: "http://elk1:9200" 1 2 [root@host-192-168-53-108~] #/etc/init.d/kibanastart [root@host-192-168-53-108~] #chkconfig--addkibana 本文转自谢无赖51CTO博客,原文链接:http://blog.51cto.com/xieping/1951765,如需转载请自行联系原作者

资源下载

更多资源
优质分享App

优质分享App

近一个月的开发和优化,本站点的第一个app全新上线。该app采用极致压缩,本体才4.36MB。系统里面做了大量数据访问、缓存优化。方便用户在手机上查看文章。后续会推出HarmonyOS的适配版本。

Mario

Mario

马里奥是站在游戏界顶峰的超人气多面角色。马里奥靠吃蘑菇成长,特征是大鼻子、头戴帽子、身穿背带裤,还留着胡子。与他的双胞胎兄弟路易基一起,长年担任任天堂的招牌角色。

腾讯云软件源

腾讯云软件源

为解决软件依赖安装时官方源访问速度慢的问题,腾讯云为一些软件搭建了缓存服务。您可以通过使用腾讯云软件源站来提升依赖包的安装速度。为了方便用户自由搭建服务架构,目前腾讯云软件源站支持公网访问和内网访问。

Rocky Linux

Rocky Linux

Rocky Linux(中文名:洛基)是由Gregory Kurtzer于2020年12月发起的企业级Linux发行版,作为CentOS稳定版停止维护后与RHEL(Red Hat Enterprise Linux)完全兼容的开源替代方案,由社区拥有并管理,支持x86_64、aarch64等架构。其通过重新编译RHEL源代码提供长期稳定性,采用模块化包装和SELinux安全架构,默认包含GNOME桌面环境及XFS文件系统,支持十年生命周期更新。

用户登录
用户注册