@Transactional
  protected void initDB() throws AmbariException {
    if (configs.getPersistenceType() == PersistenceType.IN_MEMORY || dbInitNeeded) {
      LOG.info("Database init needed - creating default data");
      Users users = injector.getInstance(Users.class);

      UserEntity userEntity;

      // Create the admin user
      userEntity = users.createUser("admin", "admin", "admin");
      users.addLocalAuthentication(userEntity, "admin");
      users.grantAdminPrivilege(userEntity);

      // Create a normal user
      userEntity = users.createUser("user", "user", "user");
      users.addLocalAuthentication(userEntity, "user");

      MetainfoEntity schemaVersion = new MetainfoEntity();
      schemaVersion.setMetainfoName(Configuration.SERVER_VERSION_KEY);
      schemaVersion.setMetainfoValue(VersionUtils.getVersionSubstring(ambariMetaInfo.getServerVersion()));

      metainfoDAO.create(schemaVersion);
    }
  }
Creates default users if in-memory database is used
ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java